Definition: A technique of storing copies of frequently used data in a temporary storage location (RAM) so it can be accessed faster.
Definition: The process of defining the architecture, components, interfaces, and data for a system to satisfy specific requirements.
Importance: It bridges the gap between business requirements and code. Good design ensures the system is Scalable (can grow), Reliable (doesn't crash), and Maintainable (easy to fix). Without it, systems become "technical debt" traps that fail under load.
Definition: Controlling the number of requests a client can send to an API within a specified time window (e.g., 100 requests per minute).
Concept: Instead of guaranteeing that everyone sees the latest data instantly (Strong Consistency), we guarantee that if no new updates are made, all accesses will eventually return the last updated value.
Example: When you post on Instagram, your friend might not see it for a few seconds. That is acceptable. We trade immediate accuracy for High Availability and speed.
CDN (Content Delivery Network): A geographically distributed network of proxy servers. They cache content closer to the end-user.
Strengthen your fundamentals with topic-wise MCQs designed to sharpen accuracy and speed.
Definition: Breaking up a large database into smaller, faster, more manageable parts called "Shards."
Horizontal Partitioning (Sharding): Splitting rows across multiple servers. Example: Users A-M go to DB Server 1, Users N-Z go to DB Server 2.
Why? It allows a database to exceed the storage and computing limits of a single physical machine (Horizontal Scaling).
Definition: A buffer that stores messages between a Producer (sender) and a Consumer (receiver) to allow asynchronous communication (e.g., RabbitMQ, Kafka, SQS).
Definition: A data structure (like a B-Tree) that improves the speed of data retrieval operations on a database table at the cost of additional writes and storage space.
Analogy: It is like the index at the back of a book. Instead of reading every page (Full Table Scan) to find a topic, you look at the index to find the exact page number immediately.
Trade-off: Indexes make Reads fast but Writes slow (because the index must be updated on every insert/update).
Behaviors the system must perform. If these are missing, the system doesn't work.
Quality attributes regarding performance and reliability.
Adding more power (CPU, RAM, Storage) to an existing single server. Easy to do, but has a hardware limit (ceiling) and creates a single point of failure.
Adding more servers to the pool. This allows infinite scaling and high availability but requires complexity in application logic (statelessness, partitioning) and load balancing.
Paste your JD to get company insights, required skills, expected questions, and a personalized prep plan.
Reverse Proxy: A server that sits in front of web servers and forwards client requests to them. Primary goals are Security, Anonymity (hiding backend IP), and Performance (SSL termination, caching, compression). Example: Nginx.
Difference: While a Load Balancer specifically distributes traffic across multiple servers to manage load, a Reverse Proxy is often used even with a single server to handle security and protocol management. (Note: Most modern tools like Nginx perform both roles).
A Load Balancer is like a traffic cop sitting in front of your servers. It directs incoming client requests across a group of backend servers to ensure no single server is overwhelmed.
In any distributed data system, you can only provide two of the following three guarantees:
The Trade-off: Since networks will fail (P is mandatory), you must choose between CP (Wait for consistency, risk timeout) or AP (Return data fast, risk staleness).
Definition: The process of copying data from a primary database (Master) to one or more secondary databases (Slaves/Replicas).
SELECT) across multiple Replicas to reduce the load on the Master.Use JWT (JSON Web Tokens). The session data is encrypted/signed and stored in the user's browser (Cookie/LocalStorage). The server decodes it on every request. Good for scalability.
Use a Distributed Cache (Redis/Memcached). The browser holds a simple SessionID cookie. The server looks up the data in Redis. This is secure and allows for easy session revocation (banning a user instantly).
Practice with expert evaluators and receive detailed feedback to improve instantly.
Definition: API endpoints (e.g., /health) that a Load Balancer polls to determine if a service is running correctly.
Importance: They ensure high availability by automatically removing crashing or overwhelmed servers from rotation, preventing users from hitting dead endpoints.
Definition: A Load Balancer feature that ensures a specific user is always routed to the same specific server for the duration of their session.
When to use: Used when the application stores Session State locally in the server's RAM (e.g., a shopping cart stored in memory). If the user were routed to a different server, they would lose their cart.
Downside: It creates uneven load distribution and makes scaling difficult. Ideally, use a distributed cache (Redis) for sessions instead.
1. Environment Variables: Store config values (DB connection strings, API keys) in the OS environment variables, not the code.
2. Configuration Files: Use separate files (e.g., appsettings.dev.json, appsettings.prod.json) that are loaded based on the active environment flag.
3. Centralized Config Store: For distributed systems, use tools like Consul, Etcd, or AWS Parameter Store to manage config dynamically without redeploying code.
Rule of Thumb: Never commit secrets (passwords/keys) to version control (Git).
For a simple MVP (Minimum Viable Product) without complex Machine Learning:
Strengthen your fundamentals with topic-wise MCQs designed to sharpen accuracy and speed.
Logging (The "What"): Records discrete events (e.g., "Database connection failed", "User logged in"). Logs provide the details of specific errors or state changes within a single service.
Tracing (The "Where"): Tracks the lifecycle of a request as it flows across multiple microservices. It visualizes the path and latency of a request (e.g., Service A -> Service B -> Database).
Why both? In a distributed system, a request might fail in Service C, but the error originated from bad data in Service A. Logs tell you what error occurred, but Tracing tells you where it happened and how the request got there.
Always use TLS (SSL) to encrypt data between the client and server to prevent Man-in-the-Middle (MITM) attacks.
Use robust standards like OAuth2 and OpenID Connect. Issue JWTs (JSON Web Tokens) for stateless authentication. Ensure users only access data they are permitted to (RBAC/ABAC).
Prevent DDoS and brute-force attacks by limiting the number of requests a user/IP can make within a time window.
Sanitize all incoming data to prevent SQL Injection and XSS (Cross-Site Scripting) attacks. Never trust user input.
Use a gateway as a single entry point to enforce security policies, manage CORS, and hide internal service architecture.