Welcome back fellow lazy folks!

Here’s what we’ll talk about today.

Amazon EC2, S3, RDS, Lambda, DynamoDB, etc, etc. What are they, when are they used, and what are the differences?

EC2

We’ll start with a basic, foundational one that a lot of the other services use under the hood for scaling.

Amazon EC2 (Elastic Compute Cloud) is basically virtual servers in the cloud you can rent. You can choose the number of servers, the type of hardware, and install various OS/software on em.

You can have your EC2 servers auto-scale based on demand by using AWS’s auto-scaling groups, which basically means you specify, in configs, under what condition (CPU utilization, number of requests per unit of time, etc) you want to add or remove nodes!

S3

Amazon S3 (Simple Storage Service) is just a file storage in the cloud. You upload files to the cloud. Certain events are triggered when you upload files, and you can use these events to trigger things (like code execution) in other AWS services! We’ll talk more about this in just a bit! Be patient young grasshopper!

RDS

Amazon RDS (Relational Database Service) is a SQL database in the cloud. Amazon can auto-scale them for you based on read traffic (it simply adds additional read nodes), however not for write traffic.1 The read auto-scaling is done by using Amazon Aurora.

Lambda

Amazon Lambda is basically functions in the cloud. You write functions, in various languages, and you can have them be executed in response to certain API endpoints being hit, or in response to certain events happening in other AWS services (like S3, as I mentioned earlier, see patience is a virtue!).

These functions often return some JSON data, usually packaged in an HTTP response. They can auto-scale based on demand.

DynamoDB

Amazon DynamoDB is a database as well, but it’s a NoSQL database, so it scales better (horizontally) than RDS! Remember, NoSQL databases don’t need to do complex joins when querying data, so they can scale horizontally much better than SQL databases. Anyways, DynamoDB is just an auto-scalable NoSQL database in the cloud.

You’re probably noticing a pattern here. A lot of Amazon services are just things in the cloud. And often they have the option to auto-scale based on demand.

CloudFormation and AWS SAM

These services are infrastructure as code services, which basically means, in a text file, you specify what your infrastructure should look like, and then you can run a command to make this infrastructure come alive! Furthermore, you specify code (usually Lambda functions) that should be executed when certain API end points are hit, or certain events occur.

CloudFormation is the more powerful of the two, but AWS SAM is easier to use.

CloudFront

This is a just a CDN! A CDN is a network of geographically dispersed and auto-scaled servers that can deliver static content for your web pages.

Ok, ok, you caught me. That is simplifying it a bit, but in my humblest of opinions, it works haha. You can use them as a more general cache, not just for web page content (images, scripts, etc). It’s essentially a geo-distributed, auto-scaled cache network. You can set certain resources to be cached for a certain amount of time, be uncacheable, manually invalidate certain cached resources, etc. You get a decent amount of control.

VPC

Amazon VPC (Virtual Private Cloud) is your own private network in the cloud. Lol frikin amazon man, they put errything in the cloud. Might as well put the kitchen sink in there too.

Anyways, back on topic, sorry, getting restless, I’m listening to “I’m still standing” by Elton John, and I’m just feeling it, you know? Anyways, I remember saying that VPC is your own private network in the cloud and so you may be asking, “Excuse me the kindest of sirs, but how can it be private if it’s in the cloud?” Well, I’m glad you asked! The short answer is that access is restricted in a wide variety of ways such as security groups, network ACLs, and route tables. The long answer is that I’m too lazy to write it out, so you’ll have to look it up yourself :D.

If the methodologies for restricting access don’t do it for ya, you can even use a frickin VPN to directly connect the VPC to your on-premises network! Crazy times we live in, I tell ya.

Man, I’m feeling it, I’m feeling it. You should definitely listen to “I’m still standing”. It’s a banger. My current favorite song. I’m feeling it.

We gon wrap it up there! Hope you have a great day!

Conclusion

Well, let’s do a conclusion before we wrap up, to satisfy the laziest amongst us (I haven’t forgotten yall!).

  • EC2: Auto-scalable virtual servers in the cloud.
  • S3: File storage in the cloud. Emits events when things happen (file upload, modify, etc).
  • RDS: Auto-scalable SQL database in the cloud.
  • Lambda: Auto-scalable functions in the cloud.
  • DynamoDB: Auto-scalable NoSQL database in the cloud.
  • CloudFormation and AWS SAM: Infrastructure as code services.
  • CloudFront: CDN.
  • VPC: Your own private network in the cloud.
  1. Scaling for reads is super easy, you just add an additional node (server) that read-clients can, well, read from :). Scaling for writes is harder because you have to synchronize the writes to ensure consistency and data integrity!