System design Flashcards
CDN (Content Delivery Network)
Definition: Distributed servers deliver content based on user location.
Pros: Reduces latency, handles traffic, improves UX, DDoS protection.
Cons: Can be costly, not for small/local apps.
Use: Speed up global content delivery.
CAP Theorem
Definition: In a distributed system, cannot have full Consistency, Availability, and Partition tolerance at once.
Use: Framework for understanding trade-offs in network partitions.
Redis
Definition: In-memory data structure store, used as database, cache, message broker.
Pros: Fast, rich data types, persistence, atomic ops.
Cons: Memory-bound, expensive scaling.
Use: Real-time processing, caching, sessions, leaderboards.
SQL vs NoSQL Databases
SQL: Relational, ACID, complex queries.
NoSQL: Scalable, flexible schema, various data types.
Use SQL: Transactional apps with complex queries.
Use NoSQL: Large data sets, real-time web apps.
Cassandra
Definition: Distributed NoSQL database for large data across many servers.
Pros: Scalable, fault-tolerant, tunable consistency.
Cons: Complex configuration, slower heavy reads.
Use: Write-heavy workloads, IoT, time-series data.
High Availability
Definition: System’s ability to be operational without significant downtime.
Use: Essential for mission-critical services.
Horizontal vs Vertical Scaling
Horizontal: Add more machines for growth.
Vertical: Upgrade existing machine’s power.
Use Horizontal: Systems that grow by machine addition.
Use Vertical: Upgrading machines is more viable.
Database Options and Tradeoffs
Options: MySQL, PostgreSQL, MongoDB, etc.
Tradeoffs: Consistency vs availability, complexity vs scalability.
Cloud Storage
Definition: Remote storage service accessible via internet.
Pros: Scalable, reliable, cost-effective.
Cons: Internet dependence, security concerns.
Use: Accessible storage, backup, web apps.
Partitioning
Definition: Dividing large tables into smaller pieces for manageability.
Use: Improve performance and availability of large databases.
Service-Oriented Architecture (SOA)
Definition: Architectural pattern where services are provided to other components by application components, through a communication protocol over a network.
Pros: Reusable business components, flexibility, scalability.
Cons: Can be complex, potential performance overhead.
Use: Systems that require integration of heterogeneous and legacy systems.
Distributed Software Systems
Definition: Systems in which components are located on different networked computers, which communicate and coordinate actions by passing messages.
Pros: Scalability, fault tolerance, resource sharing.
Cons: Complexity of process coordination, network latency.
Use: Applications where components can work on separate tasks simultaneously.
Caching
Definition: Storing copies of files in a cache, or temporary storage location, so they can be accessed more quickly.
Pros: Reduces database load, improves speed, decreases latency.
Cons: Complexity of cache invalidation, potential for stale data.
Use: High-traffic websites, applications where data retrieval speed is critical.
Load Balancing
Definition: Process of distributing network or application traffic across multiple servers to ensure no single server bears too much demand.
Pros: Reduces server load, increases availability and redundancy.
Cons: Can introduce complexity, single point of failure if not implemented correctly.
Use: Systems that require high availability and redundancy, handling of concurrent user requests.
Non-relational Databases
Definition: Databases not based on the relational model, storing data in a format other than tables.
Pros: Scalability, flexibility with unstructured data, quick iteration.
Cons: Lack of standardization, transactional support varies.
Use: Big data applications, content management systems, real-time analytics.