AWS: Storage and Servers
In last weeks blog, I wrote a nice introduction about cloud computing and the benefits of it. We spoke about the different types of cloud computing, different methods of app deployment and the AWS global infrastructure. As promised, today we’ll focus on S3 and EC2.
S3 ( Simple Storage Service)
S3 provides developers and IT teams with secure, durable, and highly scalable object storage. The object base storage allows for files that are 0 Bytes to 5TB and unlimited storage. Just like most computers, we store our data inside of ‘files’ but S3 instead calls them ‘buckets’. Because this is the cloud, data is spread across multiple devices and facilities.
S3 Consistency
S3 provides read-after-write consistency for PUTS of new objects in your buckets & eventual consistency for overwrite PUTS and DELETE. Read-after-write consistency helps with immediate visibility of new objects. Let’s say you’ve uploaded a jpeg to your bucket. As soon as that file creating is completed you can open it and read it. Overwrite PUTS or DELTES are for files that already exist inside the bucket and therefore can take time to propagate. Let’s say you’re uploading a .txt file that already exists inside of your bucket that includes some small changes. The object needs to be replaced across all Availability Zones in your region. During the time of propagation, if you tried to access your .txt file, you may see the old one or the new one.
S3 Guarantees
S3 has the following guarantees by Amazon.
- Built for 99.99% availability for S3 platform
- Amazon guarantees 99.99999999999% durability for S3 info
This basically means that it would be VERY unlikely for information to go missing using their platform.
S3 Storage Classes
- S3 Standard — 99.99% availability and 99.99999999999% durability across multiple devices and facilities.
- S3- IA(Infrequently Accessed) — for data accessed less frequently but requires rapid access.
- S3 One Zone IA — best option for lower-cost of IA data and that does not require multiple availability zones
- S3 Intelligent Tiering — designed to optimize by moving data to the most cost effective tier
- Glacier — secure, durable and low cost storage or data archiving
- Glacier Deep Archive — lowest cost storage where a 12 hour retrieval time is suitable.
Create a Website using S3
Consider that you want to make a website using AWS services. At this point you know that you can store your data in different availability zones (AZ) to increase performance based on the location of the user. How does that work though?
Cloudfront is a content delivery network (CDN) which is a system of distributed servers that deliver webpages and other web content to a user based on geographic locations of the user.
Remember these terms:
- Edge Locations — where content is cached. This is separate to an AWS region or AZ. Think of caching as creating local copies of the original file.
- Origin — origin of all the files that the CDN will distribute. This can be an S3 bucket, and EC2 instance, an elastic load balance, or route 53.
- Distribution — name of CDN which consists of a collection of edge locations.
Amazons Cloudfront can be used to deliver your website using a global network of edge locations. Requests for your content are automatically routed to the nearest edge location, so content is delivered with the best possible performance.
EC2 Elastic Compute Cloud
EC2 is a virtual server on the cloud that reduces the time required to obtain and boot a new server from months to minutes, allowing you to quickly scale capacity, both up and down, for any changes in requirements.
EC2 Price Models
- On Demand — Pay a fix rate by the hour with no commitment. This is useful for users that want low cost and flexibility of Amazon EC2 without any up-front payment or longterm commitment.
- Reserved — provides you with capacity reservation, and offers a significant discount on the hourly charge for an instance contract term of 1–3 year(s). Best for apps with steady state or predictable usage.
- Spot — bid whatever price you want for instance capacity providing greater saving if app has flexible start and end times.
- Dedicated Host — Physical EC2 server to help reduce cost by allowing you to use server-bound software license.
EBS ( Your Virtual Disk)
Amazon EBS allows you to create storage volumes and attach them to EC2 instances. Once attached you can create a file system on top of the volume, run a database, or use them in many different ways.
There are a few different types of EBS types.
SSD ( Solid State Drive)
- General Purpose SSD — balances price and performances for a wide variety of workloads.
- Provisional IOPS SSD — highest performance SSD volume for mission-critical, low latency, or high-throughput workloads.
Magnetic
- Throughput Optimized HDD — designed for frequently accessed, thoughput intensive workloads.
- Cold HDD — low cost for less frequently access workloads
- Magnetic — Previous Gen
That’s it for this blog! I hope you find this tech as interesting as I do. I’m currently studying for my cloud practitioner certification that I’d like to get sometime in the near future. If some of this stuff sounds a bit foreign or abstract, don’t worry. As Jason Segel once said, “No one understands the cloud!”. All this stuff is virtual and makes things a bit harder to grasp but I highly recommend getting your hands dirty with it. Create an account, create groups and users with different policies. As always, happy coding!