This week’s system design refresher:
Linux Performance Tools! (Youtube video)
How does Garbage Collection work?
A Cheat Sheet for Designing Fault-Tolerant Systems
10 System Design Tradeoffs You Cannot Ignore
SPONSOR US
WorkOS: Modern Identity Platform for B2B SaaS (Sponsored)
Start selling to enterprises with just a few lines of code.
→ WorkOS provides a complete user management solution along with SSO, SCIM, Audit Logs, & Fine-Grained Authorization.
→ Unlike other auth providers that rely on user-centric models, WorkOS is designed for B2B SaaS with an org modeling approach.
→ The APIs are flexible, easy-to-use, and modular. Pick and choose what you need and integrate in minutes.
→ User management is free up to 1 million MAUs and comes standard with RBAC, bot protection, MFA, & more.
Linux Performance Tools!
How does Garbage Collection work?
Garbage collection is an automatic memory management feature used in programming languages to reclaim memory no longer used by the program.
Java
Java provides several garbage collectors, each suited for different use cases:
1. Serial Garbage Collector: Best for single-threaded environments or small applications.
2. Parallel Garbage Collector: Also known as the "Throughput Collector."
3. CMS (Concurrent Mark-Sweep) Garbage Collector: Low-latency collector aiming to minimize pause times.
4. G1 (Garbage-First) Garbage Collector: Aims to balance throughput and latency.
5. Z Garbage Collector (ZGC): A low-latency garbage collector designed for applications that require large heap sizes and minimal pause times.Python
Python's garbage collection is based on reference counting and a cyclic garbage collector:
1. Reference Counting: Each object has a reference count; when it reaches zero, the memory is freed.
2. Cyclic Garbage Collector: Handles circular references that can't be resolved by reference counting.GoLang
Concurrent Mark-and-Sweep Garbage Collector: Go's garbage collector operates concurrently with the application, minimizing stop-the-world pauses.
Latest articles
If you’re not a paid subscriber, here’s what you missed.
To receive all the full articles and support ByteByteGo, consider subscribing:
A Cheat Sheet for Designing Fault-Tolerant Systems
Designing fault-tolerant systems is crucial for ensuring high availability and reliability in various applications. Here are six top principles of designing fault-tolerant systems:
Replication
Replication involves creating multiple copies of data or services across different nodes or locations.Redundancy
Redundancy refers to having additional components or systems that can take over in case of a failure.Load Balancing
Load balancing distributes incoming network traffic across multiple servers to ensure no single server becomes a point of failure.Failover Mechanisms
Failover mechanisms automatically switch to a standby system or component when the primary one fails.Graceful Degradation
Graceful degradation ensures that a system continues to operate at reduced functionality rather than completely failing when some components fail.Monitoring and Alerting
Continuously monitor the system's health and performance, and set up alerts for any anomalies or failures.
10 System Design Tradeoffs You Cannot Ignore
If you don’t know trade-offs, you DON'T KNOW system design.
Vertical vs Horizontal Scaling
Vertical scaling is adding more resources (CPU, RAM) to an existing server.Horizontal scaling means adding more servers to the pool.
SQL vs NoSQL
SQL databases organize data into tables of rows and columns.NoSQL is ideal for applications that need a flexible schema.
Batch vs Stream Processing
Batch processing involves collecting data and processing it all at once. For example, daily billing processes.Stream processing processes data in real time. For example, fraud detection processes.
Normalization vs Denormalization
Normalization splits data into related tables to ensure that each piece of information is stored only once.Denormalization combines data into fewer tables for better query performance.
Consistency vs Availability
Consistency is the assurance of getting the most recent data every single time.Availability is about ensuring that the system is always up and running, even if some parts are having problems.
Strong vs Eventual Consistency
Strong consistency is when data updates are immediately reflected.Eventual consistency is when data updates are delayed before being available across nodes.
REST vs GraphQL
With REST endpoints, you gather data by accessing multiple endpoints.With GraphQL, you get more efficient data fetching with specific queries but the design cost is higher.
Stateful vs Stateless
A stateful system remembers past interactions.A stateless system does not keep track of past interactions.
Read-Through vs Write-Through Cache
A read-through cache loads data from the database in case of a cache miss.A write-through cache simultaneously writes data updates to the cache and storage.
Sync vs Async Processing
In synchronous processing, tasks are performed one after another.In asynchronous processing, tasks can run in the background. New tasks can be started without waiting for a new task.
Over to you: Which other tradeoffs have you encountered?
SPONSOR US
Get your product in front of more than 1,000,000 tech professionals.
Our newsletter puts your products and services directly in front of an audience that matters - hundreds of thousands of engineering leaders and senior engineers - who have influence over significant tech decisions and big purchases.
Space Fills Up Fast - Reserve Today
Ad spots typically sell out about 4 weeks in advance. To ensure your ad reaches this influential audience, reserve your space now by emailing sponsorship@bytebytego.com
why are the pictures always so blurry? Where can I get a clear photo?
Just right click and download the image. Open the webp in your browser and it will be high resolution. You are developers right?