Discover more from ByteByteGo Newsletter
EP61: The journey of a Slack message
This week’s system design refresher:
Amazon Prime Video Ditches AWS Serverless (Youtube video)
The journey of a Slack Message
How GraphQL works in the real world
Different cloud services
Check your favorite jobs board today - top tech companies are ALWAYs making critical hires.
Layoffs or not, interview preparedness will help you thrive. Get ahead of the curve with Interview Kickstart:
They've trained 15000+ SDEs, EMs, TPMs, and Analysts to ace tech interviews
IK Alumni consistently land jobs at Amazon, Google, and top-tier companies (avg. salary hike: 66.5%)
What sets them apart? Courses are taught by real Hiring managers from top-tier companies like Google, Microsoft & Amazon
Join their next interview prep webinar (FREE) and get a complimentary course on Sorting Algorithms (15 hrs) by Omkar Deshpande - Head of Curriculum @IK (Stanford Ph.D.)
Amazon Prime Video ditches AWS Serverless, saves 90%
Why did Amazon Prime Video monitoring move from serverless to monolithic? How can it save 90% cost?
In this video, we will talk about:
What is Amazon Prime Video Monitoring Service
What is the problem with the old serverless architecture
How the monolithic architecture saves 90% cost
What did Amazon leaders say about this
What is the journey of a Slack message?
In a recent technical article, Slack explains how its real-time messaging framework works. Here is my short summary:
Because there are too many channels, the Channel Server (CS) uses consistent hashing to allocate millions of channels to many channel servers.
Slack messages are delivered through WebApp and Admin Server to the correct Channel Server.
Through Gate Server and Envoy (a proxy), the Channel Server will push messages to message receivers.
Message receivers use WebSocket, which is a bi-directional messaging mechanism, so they are able to receive updates in real-time.
A Slack message travels through five important servers:
WebApp: define the API that a Slack client could use
Admin Server (AS): find the correct Channel Server using channel ID
Channel Server (CS): maintain the history of message channel
Gateway Server (GS): deployed in each geographic region. Maintain WebSocket channel subscription
Envoy: service proxy for cloud-native applications
Over to you: The Channel Servers could go down. Since they use consistent hashing, how might they recover?
How does GraphQL work in the real world?
The diagram below shows how LinkedIn adopts GraphQL.
The overall workflow after adopting GraphQL has 3 parts:
Part 1 - Edit and Test a Query
Steps 1-2: The client-side developer develops a query and tests with backend services.
Part 2 - Register a Query
Steps 3-4: The client-side developer commits the query and publishes the query to the query registry.
Part 3 - Use in Production
Step 5: The query is released together with the client code.
Steps 6-7: The routing metadata is included with each registered query. The metadata is used at the traffic routing tier to route the incoming requests to the correct service cluster.
Step 8: The registered queries are cached at service runtime.
Step 9: The sample query goes to the identity service first to retrieve members and then goes to the organization service to retrieve company information.
LinkedIn doesn’t deploy a GraphQL gateway for two reasons:
1. Prevent an additional network hop
2. Avoid single point of failure
Over to you: How are GraphQL queries managed in your project?
A nice cheat sheet of different cloud services
Join the ByteByteGo Talent Collective
If you’re looking for a new gig, join the collective for customized job offerings from selected companies. Public or anonymous options are available. Leave anytime.
If you’re hiring, join the ByteByteGo Talent Collective to start getting bi-monthly drops of world-class hand-curated engineers who are open to new opportunities.