@hassenchaieb

The good parts of AWS - A visual summary

January 18, 2020

What database should we use ?
What is the best hosting option ?
Which AWS services should we use and which ones should we avoid ?

With the multiplication of online services, technical choices can get very time consuming. No one has the time to test every available service in order to make the right choice. The good parts of AWS, an Ebook by Daniel Vassallo and Josh Pschorr, gives an insider view of some of the multiple AWS services. The goal is to help the reader find his own default choices when faced with a technical decision.

In this summary I’ll just scratch the surface of some of the Do’s and Don’ts that are provided in the Ebook. The Ebook contains a lot more details, examples and insider explanations of these services. You can see the complete table of content and get the Ebook here.

DynamoDB

DynamoDB is a non-relational database that has two main features : it’s immediately consistent and highly-durable (unlike Redis).

Data is highly durable
Data needs to be sent across the network
Data is immediately consistent
🔼️ important choice factor
Unlike relational databases, DynamoDB requires data operations (aggregations, filtering, sorting ..) to be done by your application. → All data needs to be sent over the network.
🔼️ important choice factor
Request pricing : It depends on the frequency of requests you are expecting ($1.25 per million writes, $0.25 per million reads) - Do the math.
🔽 less important choice factor
Storage pricing : which is ~10 times higher than S3.
↔️ You'll have to choose
Between on-demand option (no capacity management) or provisioned option (cheaper).
👎 Avoid
using local indexes.

S3

As many parallel uploads and downloads as you want
Consider using S3 when storing anything
No capacity management
👍 We like
Storage cost : S3 has very interesting storage cost ($23.55/TB/month)
⚠︎ Be careful
with request pricing when you have a very high number of requests (non-human frequency).
⚠︎ Be careful
Needs update buffering if objects change frequently (log files).
👎 Avoid
using reduced redundancy.
👎 Avoid
using S3 for static web hosting (No HTTPS).

EC2

A computer in the cloud, similar to your local one
Pick a server type, don't bother with machine configs
Pay for running time
👍 We like
You get an environment that is similar to your computer's environment
↔️ You'll have to choose
an instance type depending on what 's important for you (CPU memory, storage, etc.).
👎 Avoid
reserved instances you can use EC2 saving plans instead.
😱 Scary
With EC2 you'll have to handle security configurations. You can start with the defaults or use the Ebook's bootstrap guide section to create a secure architecture.
👍 You should use
EC2 Auto Scaling. It offers great features like health checks that will automatically replace your EC2 instance if it goes down.

Lambda

Most simple way to run code in the cloud
Better adapted for small code that doesn't change often
Do
use it as a plugin for other AWS services. For example for processing an image after uploading it to S3 or to send alert after a regex trigger on Cloudwatch (AWS logging service).
👎 Do not
use AWS Lambda as a general EC2 host.
⚠︎ Limitation
If you need to access a "state" for example by connecting to DynamoDB, it can get very expensive.

SQS & Kinesis

You can use either SQS or Kinesis when you have a queue of asynchronous processes that you need to consume.

SQSKinesis
Strict Ordering
No Duplicates
Number of consumers1Unlimited
Capacity management and limits👍 No capacity managementNeeds shard monitoring
Cost for 1Kb x 500 messages / day$34.56$0.96
Underlying data structuremultiple queueslike a durable linked list
👍 Good to know
SQS has an option called FIFO. You get strict ordering and no duplicates but you'll have a limit of 300 messages per second.

ELB

ELB lay between the internet and app instance(s)
3 types of AWS ELB
ALB or Application Load Balancer is a reverse proxy server
NLB or Network Load Balancer is a sophisticated network router
Classic, A legacy option
ALB - Application Load BalancerNLB - Network Load Balancer
HowProxies HTTP requestsRoutes network packets
TLS/HTTPS
TCP passthrough
reverse proxy features
ScaleDon’t scale fast enough
Cost-Slightly less expensive
Speed-A few milliseconds faster
AdviceIf you need specific ALB features
👍 Start with NLB

Discuss on Twitter

Join the newsletter

I write about the web, the cloud and leveling up as a developer.


Hi, I'm Hassen. I'm a Product engineer based in Paris 🇫🇷. I'm currently building data products at YOOI.