RETROSPECTIVE

September 5th, 2019

AWS Lambda Function for MySQL RDS Backups Part II: Building the Function

AWS Lambda

AWS RDS

+11 More

In my previous article I discussed my existing AWS infrastructure and the additional resources needed to automate backups for a RDS MySQL instance using a lambda function. In this article I'll create those additional resources and further explain my design decisions. Finally, I'll test the lambda function and show the backup file in my S3 bucket.

Building the Additional Infrastructure

RETROSPECTIVE

September 3rd, 2019

AWS Lambda Function for MySQL RDS Backups Part I: VPC Infrastructure

AWS Lambda

AWS RDS

+5 More

When working with Amazon RDS (Relational Database Service) or any other database, creating backups of your data is an important safety precaution. The data of an application is often its most important asset, and if its lost or damaged the app is rendered useless. With RDS, Amazon provides a backup mechanism called snapshots. Snapshots backup the database instance and allow users to restore their RDS instance from a snapshot1.

Internally snapshots are stored in an Amazon S3 (Simple Storage Service) bucket. However, these backups aren't accessible through S3, since the bucket is hidden from the users AWS account2. The only way to see snapshots is through the RDS service. Also, snapshots aren't downloadable and their contents can't be viewed. This poses some serious limitations when trying to test a database backup.

DISCOVERY

August 24th, 2019

Introducing Flexbox

Sass

CSS

Flexbox

Last summer, I wrote an article about CSS Grid. CSS Grid is a new web page layout module introduced in 2017. Today I'm writing about Flexbox, another new web page layout module released to new browsers in 20171. While CSS Grid is a two-dimensional system used to create rigid layouts, Flexbox is a one-dimensional system used to create flexible layouts with dynamic resizing of elements. Let's go over the basics!

What is Flexbox?

DISCOVERY

August 18th, 2019

Revisiting Type Equality

Java

JavaScript

+15 More

In this article I'm revisiting the concept of type equality. Type equality is a topic that software engineers learn early on in their careers. Similar to any other profession, it's beneficial to go back to the basics for practice. Professional basketball players practice layups before each game. Professional programmers should work at the basics as well. I spent this past week re-learning type equality in 13 different languages. In the process I've reaffirmed my knowledge and gained new insights. The rest of this article discusses my findings.

The Different Forms of Type Equality

DISCOVERY

August 3rd, 2019

Haskell Part VII: Applicatives

Haskell

Functional Programming

In my last Haskell Article I discussed functors, which provide a generic way to map functions over values. In this article I'm exploring applicatives, which build on top of functors. After discussing applicatives in Haskell, I'll try implementing them in Java.

Applicative Basics

RETROSPECTIVE

June 17th, 2019

Creating a Reusable Terraform Module

Terraform

HCL

+2 More

When programming with Terraform, I often find myself writing the same code again and again. In order to maintain the DRY principal in Terraform configuration, modules are used to encapsulate logic and design a layer of abstraction for infrastructure code. This article explains how I created Terraform modules that are reused throughout my AWS Infrastructure as Code.

DRY Principal

DRY stands for "Do not Repeat Yourself." It's the design philosophy that similar code shouldn't exist in multiple locations. Instead, repeated code segments should be combined into a single component or function.

DISCOVERY

May 28th, 2019

Haskell Part VI: Functors

Haskell

Java

Functional Programming

Right now I'm learning Haskell, a functional programming language. In my last few Haskell articles I've discussed basic aspects of the language. Now I've begun digging into advanced functional programming concepts. This article discusses functors, a generic way to map functions over objects.

Functor Basics

A common pattern in programming is looping through a collection of values and applying a transformation to each. For example, a programmer might loop through a list of integers and increment each value. The imperative approach to this transformation sets up a for loop and iterates over each list index. The functional approach uses the map higher-order function. map accepts two arguments - a collection to iterate over and a function. The function is applied to each item in the collection.

DISCOVERY

May 20th, 2019

Orchestrating Containers with Kubernetes Part II: Single Node Cluster

Kubernetes

Docker

+3 More

In my previous Kubernetes article, I went over the concepts of container orchestration and the architecture of a Kubernetes cluster. In this article, I'm building a single node Kubernetes cluster that runs a Node.js application.

The Node.js application is the same one I used in my article on Containerization. The Kubernetes cluster environment is very similar to my Docker playground. The single node Kubernetes cluster is created with a CloudFormation template wrapped in Terraform. It installs Docker, kubeadm, kubectl, kubelet, and kubernetes-cni. You can check out the infrastructure code on GitHub.

DISCOVERY

May 13th, 2019

Orchestrating Containers with Kubernetes Part I: Concepts

Kubernetes

Docker

+3 More

I recently wrote a series of articles on Docker and containerized applications. In those articles I worked with a single Docker container at a time. Each container was mapped to a port on its host machines IP, making it accessible from the browser. In my case, the host machine was an EC2 instance.

While the single container approach works, it has a number of limitations and drawbacks. First off, a single container isn't scalable. As web traffic to an application increases, the load becomes too much for a single container to handle. Secondly, there isn't a zero-downtime approach to release a new version of an application. The container running the old version has to stop and a container with the new version has to start in its place. While both these limitations are deal breakers in themselves, the worst part about the single container approach is that its a single point of failure. If the container stops or the application crashes, the entire website goes down. This makes deploying a production application on a single container inadequate.

DISCOVERY

May 12th, 2019

Delegate Objects in C#

C#

Java

Java 8

C# has an object called a delegate which is similar to lambda functions and functional interfaces in Java. A delegate object has a single role - calling a method. This article explores delegates and compares them to similar language constructs in C# and Java.

Delegate Basics

DISCOVERY

April 28th, 2019

Docker Part III: Containerizing an Application

Docker

Bash

+4 More

In my previous two Docker articles, I explored container environment basics and created a playground to run Docker on AWS. In this article, I'm creating a containerized application that is publicly accessible from the internet.

Containerizing a Node.js Application

DISCOVERY

April 8th, 2019

Docker Part II - Building a Playground Environment

Docker

CloudFormation

+5 More

In my previous post about Docker, I explored the basic concepts of Docker containers. In this post, I'm creating a Docker playground environment on AWS with Terraform and CloudFormation. The playground consists of an EC2 instance with Docker installed. It's accessible from the internet to facilitate containerized web applications. To start I'll discuss why I used Terraform and CloudFormation to build the playground. Then I'll take a deep dive into the infrastructure code.

Terraform & CloudFormation for IaC