ByteByteGo

ByteByteGo

Software Development

San Francisco, California 526,121 followers

Weekly system design newsletter you can read in 10 mins.

About us

A popular weekly newsletter covering topics and trends in large-scale system design, from the authors of the best-selling System Design Interview series.

Website
https://blog.bytebytego.com/
Industry
Software Development
Company size
1 employee
Headquarters
San Francisco, California
Type
Privately Held

Locations

Employees at ByteByteGo

Updates

  • View organization page for ByteByteGo, graphic

    526,121 followers

    I’ve been writing the system design newsletter for 12 months. Here are the 5 most popular ones: 👇 1. From 0 to Millions: A Guide to Scaling Your App 2. A Crash Course in Caching 3. API Architectural Styles 4. How does ChatGPT work? 5. 8 Data Structures That Power Your Databases Subscribe to our weekly newsletter to get a Free System Design PDF (158 pages): https://bit.ly/3FEGliw .

    • No alternative text description for this image
  • View organization page for ByteByteGo, graphic

    526,121 followers

    What is a webhook? The diagram below shows a comparison between polling and webhook. Assume we run an eCommerce website. The clients send orders to the order service via the API gateway, which goes to the payment service for payment transactions. The payment service then talks to an external payment service provider (PSP) to complete the transactions. There are two ways to handle communications with the external PSP. 🔹 1. Short polling After sending the payment request to the PSP, the payment service keeps asking the PSP about the payment status. After several rounds, the PSP finally returns with the status. Short polling has two drawbacks: 1) Constant polling of the status requires resources from the payment service. 2) The External service communicates directly with the payment service, creating security vulnerabilities. 🔹 2. Webhook We can register a webhook with the external service. It means: call me back at a certain URL when you have updates on the request. When the PSP has completed the processing, it will invoke the HTTP request to update the payment status. In this way, the programming paradigm is changed, and the payment service doesn’t need to waste resources to poll the payment status anymore. What if the PSP never calls back? We can set up a housekeeping job to check payment status every hour. Webhooks are often referred to as reverse APIs or push APIs because the server sends HTTP requests to the client. We need to pay attention to 3 things when using a webhook: 1) We need to design a proper API for the external service to call. 2) We need to set up proper rules in the API gateway for security reasons. 3) We need to register the correct URL at the external service. --  Subscribe to our weekly newsletter to get a Free System Design PDF (158 pages): https://bit.ly/3KCnWXq #systemdesign #coding #interviewtips  .

    • No alternative text description for this image
  • View organization page for ByteByteGo, graphic

    526,121 followers

    URL, URI, URN - Do you know the differences?  .  .  The diagram below shows a comparison of URL, URI, and URN.    🔹 URI  URI stands for Uniform Resource Identifier. It identifies a logical or physical resource on the web. URL and URN are subtypes of URI. URL locates a resource, while URN names a resource.    A URI is composed of the following parts:  scheme:[//authority]path[?query][hashtag# fragment]    🔹 URL  URL stands for Uniform Resource Locator, the key concept of HTTP. It is the address of a unique resource on the web. It can be used with other protocols like FTP and JDBC.    🔹 URN  URN stands for Uniform Resource Name. It uses the urn scheme. URNs cannot be used to locate a resource. A simple example given in the diagram is composed of a namespace and a namespace-specific string.    If you would like to learn more detail on the subject, I would recommend W3C’s clarification. --  Subscribe to our weekly newsletter to get a Free System Design PDF (158 pages): https://bit.ly/3KCnWXq #systemdesign #coding #interviewtips  .

    • No alternative text description for this image
  • View organization page for ByteByteGo, graphic

    526,121 followers

    What are the top 𝐜𝐚𝐜𝐡𝐞 strategies? . . Read data from the system: 🔹 Cache aside 🔹 Read through Write data to the system: 🔹 Write around 🔹 Write back 🔹 Write through The diagram below illustrates how those 5 strategies work. Some of the caching strategies can be used together. I left out a lot of details as that will make the post very long. Feel free to leave a comment so we can learn from each other. Question: What are the pros and cons of each caching strategy? How to choose the right one to use? --  Subscribe to our weekly newsletter to get a Free System Design PDF (158 pages): https://bit.ly/3KCnWXq #systemdesign #coding #interviewtips  .

    • No alternative text description for this image
  • View organization page for ByteByteGo, graphic

    526,121 followers

    How Discord Stores 𝐓𝐫𝐢𝐥𝐥𝐢𝐨𝐧𝐬 𝐎𝐟 𝐌𝐞𝐬𝐬𝐚𝐠𝐞𝐬  .  .  The diagram below shows the evolution of message storage at Discord:    MongoDB ➡️ Cassandra ➡️ ScyllaDB    In 2015, the first version of Discord was built on top of a single MongoDB replica. Around Nov 2015, MongoDB stored 100 million messages and the RAM couldn’t hold the data and index any longer. The latency became unpredictable. Message storage needs to be moved to another database. Cassandra was chosen.    In 2017, Discord had 12 Cassandra nodes and stored billions of messages.    At the beginning of 2022, it had 177 nodes with trillions of messages. At this point, latency was unpredictable, and maintenance operations became too expensive to run.    There are several reasons for the issue:    - Cassandra uses the LSM tree for the internal data structure. The reads are more expensive than the writes. There can be many concurrent reads on a server with hundreds of users, resulting in hotspots.  - Maintaining clusters, such as compacting SSTables, impacts performance.  - Garbage collection pauses would cause significant latency spikes    ScyllaDB is Cassandra compatible database written in C . Discord redesigned its architecture to have a monolithic API, a data service written in Rust, and ScyllaDB-based storage.    The p99 read latency in ScyllaDB is 15ms compared to 40-125ms in Cassandra. The p99 write latency is 5ms compared to 5-70ms in Cassandra.    Over to you: What kind of NoSQL database have you used? How do you like it?    References:  scylladb. com/product/technology/shard-per-core-architecture  discord. com/blog/how-discord-stores-trillions-of-messages --  Subscribe to our weekly newsletter to get a Free System Design PDF (158 pages): https://bit.ly/3KCnWXq #systemdesign #coding #interviewtips  .

    • No alternative text description for this image
  • View organization page for ByteByteGo, graphic

    526,121 followers

    A nice cheat sheet of different databases in cloud services.    Choosing the right database for your project is a complex task. The multitude of database options, each suited to distinct use cases, can quickly lead to decision fatigue.    We hope this cheat sheet provides high level direction to pinpoint the right service that aligns with your project's needs and avoid potential pitfalls.    Note: Google has limited documentation for their database use cases. Even though we did our best to look at what was available and arrived at the best option, some of the entries may be not accurate.    Over to you: Which database have you used in the past, and for what use cases? --  Subscribe to our weekly newsletter to get a Free System Design PDF (158 pages): https://bit.ly/3KCnWXq #systemdesign #coding #interviewtips  .

    • No alternative text description for this image
  • ByteByteGo reposted this

    Big O Notation 101: The Secret to Writing Efficient Algorithms From simple array operations to complex sorting algorithms, understanding the Big O Notation is critical for building high-performance software solutions. 1 - O(1) This is the constant time notation. The runtime remains steady regardless of input size. For example, accessing an element in an array by index and inserting/deleting an element in a hash table. 2 - O(n) Linear time notation. The runtime grows in direct proportion to the input size. For example, finding the max or min element in an unsorted array. 3 - O(log n) Logarithmic time notation. The runtime increases slowly as the input grows. For example, a binary search on a sorted array and operations on balanced binary search trees. 4 - O(n^2) Quadratic time notation. The runtime grows exponentially with input size. For example, simple sorting algorithms like bubble sort, insertion sort, and selection sort. 5 - O(n^3) Cubic time notation. The runtime escalates rapidly as the input size increases. For example, multiplying two dense matrices using the naive algorithm. 6 - O(n logn) Linearithmic time notation. This is a blend of linear and logarithmic growth. For example, efficient sorting algorithms like merge sort, quick sort, and heap sort 7 - O(2^n) Exponential time notation. The runtime doubles with each new input element. For example, recursive algorithms solve problems by dividing them into multiple subproblems. 8 - O(n!) Factorial time notation. Runtime skyrockets with input size. For example, permutation-generation problems. 9 - O(sqrt(n)) Square root time notation. Runtime increases relative to the input’s square root. For example, searching within a range such as the Sieve of Eratosthenes for finding all primes up to n. Over to you: What else will you add to better understand the Big O Notation? -- Subscribe to our weekly newsletter to get a Free System Design PDF (158 pages): https://bit.ly/3KCnWXq #systemdesign #coding #interviewtips .

    • No alternative text description for this image
  • View organization page for ByteByteGo, graphic

    526,121 followers

    HTTPS, SSL Handshake, and Data Encryption Explained to Kids.    HTTPS: Safeguards your data from eavesdroppers and breaches. Understand how encryption and digital certificates create an impregnable shield.    SSL Handshake: Behind the Scenes — Witness the cryptographic protocols that establish a secure connection. Experience the intricate exchange of keys and negotiation.    Secure Data Transmission: Navigating the Tunnel — Journey through the encrypted tunnel forged by HTTPS. Learn how your information travels while shielded from cyber threats.    HTML's Role: Peek into HTML's role in structuring the web. Uncover how hyperlinks and content come together seamlessly. And why is it called HYPER TEXT.    Over to you: In this ever-evolving digital landscape, what emerging technologies do you foresee shaping the future of cybersecurity or the web? --  Subscribe to our weekly newsletter to get a Free System Design PDF (158 pages): https://bit.ly/3KCnWXq #systemdesign #coding #interviewtips  .

    • No alternative text description for this image
  • View organization page for ByteByteGo, graphic

    526,121 followers

    How did AWS grow from just a few services in 2006 to over 200 fully-featured services? Let's take a look.    Since 2006, it has become a cloud computing leader, offering foundational infrastructure, platforms, and advanced capabilities like serverless computing and AI.    This expansion empowered innovation, allowing complex applications without extensive hardware management. AWS also explored edge and quantum computing, staying at tech's forefront.    This evolution mirrors cloud computing's shift from niche to essential, benefiting global businesses with efficiency and scalability    Happy to present the curated list of AWS services introduced over the years below.    Note:  - The announcement or preview year differs from the public release year for certain services. In these cases, we've noted the service under the release year  - Unreleased services noted in announcement years    Over to you: Are you excited about all the new services, or do you find it overwhelming? --  Subscribe to our weekly newsletter to get a Free System Design PDF (158 pages): https://bit.ly/3KCnWXq #systemdesign #coding #interviewtips  .

    • No alternative text description for this image

Similar pages

Browse jobs