Study Guide · Bucket 3 of 7

Storage & Databases

Data kahin toh rehna hai — files, backups, structured records, sab. Yeh bucket batata hai kaunsa storage type kis use-case ke liye hai.

Context
4 storage paradigms samajhna pehle zaroori hai: Object (unstructured files + metadata), Block (compute se directly-attached hard drive), File (shared network drive), aur Database (structured, relational ya non-relational). AWS ka har storage service in 4 mein se ek ka answer hai.

Amazon S3Object Storage

What
Highly durable (99.999999999% — 11 nines), scalable object storage. Photos, videos, backups, static files, data lakes — sab yahan.
Why
Cheap aur reliable — bina server manage kiye unlimited files store karne ka tareeka. Almost har AWS architecture mein S3 kahin na kahin hota hai.
How
Bucket create karo -> Objects (files) upload karo -> permissions/policies set karo kaun access kar sakta hai -> Versioning on karo taaki same-name file ke saare versions rakhe rahein -> Lifecycle policies se purani files ko sasti storage class mein move karo (cost saving).
Skill
Coding zaroori nahi, but Boto3 (Python) seekh lo — upload/download/list scripts likh paoge, resume mein bhi accha lagta hai.
  • Buckets vs Objects
  • Bucket policies
  • Versioning
  • Lifecycle rules / storage classes

Amazon EBSElastic Block Store — Block Storage

What
EC2 instances ke liye virtual hard drives. OS boot yahin se hota hai, application data yahin rehta hai.
Why
Har EC2 ko ek disk chahiye. EBS persistent hai — instance stop bhi ho jaaye, data waise ka waisa rehta hai (jab tak volume delete na karo).
How
EC2 launch karte waqt ek EBS volume attach hota hai (root volume) -> chaaho toh extra volumes bhi attach kar sakte ho -> volume EC2 se independently backup (snapshot) ho sakta hai.
Skill
Concept-level — coding requirement nahi.
  • Persistent vs ephemeral storage
  • Snapshots
  • Attached to one instance at a time (usually)

Amazon EFSElastic File System — File Storage

What
Shared file system jise multiple EC2 instances ek saath mount kar sakte hain.
Why
Jab multiple servers ko same files read/write karne hon (e.g. shared uploads folder across a fleet of web servers), EBS kaam nahi karega (ek instance se bandha hota hai) — EFS karega.
How
File system create karo -> multiple EC2 instances pe mount karo -> sab instances same data dekhte hain -> EFS demand ke hisaab se auto-scale hota hai (storage size).
Skill
Concept-level.
  • NFS-style shared storage
  • Elastic scaling

Amazon RDSRelational Database Service

What
Managed SQL databases — PostgreSQL, MySQL, MariaDB, Oracle, SQL Server. AWS patching, backups, Multi-AZ failover sab khud sambhalta hai.
Why
Complex queries, joins, ACID transactions chahiye ho (e.g. banking, e-commerce orders) toh relational database hi sahi choice hai. RDS se tumhe database admin ka overhead nahi uthana padta.
How
Engine choose karo (jaise PostgreSQL) -> instance size choose karo -> connect karo apne app se (connection string) -> AWS backups/patches/failover khud manage karta hai.
Skill
Basic SQL (SELECT/INSERT/UPDATE/DELETE) aur app se DB connection handling aani chahiye.
  • Multi-AZ (high availability)
  • Read Replicas (read scaling)
  • Automated backups

Amazon DynamoDBNoSQL — serverless

What
Fully managed serverless NoSQL key-value/document database. Single-digit millisecond latency, kisi bhi scale pe.
Why
Jab tumhe speed aur scale chahiye but simple access patterns (key se lookup) — no joins, no capacity planning, aur scale-to-zero bhi possible hai.
How
Table banao -> primary key structure define karo (partition key + optional sort key) -> reads/writes shuru karo -> AWS scaling, backups, replication khud handle karta hai.
Skill
JSON aur NoSQL data-modeling concepts samajhne chahiye.
  • Partition key vs Sort key
  • JSON-based documents
  • Pay-per-request pricing

ElastiCache & Auroragood to know

What
ElastiCache: in-memory caching (Redis/Memcached) — sub-millisecond data retrieval. Aurora: AWS ka apna high-performance MySQL/PostgreSQL-compatible relational database.
Why
Caching se database pe load kam hota hai aur response fast hoti hai. Aurora RDS se better performance deta hai same compatibility ke saath.
How
ElastiCache cluster banao, application usse pehle cache check karta hai fir database — 'cache-aside' pattern.
Skill
Concept-level.
  • Cache-aside pattern
  • Aurora vs standard RDS
Decision Tree — kaunsi service kab
  • Files, images, backups, archives → S3 (Object)
  • EC2 ke liye hard drive chahiye → EBS (Block)
  • Multiple servers, same files share karne hain → EFS (File)
  • Complex queries / joins / ACID chahiye → RDS ya Aurora
  • Speed + scale + simple key-value lookups → DynamoDB
  • Data cache karna hai → ElastiCache
Key Tasks — is bucket ko 'done' maanne se pehle
  • S3 bucket banao, ek file upload karo, versioning on karo
  • Boto3 se ek script likho jo S3 pe file upload/list kare
  • RDS (PostgreSQL/MySQL, free-tier) instance launch karo, connect karo
  • DynamoDB table banao, ek item write/read karo
  • RDS vs DynamoDB decision khud justify kar sako