ByteByteGo

ByteByteGo

Software Development

San Francisco, California 508,797 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

    508,797 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

    508,797 followers

    Why is the credit card called “𝐭𝐡𝐞 𝐦𝐨𝐬𝐭 𝐩𝐫𝐨𝐟𝐢𝐭𝐚𝐛𝐥𝐞 product in banks”? How does VISA/Mastercard make money? The diagram below shows the economics of the credit card payment flow. 1. The cardholder pays a merchant $100 to buy a product. 2. The merchant benefits from the use of the credit card with higher sales volume, and needs to compensate the issuer and the card network for providing the payment service. The acquiring bank sets a fee with the merchant, called the “𝐦𝐞𝐫𝐜𝐡𝐚𝐧𝐭 𝐝𝐢𝐬𝐜𝐨𝐮𝐧𝐭 𝐟𝐞𝐞.” 3 - 4. The acquiring bank keeps $0.25 as the 𝐚𝐜𝐪𝐮𝐢𝐫𝐢𝐧𝐠 𝐦𝐚𝐫𝐤𝐮𝐩, and $1.75 is paid to the issuing bank as the 𝐢𝐧𝐭𝐞𝐫𝐜𝐡𝐚𝐧𝐠𝐞 𝐟𝐞𝐞. The merchant discount fee should cover the interchange fee. The interchange fee is set by the card network because it is less efficient for each issuing bank to negotiate fees with each merchant. 5. The card network sets up the 𝐧𝐞𝐭𝐰𝐨𝐫𝐤 𝐚𝐬𝐬𝐞𝐬𝐬𝐦𝐞𝐧𝐭𝐬 𝐚𝐧𝐝 𝐟𝐞𝐞𝐬 with each bank, which pays the card network for its services every month. For example, VISA charges a 0.11% assessment, plus a $0.0195 usage fee, for every swipe. 6. The cardholder pays the issuing bank for its services. Why should the issuing bank be compensated? 🔹The issuer pays the merchant even if the cardholder fails to pay the issuer.  🔹The issuer pays the merchant before the cardholder pays the issuer. 🔹The issuer has other operating costs, including managing customer accounts, providing statements, fraud detection, risk management, clearing & settlement, etc. Over to you: Does the card network charge the same interchange fee for big merchants as for small merchants? –  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

    508,797 followers

    Who are the Fantastic Four of System Design?    Scalability, Availability, Reliability, and Performance.    They are the most critical components to crafting successful software systems.    Let’s look at each of them with implementation techniques:    1 - Scalability  Scalability ensures that your application can handle more load without compromising performance.    2 - Availability  Availability makes sure that your application is always ready to serve the users and downtime is minimal.    3 - Reliability  Reliability is about building software that consistently delivers correct results.    4 - Performance  Performance is the ability of a system to carry out its tasks at an expected rate under peak load using available resources.    Over to you: What are the other pillars of system design and strategies you’ve come across? –  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

    508,797 followers

    Session, Cookie, JWT, Token, SSO, and OAuth 2.0 Explained in One Diagram    When you login to a website, your identity needs to be managed. Here is how different solutions work:    - Session - The server stores your identity and gives the browser a session ID cookie. This allows the server to track login state. But cookies don't work well across devices.    - Token - Your identity is encoded into a token sent to the browser. The browser sends this token on future requests for authentication. No server session storage is required. But tokens need encryption/decryption.    - JWT - JSON Web Tokens standardize identity tokens using digital signatures for trust. The signature is contained in the token so no server session is needed.    - SSO - Single Sign On uses a central authentication service. This allows a single login to work across multiple sites.    - OAuth2 - Allows limited access to your data on one site by another site, without giving away passwords.    - QR Code - Encodes a random token into a QR code for mobile login. Scanning the code logs you in without typing a password.    Over to you: QR code logins are gaining popularity. Do you know how it works? –  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

    508,797 followers

    We are often asked to design for high availability, high scalability, and high throughput. What do they mean exactly? The diagram below is a system design cheat sheet with common solutions. 1. High Availability This means we need to ensure a high agreed level of uptime. We often describe the design target as “3 nines” or “4 nines”. “4 nines”, 99.99% uptime, means the service can only be down 8.64 seconds per day. To achieve high availability, we need to design redundancy in the system. There are several ways to do this: - Hot-hot: two instances receive the same input and send the output to the downstream service. In case one side is down, the other side can immediately take over. Since both sides send output to the downstream, the downstream system needs to dedupe. - Hot-warm: two instances receive the same input and only the hot side sends the output to the downstream service. In case the hot side is down, the warm side takes over and starts to send output to the downstream service. - Single-leader cluster: one leader instance receives data from the upstream system and replicates to other replicas. - Leaderless cluster: there is no leader in this type of cluster. Any write will get replicated to other instances. As long as the number of write instances plus the number of read instances are larger than the total number of instances, we should get valid data. 2. High Throughput This means the service needs to handle a high number of requests given a period of time. Commonly used metrics are QPS (query per second) or TPS (transaction per second). To achieve high throughput, we often add caches to the architecture so that the request can return without hitting slower I/O devices like databases or disks. We can also increase the number of threads for computation-intensive tasks. However, adding too many threads can deteriorate the performance. We then need to identify the bottlenecks in the system and increase its throughput. Using asynchronous processing can often effectively isolate heavy-lifting components. 3. High Scalability This means a system can quickly and easily extend to accommodate more volume (horizontal scalability) or more functionalities (vertical scalability). Normally we watch the response time to decide if we need to scale the system. Over to you: Do you have other things to share in your design toolbox? –  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

    508,797 followers

    Top 5 common ways to improve API performance. Result Pagination:  This method is used to optimize large result sets by streaming them back to the client, enhancing service responsiveness and user experience. Asynchronous Logging:  This approach involves sending logs to a lock-free buffer and returning immediately, rather than dealing with the disk on every call. Logs are periodically flushed to the disk, significantly reducing I/O overhead. Data Caching:  Frequently accessed data can be stored in a cache to speed up retrieval. Clients check the cache before querying the database, with data storage solutions like Redis offering faster access due to in-memory storage. Payload Compression:  To reduce data transmission time, requests and responses can be compressed (e.g., using gzip), making the upload and download processes quicker. Connection Pooling:  This technique involves using a pool of open connections to manage database interaction, which reduces the overhead associated with opening and closing connections each time data needs to be loaded. The pool manages the lifecycle of connections for efficient resource use. Over to you: What other ways do you use to improve API performance? –  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

    508,797 followers

    Visualizing a SQL query . . SQL statements are executed by the database system in several steps, including: - Parsing the SQL statement and checking its validity - Transforming the SQL into an internal representation, such as relational algebra - Optimizing the internal representation and creating an execution plan that utilizes index information - Executing the plan and returning the results –  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