Skip to Content

EP144: The 9 Algorithms That Dominate Our World

EP144: The 9 Algorithms That Dominate Our World

This week’s system design refresher:
͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­
Forwarded this email? Subscribe here for more

WorkOS: Your app, Enterprise Ready. (Sponsored)

WorkOS is a modern identity platform for B2B SaaS.

→ A complete user management solution that is free up to 1 million MAUs. Includes MFA, RBAC, bot protection, and user impersonation.
→ Enterprise SSO that supports any identity provider that uses SAML or OIDC protocols.
→ Directory Sync that powers user provisioning and deprovisioning for any SCIM-compliant directory.
→ Fine-Grained Authorization (FGA) that can support complex authorization schemes like Google Docs-style permissions.
→ The Admin Portal, a self-serve UI that streamlines SSO and SCIM onboarding for your customers' IT admins.

WorkOS is used by hundreds of high-growth companies including Cursor, Perplexity, and Vercel.

Start deploying enterprise plans today


This week’s system design refresher:

  • The 9 Algorithms That Dominate Our World

  • What does API gateway do?

  • How does gRPC work?

  • Docker vs. Kubernetes. Which one should we use?

  • How many API architecture styles do you know?

  • CI/CD Pipeline Explained

  • MVC, MVP, MVVM, VIPER Patterns

  • SPONSOR US


The 9 Algorithms That Dominate Our World

The diagram below shows the most commonly used algorithms in our daily lives. They are used in internet search engines, social networks, WiFi, cell phones, and even satellites.

No alternative text description for this image
  1. Sorting

  2. Dijkstra’s Algorithm

  3. Transformers

  4. Link Analysis

  5. RSA Algorithm

  6. Integer Factorization

  7. Convolutional Neural Networks

  8. Huffman Coding

  9. Secure Hash Algorithm

Over to you: Are there any other commonly used algorithms we missed?


What does API gateway do?

The diagram below shows the detail.

No alternative text description for this image

Step 1 - The client sends an HTTP request to the API gateway.

Step 2 - The API gateway parses and validates the attributes in the HTTP request.

Step 3 - The API gateway performs allow-list/deny-list checks.

Step 4 - The API gateway talks to an identity provider for authentication and authorization.

Step 5 - The rate limiting rules are applied to the request. If it is over the limit, the request is rejected.

Steps 6 and 7 - Now that the request has passed basic checks, the API gateway finds the relevant service to route to by path matching.

Step 8 - The API gateway transforms the request into the appropriate protocol and sends it to backend microservices.

Steps 9-12: The API gateway can handle errors properly, and deals with faults if the error takes a longer time to recover (circuit break). It can also leverage ELK (Elastic-Logstash-Kibana) stack for logging and monitoring. We sometimes cache data in the API gateway.

Over to you:

  1. What’s the difference between a load balancer and an API gateway?

  2. Do we need to use different API gateways for PC, mobile and browser separately?


How does gRPC work?

RPC (Remote Procedure Call) is called “remote” because it enables communications between remote services when services are deployed to different servers under microservice architecture. From the user’s point of view, it acts like a local function call.

The diagram below illustrates the overall data flow for gRPC.

No alternative text description for this image

Step 1: A REST call is made from the client. The request body is usually in JSON format.

Steps 2 - 4: The order service (gRPC client) receives the REST call, transforms it, and makes an RPC call to the payment service. gPRC encodes the client stub into a binary format and sends it to the low-level transport layer.

Step 5: gRPC sends the packets over the network via HTTP2. Because of binary encoding and network optimizations, gRPC is said to be 5X faster than JSON.

Steps 6 - 8: The payment service (gRPC server) receives the packets from the network, decodes them, and invokes the server application.

Steps 9 - 11: The result is returned from the server application, and gets encoded and sent to the transport layer.

Steps 12 - 14: The order service receives the packets, decodes them, and sends the result to the client application.

Over to you: Have you used gPRC in your project? What are some of its limitations?


Docker vs. Kubernetes. Which one should we use?

No alt text provided for this image

What is Docker ?
Docker is an open-source platform that allows you to package, distribute, and run applications in isolated containers. It focuses on containerization, providing lightweight environments that encapsulate applications and their dependencies.

What is Kubernetes ?
Kubernetes, often referred to as K8s, is an open-source container orchestration platform. It provides a framework for automating the deployment, scaling, and management of containerized applications across a cluster of nodes.

How are both different from each other ?
Docker: Docker operates at the individual container level on a single operating system host.

You must manually manage each host and setting up networks, security policies, and storage for multiple related containers can be complex.

Kubernetes: Kubernetes operates at the cluster level. It manages multiple containerized applications across multiple hosts, providing automation for tasks like load balancing, scaling, and ensuring the desired state of applications.

In short, Docker focuses on containerization and running containers on individual hosts, while Kubernetes specializes in managing and orchestrating containers at scale across a cluster of hosts.

Over to you: What challenges prompted you to switch from Docker to Kubernetes for managing containerized applications?


How many API architecture styles do you know?

No alt text provided for this image

Architecture styles define how different components of an application programming interface (API) interact with one another. As a result, they ensure efficiency, reliability, and ease of integration with other systems by providing a standard approach to designing and building APIs. Here are the most used styles:

  • SOAP:
    Mature, comprehensive, XML-based
    Best for enterprise applications

  • RESTful:
    Popular, easy-to-implement, HTTP methods
    Ideal for web services

  • GraphQL:
    Query language, request specific data
    Reduces network overhead, faster responses

  • gRPC:
    Modern, high-performance, Protocol Buffers
    Suitable for microservices architectures

  • WebSocket:
    Real-time, bidirectional, persistent connections
    Perfect for low-latency data exchange

  • Webhook:
    Event-driven, HTTP callbacks, asynchronous
    Notifies systems when events occur

Over to you: Are there any other famous styles we missed?


CI/CD Pipeline Explained

No alt text provided for this image

A CI/CD pipeline is a tool that automates the process of building, testing, and deploying software.

It integrates the different stages of the software development lifecycle, including code creation and revision, testing, and deployment, into a single, cohesive workflow.

The diagram below illustrates some of the tools that are commonly used.

Over to you: which one have you used?


MVC, MVP, MVVM, VIPER Patterns

What distinguishes MVC, MVP, MVVM, MVVM-C, and VIPER architecture patterns from each other?

No alt text provided for this image

These architecture patterns are among the most commonly used in app development, whether on iOS or Android platforms. Developers have introduced them to overcome the limitations of earlier patterns. So, how do they differ?

  • MVC, the oldest pattern, dates back almost 50 years

  • Every pattern has a "view" (V) responsible for displaying content and receiving user input

  • Most patterns include a "model" (M) to manage business data

  • "Controller," "presenter," and "view-model" are translators that mediate between the view and the model ("entity" in the VIPER pattern)

  • These translators can be quite complex to write, so various patterns have been proposed to make them more maintainable


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.

 
Like
Comment
Restack
 

© 2025 ByteByteGo
548 Market Street PMB 72296, San Francisco, CA 94104
Unsubscribe

Get the appStart writing


by "ByteByteGo" <bytebytego@substack.com> - 11:35 - 4 Jan 2025