DEV Community

Darshan
Darshan

Posted on

Day 4: System Design Basics + AWS Storage

Today was all about understanding how real-world systems are designed for scalability, speed, and reliability.

πŸ”Ή Username Availability Check (Backend Logic)
Ever wondered how apps instantly tell you β€œusername already taken”?
I explored:

Using Redis HashMap for fast lookup (cache hit ⚑)
Storing key-value pairs like username β†’ userId
Result: Super fast checks without hitting the database every time

Also learned about:

Tries (Prefix Trees) β†’ Efficient string search
Time Complexity: O(m), where m = length of string

πŸ”Ή Data Structures for Scale

B+ Trees β†’ Used in databases (O(log N))
Bloom Filters β†’ Memory-efficient, fast checks (with small error probability)

πŸ”Ή System Design Components

πŸ’‘ API Gateway

Handles requests
Authentication & Authorization
Rate limiting
Request/Response transformation
Monitoring & analytics

πŸ’‘ Load Balancer

Distributes traffic across servers
Improves scalability & availability
Algorithms:
Round Robin
Least Connections
IP Hash
Weighted

πŸ’‘ Reverse Proxy (like Nginx)

Sits in front of servers
Adds caching, security, compression
Flow: Client β†’ Proxy β†’ Backend β†’ Proxy β†’ Response

πŸ”Ή AWS Storage Deep Dive

πŸ“¦ EBS (Elastic Block Storage)

Virtual hard disk for EC2
Persistent storage
Can detach & attach to other instances
Works within same Availability Zone

πŸ“¦ S3 (Object Storage)

Stores files, backups
Access via API (HTTP)
Highly scalable

πŸ“¦ Instance Storage

Temporary (ephemeral)
Very fast
Used for cache/temp data

πŸ”₯ Key Takeaway
Speed = Cache (Redis)
Scalability = Load Balancer + API Gateway
Efficiency = Right Data Structure (Trie, Bloom Filter)
Storage = Use the right AWS service

Top comments (0)