Storage - EBS, S3, RDS, ElasticCache, and CloudFront

When you create an EC2 instance, it works with one or several Elastic Block Stores (EBS) (https://aws.amazon.com/ebs/). An EBS is a replicated storage volume EC2 instances can mount to use as their filesystem. When you create a new EC2 instance, you can create a new EBS, and decide if it runs on an SSD or an HDD disk, the initial size, and some other options. Depending on your choices, the volume is more or less expensive.

Simple Storage Service (S3) (https://aws.amazon.com/s3/) is a storage service that organizes data into buckets. Buckets are, roughly, namespaces that you can use to organize your data. A bucket can be seen as a key-value storage, where a value is data you want to store. There is no upper limit for the size of the data, and S3 provides everything needed to stream big files in and out of its buckets. S3 is often used to distribute files, since each entry in a bucket can be exposed as a unique, public URL. CloudFront can be configured to use S3 as a backend.

One interesting feature is that S3 provides different storage backend depending on how often the files are written or accessed. For instance, Glacier (https://aws.amazon.com/glacier/) can be used as a backend when you want to store big files that are rarely accessed. One use case can be backups. It is quite easy to interact with S3 from your Python applications, and pretty common to see S3 as a data backend in microservices.

ElasticCache (https://aws.amazon.com/elasticache/) is a cache service that has two backends--Redis and Memcached. ElasticCache leverages Redis' shard and replication features, and lets you deploy a cluster of Redis nodes. If you host a lot of data in Redis and might go over the RAM capacity, Redis shards can spread the data across several nodes and raise Redis' capacity.

Relational Database Service (RDS) (https://aws.amazon.com/rds/) is a database service that has many database backends available; in particular, MySQL and PostgreSQL.

AWS has an online calculator you can use to estimate the cost of your deployments; see http://calculator.s3.amazonaws.com/index.html.

The big advantage of using RDS over your database deployment is that AWS takes care of managing clusters of nodes, and offers high availability and reliability for your database without having to worry about doing any maintenance work yourself. The recent addition of PostgreSQL in RDS backends made this service very popular, and is often one of the reasons people host their application on AWS.

Another recently added backend is the proprietary, locked-in Amazon Aurora (https://aws.amazon.com/rds/aurora/details/), which implements MySQL 5.x, but is supposed to run much faster (5x faster, according to Amazon).

Lastly, CloudFront (https://aws.amazon.com/cloudfront/) is Amazon's Content Delivery Network (CDN). If you have static files you want to serve, this is the best way to do it when your users are spread all over the world. Amazon caches the files, and makes them available with the minimum latency possible by routing the client's requests to the closest server. A CDN is what you need to use to serve video, CSS, and JS files--one thing to look at, though, is the cost. If you have a few assets to serve for your microservice, it might be simpler to serve them directly from your EC2 instance.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset