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).
🔼️ 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
👍 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.
👎 Caution
using S3 for static web hosting (No HTTPS).
EC2
👍 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
✅ 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.
SQS
Kinesis
Strict Ordering
❌
✅
No Duplicates
❌
✅
Number of consumers
1
Unlimited
Capacity management and limits
👍 No capacity management
Needs shard monitoring
Cost for 1Kb x 500 messages / day
$34.56
$0.96
Underlying data structure
multiple queues
like 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.