Kinds of storage
Objects in a bucket, a disk for one server, a folder for many
S3 is object storage, EBS is block storage, EFS and FSx are file storage.
AWS storage comes in three kinds, and the exam expects you to tell them apart. Amazon S3 is object storage: whole objects in a bucket, each reached over the web by its key. Amazon EBS is block storage: a disk attached to one EC2 instance. Amazon EFS and FSx are file storage: a shared folder that many instances mount at the same time.
Kinds of storage · Going deeper
Clue words for storage
Eight storage services, eight clue phrases.
S3 storage classes
The less often you read it, the less it costs to keep
Colder classes are cheaper to store and slower or dearer to read.
One bucket can hold objects in different storage classes, and the price differs a great deal. S3 Standard, for data in active use. Standard-Infrequent Access costs about half as much to store. One Zone-Infrequent Access is cheaper again, in a single Availability Zone. Glacier Instant Retrieval is an archive that still answers in milliseconds. Glacier Flexible Retrieval takes minutes to hours. And Glacier Deep Archive, the cheapest storage on AWS, returns data within twelve hours.
S3 storage classes · Going deeper
What else S3 does
Eleven nines of durability, versioning, lifecycle rules, replication.
Disks for EC2
Inside the host, attached to one instance, or shared on the network
Instance store is temporary. EBS persists for one instance. EFS is shared by many.
An EC2 instance can keep its files in three places. Instance store is a disk inside the host machine. It is very fast, and everything on it is lost when the instance stops. EBS is a network disk for one instance, in one Availability Zone. It outlives the instance, and its snapshots are kept in S3. EFS is a file system on the network, shared by many instances across several zones, and it grows by itself.
Check yourself
Compliance records must be kept for ten years and are almost never read. Waiting a day for one is acceptable. Which S3 storage class costs least?
Managed databases
AWS does the patching, backups and failover
Use a managed database unless you need control of the operating system.
The first database decision is who runs it. On EC2, you do everything: install, patch, back up, replicate and scale. With Amazon RDS, AWS patches, backs up and fails over; you choose the engine and the size. Amazon Aurora does the same and adds storage that grows by itself, kept as six copies across three Availability Zones. With DynamoDB there are no servers and no versions at all. You create a table and use it.
Choosing a database
The shape of the data decides
Relational: RDS or Aurora. Key-value: DynamoDB. Document, graph, in-memory: one service each.
RDS availability
A standby keeps it up; a replica makes it faster
Multi-AZ is for availability. Read replicas are for read performance.
Two RDS features look alike and do different jobs. The application reads from and writes to a primary database in one Availability Zone. A Multi-AZ deployment adds a standby in a second zone, copied synchronously. You cannot query it; it takes over automatically if the primary fails. A read replica is copied asynchronously, in any zone or Region. You can query it, so it takes read traffic off the primary.
Check yourself
A relational database must keep working if its Availability Zone fails, with no manual steps. Which feature provides this?
Database migration
One tool copies the data, another converts the schema
AWS DMS migrates the data. AWS SCT converts the schema between different engines.
Moving a database into AWS uses up to two tools. When the engine stays the same, the Database Migration Service copies the data while the source stays in use. When the engine changes, say from Oracle to Aurora PostgreSQL, the Schema Conversion Tool rewrites the tables and code first, and then the Migration Service copies the data.
Check yourself
Twelve EC2 instances in three Availability Zones must read and write the same set of files at the same time. Which storage fits?
Lesson complete
You finished “Storage and databases on AWS”
Answer the questions along the way to see your score here.