Alex Xu Profile picture
Jan 17 โ€ข 9 tweets โ€ข 3 min read
1/ ๐–๐ก๐š๐ญ ๐ข๐ฌ ๐ญ๐ก๐ž ๐ฉ๐ซ๐จ๐œ๐ž๐ฌ๐ฌ ๐Ÿ๐จ๐ซ ๐๐ž๐ฉ๐ฅ๐จ๐ฒ๐ข๐ง๐  ๐œ๐ก๐š๐ง๐ ๐ž๐ฌ ๐ญ๐จ ๐ฉ๐ซ๐จ๐๐ฎ๐œ๐ญ๐ข๐จ๐ง?

The diagram below shows several common ๐๐ž๐ฉ๐ฅ๐จ๐ฒ๐ฆ๐ž๐ง๐ญ ๐ฌ๐ญ๐ซ๐š๐ญ๐ž๐ ๐ข๐ž๐ฌ.
2/ ๐๐ข๐  ๐๐š๐ง๐  ๐ƒ๐ž๐ฉ๐ฅ๐จ๐ฒ๐ฆ๐ž๐ง๐ญ

Big Bang Deployment is quite straightforward, where we roll out a new version in one go with service downtime. We roll back to the previous version if the deployment fails.

๐Ÿ’ก No downtime โŒ
๐Ÿ’ก Targeted users โŒ
3/ ๐‘๐จ๐ฅ๐ฅ๐ข๐ง๐  ๐ƒ๐ž๐ฉ๐ฅ๐จ๐ฒ๐ฆ๐ž๐ง๐ญ

Rolling Deployment applies phased deployment compared with big bang deployment. The whole plant is upgraded one by one over a period of time.

๐Ÿ’ก No downtime โœ…
๐Ÿ’ก Targeted users โŒ
4/ ๐๐ฅ๐ฎ๐ž-๐†๐ซ๐ž๐ž๐ง ๐ƒ๐ž๐ฉ๐ฅ๐จ๐ฒ๐ฆ๐ž๐ง๐ญ

In blue-green deployment, two environments are deployed in production simultaneously. Once the green environment passes the tests, the load balancer switches users to it.

๐Ÿ’ก No downtime โœ…
๐Ÿ’ก Targeted users โŒ
5/ ๐‚๐š๐ง๐š๐ซ๐ฒ ๐ƒ๐ž๐ฉ๐ฅ๐จ๐ฒ๐ฆ๐ž๐ง๐ญ

With canary deployment, only a small portion of instances are upgraded with the new version, once all the tests pass, a portion of users are routed to canary instances.

๐Ÿ’ก No downtime โœ…
๐Ÿ’ก Targeted users โŒ
6/ ๐…๐ž๐š๐ญ๐ฎ๐ซ๐ž ๐“๐จ๐ ๐ ๐ฅ๐ž

With the feature toggle, A small portion of users with a specific flag go through the code of the new feature, while other users go through normal code.

๐Ÿ’ก No downtime โœ…
๐Ÿ’ก Targeted users โœ…
7/ ๐Ÿ‘‰ Over to you: Which deployment strategies have you used?
8/ I hope you've found this thread helpful.

Follow me @alexxubyte for more.

Like/Retweet the first tweet below if you can:
Enjoy this thread?

You might like our System Design newsletter as well:

โ€ข โ€ข โ€ข

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

Jan 16
1/ How do we design a ๐œ๐ก๐š๐ญ ๐š๐ฉ๐ฉ๐ฅ๐ข๐œ๐š๐ญ๐ข๐จ๐ง like WhatsApp, Facebook Messenger or Discord?

The diagram below shows a design for a simplified 1 to 1 chat application.
2/ ๐”๐ฌ๐ž๐ซ ๐‹๐จ๐ ๐ข๐ง ๐…๐ฅ๐จ๐ฐ

๐Ÿ”นStep 1: Alice logs in to the chat application and establishes a web socket connection with the server side.

๐Ÿ”นSteps 2-4: The presence service receives Alice's notification, updates her presence, and notifies Alice's friends about her presence.
3/ ๐Œ๐ž๐ฌ๐ฌ๐š๐ ๐ข๐ง๐  ๐…๐ฅ๐จ๐ฐ

๐Ÿ”นSteps 1-2: Alice sends a chat message to Bob. The chat message is routed to Chat Service A.

๐Ÿ”นSteps 3-4: The chat message is sent to the sequencing service which generates a unique ID, and is persisted in the message store.
Read 9 tweets
Jan 12
1/ Is it possible to run C, C++, or Rust on a web browser? Image
2/ What is ๐ฐ๐ž๐› ๐š๐ฌ๐ฌ๐ž๐ฆ๐›๐ฅ๐ฒ (WASM)? Why does it attract so much attention?

The diagram shows how we can run native C/C++/Rust code inside a web browser with WASM. Image
3/ Traditionally, we can only work with Javascript in the web browser, and the performance cannot compare with native code like C/C++ because it is interpreted.
Read 7 tweets
Jan 9
/1 ๐ˆ๐ฌ ๐ฆ๐ข๐œ๐ซ๐จ๐ฌ๐ž๐ซ๐ฏ๐ข๐œ๐ž ๐š๐ซ๐œ๐ก๐ข๐ญ๐ž๐œ๐ญ๐ฎ๐ซ๐ž ๐ญ๐ก๐ž ๐ฌ๐ข๐ฅ๐ฏ๐ž๐ซ ๐›๐ฎ๐ฅ๐ฅ๐ž๐ญ?

The diagram below shows why ๐ซ๐ž๐š๐ฅ-๐ญ๐ข๐ฆ๐ž ๐ ๐š๐ฆ๐ข๐ง๐  and ๐ฅ๐จ๐ฐ-๐ฅ๐š๐ญ๐ž๐ง๐œ๐ฒ ๐ญ๐ซ๐š๐๐ข๐ง๐  applications should not use microservice architecture.
/2 There are some common features of these applications, which make them choose monolithic architecture:
/3 ๐Ÿ”นThese applications are very ๐ฅ๐š๐ญ๐ž๐ง๐œ๐ฒ-๐ฌ๐ž๐ง๐ฌ๐ข๐ญ๐ข๐ฏ๐ž. For real-time gaming, the latency should be at the milli-second level; for low-latency trading, the latency should be at the micro-second level.
Read 11 tweets
Jan 4
/1 How can Redis be used?

There is more to Redis than just caching.

Redis can be used in various scenarios, as shown in the diagram. Image
/2 ๐Ÿ”นSession
We can use Redis to share user session data among different services.

๐Ÿ”นCache
We can use Redis to cache objects or pages, especially for hotspot data.

๐Ÿ”นDistributed lock
We can use a Redis string to acquire locks among distributed services. Image
/3 ๐Ÿ”นCounter
We can count how many likes or how many reads for articles

๐Ÿ”นRate limiter
We can apply a rate limit for specific user IPs

๐Ÿ”นGlobal ID generator
We can use Redis Int for global ID

๐Ÿ”นShopping cart
We can use Redis Hash to represent key-value pairs in a shopping cart Image
Read 7 tweets
Jan 2
/1 How does Git Work?

The diagram below shows the Git workflow.
/2 Git is a distributed version control system.

Every developer maintains a local copy of the main repository and edits and commits to the local copy.

The commit is very fast because the operation doesnโ€™t interact with the remote repository.
/3 If the remote repository crashes, the files can be recovered from the local repositories.

๐Ÿ‘‰ Over to you: Which Git command do you use to resolve conflicting changes?
Read 4 tweets
Dec 29, 2022
/1 Evolution of Uberโ€™s API layer

Uberโ€™s API gateway went through 3 main stages.
/2 First gen: the organic evolution. Uber's architecture in 2014 would have two key services: dispatch and API. A dispatch service connects a rider with a driver, while an API service stores the long-term data of users and trips.
/3 Second gen: the all-encompassing gateway. Uber adopted a microservice architecture very early on. By 2019, Uber's products were powered by 2,200+ microservices as a result of this architectural decision.
Read 7 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!

:(