Alex Xu Profile picture
Oct 3 6 tweets 2 min read
/1 One picture is worth a thousand words. Interesting database selection trees.

iQIYI is one of the largest online video sites in the world, with over 500 million monthly active users. Let's look at how they choose relational and NoSQL databases.
/2 The following databases are used at iQIYI:
- MySQL
- Redis
- TiDB: a hybrid transactional/analytical processing (HTAP) distributed database
- Couchbase: distributed multi-model NoSQL document-oriented database
- TokuDB: open-source storage engine for MySQL and MariaDB.
/3 - Big data analytical systems, like Hive and Impala
- Other databases, like MongoDB, HiGraph, and TiKV

The database selection trees below explain how they choose a database.
/4 Over to you: choosing the database is hard. The view might be controversial. How do you usually pick the right DB?
/5 Disclaimer: This post is based on an article from PingCAP (a ByteByteGo newsletter sponsor). If you are interested in learning more, please check out their in-person HTAP database summit (free) in Mountain View, California: bit.ly/3EcKoDV
/6 I hope you've found this thread helpful.

Follow me @alexxubyte for more.

Like/Retweet the first tweet below if you can:

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with Alex Xu

Alex Xu Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @alexxubyte

Oct 5
/1 How will you design the Stack Overflow website? If your answer is on-premise servers and monolith (bottom), you would likely fail the interview, but that's how it is built in reality! Image
/2 𝐖𝐡𝐚𝐭 𝐩𝐞𝐨𝐩𝐥𝐞 𝐭𝐡𝐢𝐧𝐤 𝐢𝐭 𝐬𝐡𝐨𝐮𝐥𝐝 𝐥𝐨𝐨𝐤 𝐥𝐢𝐤𝐞

The interviewer is probably expecting something at the top.

1. Microservice is used to decompose the system into small components.
2. Each service has its own database. Use cache heavily. Image
/3 3. The service is sharded.
4. The services talk to each other asynchronously through message queues.
5. The service is implemented using Event Sourcing with CQRS.
6. Showing off knowledge in distributed systems such as eventual consistency, CAP theorem, etc.
Read 7 tweets
Sep 30
/1 Payment through scanning QR code is very common but do you know how many ways there are to do it?

There are 4 ways, no matter whether you’re using PayPal, Stripe, Paytm, WeChat, or Alipay. Is this surprising to you? To understand this, we will answer to questions.
/2 The first question is who presents the QR code:

1. You can present the QR code and the merchant scans the code for payment. This is called ‘consumer-presented mode, and what the merchant does is direct debit your account.
/3 2. Obviously, the other way is that the merchant presents the QR code for you to scan to pay the due amount. This is called ‘merchant-presented mode’ and you grant the direct credit from your account.
Read 9 tweets
Sep 29
/1 Why is Nginx called a “𝐫𝐞𝐯𝐞𝐫𝐬𝐞” proxy?

The diagram below shows the differences between a 𝐟𝐨𝐫𝐰𝐚𝐫𝐝 𝐩𝐫𝐨𝐱𝐲 and a 𝐫𝐞𝐯𝐞𝐫𝐬𝐞 𝐩𝐫𝐨𝐱𝐲. Image
/2 🔹 A forward proxy is a server that sits between user devices and the internet.

A forward proxy is good for:

1️⃣ Protect clients
2️⃣ Avoid browsing restrictions
3️⃣ Block access to certain content
/3 🔹 A reverse proxy is a server that accepts a request from the client, forwards the request to web servers, and returns the results to the client as if the proxy server had processed the request.
Read 6 tweets
Sep 28
/1 The CAP theorem is one of the most famous terms in computer science, but I bet different developers have different understandings. Let’s examine what it is and why it can be confusing. Image
/2 CAP theorem states that a distributed system can't provide more than two of these three guarantees simultaneously.

𝐂𝐨𝐧𝐬𝐢𝐬𝐭𝐞𝐧𝐜𝐲: consistency means all clients see the same data at the same time no matter which node they connect to.
/3 𝐀𝐯𝐚𝐢𝐥𝐚𝐛𝐢𝐥𝐢𝐭𝐲: availability means any client which requests data gets a response even if some of the nodes are down.
Read 10 tweets
Sep 27
/1 How live streaming works (YouTube live, TikTok live, Twitch streaming)

You can watch and subscribe here:
bit.ly/3CfvBa8

If you prefer text, keep reading:
/2 Live streaming is challenging because the video content is sent over the internet in near real-time. Video processing is compute-intensive. Sending a large volume of video content over the internet takes time. These factors make live streaming challenging.
/3 The diagram below explains what happens behind the scenes to make this possible.

Step 1: The streamer starts their stream. The source could be any video and audio source wired up to an encoder
Read 8 tweets
Sep 26
/1 What is 𝐂𝐃𝐍 (Content Delivery Network)? How does CDN make content delivery 𝐟𝐚𝐬𝐭𝐞𝐫?

The diagram below shows why

A CDN refers to geographically distributed servers (edge servers) that provide fast delivery of 𝐬𝐭𝐚𝐭𝐢𝐜 𝐚𝐧𝐝 𝐝𝐲𝐧𝐚𝐦𝐢𝐜 𝐜𝐨𝐧𝐭𝐞𝐧𝐭 Image
/2 With CDN, users don’t need to retrieve content (music, video, files, pictures, etc.) from the origin server. Instead, the content is cached at CDN nodes around the globe, and users can retrieve the content from nearby CDN nodes.
/3 The benefits of CDN are:

1. Improving latency
2. Reducing bandwidth
3. Improving website security, especially protecting against DDoS (Distributed Denial-of-Service) attack
4. Increasing content availability
Read 5 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Don't want to be a Premium member but still want to support us?

Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal

Or Donate anonymously using crypto!

Ethereum

0xfe58350B80634f60Fa6Dc149a72b4DFbc17D341E copy

Bitcoin

3ATGMxNzCUFzxpMCHL5sWSt4DVtS8UqXpi copy

Thank you for your support!

Follow Us on Twitter!

:(