Skip to content
Dev Dump

🧾 System Requirements & Foundations

  • Vertical scaling: add CPU/RAM to a single node; simple but limited and lacks redundancy.
  • Horizontal scaling: add more nodes; needs load balancing and shared-nothing design, but offers resilience.
FactorsHorizontal ScalingVertical Scaling
Load BalancingRequiredN/A
FailureResilientSingle point of failure
CommunicationNetwork calls (RPC)Inter process communication
DataMay be inconsistentConsistent
ScalabilityHighly scalableHardware limited
  • Monolith: single codebase/service; faster to develop, harder to scale organizationally.
  • Microservices: independent services with well-defined APIs; enable isolated scaling but add operational complexity.
  • Modular Monolith: structured monolith offering internal boundaries without distributed overhead.
  • Availability target (“nines”) dictates permissible downtime (e.g., 99.9% → ~8.8 hours/year).
  • Reliability focuses on preventing failures through redundancy, graceful degradation, and disaster recovery.
  • Use redundancy + replication to avoid single points of failure.
  • Latency: time for a single request round-trip. Optimize via caching, CDNs, reducing network hops, and query tuning.
  • Throughput: requests/data processed per time unit. Improve via parallelism, horizontal scale, efficient batching.

Latency & Throughput

Fault tolerance is a system’s ability to handle errors or outages without losing functionality.

  • Example:
    • Application 1: Connected to a single database. If the database fails, the application stops working.
    • Application 2: Connected to a primary database and a standby replica. If the primary fails, it switches to the replica and continues working.

Fault tolerance

DNS translates human-readable domain names (e.g., www.example.com) into IP addresses that computers use to identify each other on the network.

Commands used to view the Domain name

  • dig
  • nslookup
  1. Hierarchy: DNS is hierarchical, with authoritative servers at the top level.
  2. Lookup Process: Your router or ISP provides DNS server information for lookups.
  3. Caching:
    • Lower-level DNS servers cache mappings to improve performance.
    • Cached results may become stale due to DNS propagation delays.
    • Browsers and operating systems also cache DNS results for a period defined by the Time to Live (TTL).

Key Concepts

  • Globally distributed caches serving static assets (HTML, CSS, JS, images, video).
  • Reduce latency, lighten origin load, and absorb traffic spikes.
  • Plan for cache invalidation (API purge, versioned URLs) and origin failover.

Content Delivery Networks (CDNs)

TypeActs ForPurposeExamples
Forward proxyClientsAnonymity, content filtering, bandwidth controlSquid, corporate proxies
Reverse proxyServersLoad balancing, SSL termination, caching, securityNginx, HAProxy, CDN edge