EP29: Online Gaming Protocol

This week’s system design refresher:

Subscribe to get this newsletter every week


Ace System Design Interviews (Taught by ByteByteGo)

Scale from zero to millions of users, design a news feed system, design YouTube, and many more. The text-based course is designed to make you a better software engineer and ace the system design interview.

Note: This course contains the same content as my best-selling system design interview books (volume 1 and volume 2). If you already own those two books, there is no need to buy the course.

Check it out now!


What protocol does online gaming use to transmit data? TCP or UDP?

A common practice is to use RUDP (Reliable UDP). It adds a reliable mechanism on top of UDP to provide much lower latency than TCP and guarantee accuracy.

The diagram below shows how reliable data delivery is implemented in online gaming to get eventually-synchronized states.

a close up of text and logo over a white background

Suppose there is a big fight in a simulation shooter game. Characters A, B, and C open fires in sequence. How does the game server transmit the states from the game server to the game client?


Apple Pay vs. Google Pay: Which is more secure?


Is Telegram secure?

Let’s first define what “secure” means. A “secure” chat in a messaging App generally means the message is encrypted at the sender side and is only decryptable at the receiver side. It is also called “E2EE” (end-to-end encryption).

In this sense, is Telegram secure? It depends.

diagram

Telegram’s usual private and group chats aren’t end-to-end encrypted
It generally means third parties can intercept and read your messages. Telegram uses the following approach for security:

This means the hacker needs to get message chunks and keys from all places. It is possible but extremely difficult.

Secret chats are end-to-end encrypted
 If you choose the “secret chat” option, it is end-to-end encrypted. It has several limitations:


B-Tree vs. LSM-Tree

a close up of a chart

If you use markdown and mindmap, you'll probably like this tool.


If you’re finding this newsletter valuable, consider subscribing to get it every week.