Alex Xu Profile picture
Jan 24 โ€ข 8 tweets โ€ข 3 min read
/1 ๐†๐ข๐ญ ๐Œ๐ž๐ซ๐ ๐ž ๐ฏ๐ฌ. ๐†๐ข๐ญ ๐‘๐ž๐›๐š๐ฌ๐ž

What are the differences? Image
/2 When we ๐ฆ๐ž๐ซ๐ ๐ž ๐œ๐ก๐š๐ง๐ ๐ž๐ฌ from one Git branch to another, we can use โ€˜git mergeโ€™ or โ€˜git rebaseโ€™. The diagram below shows how the two commands work.
/3 ๐†๐ข๐ญ ๐Œ๐ž๐ซ๐ ๐ž
This creates a new commit Gโ€™ in the main branch. Gโ€™ ties the histories of both main and feature branches.

Git merge is ๐ง๐จ๐ง-๐๐ž๐ฌ๐ญ๐ซ๐ฎ๐œ๐ญ๐ข๐ฏ๐ž. Neither the main nor the feature branch is changed. Image
/4 ๐†๐ข๐ญ ๐‘๐ž๐›๐š๐ฌ๐ž

Git rebase moves the feature branch histories to the head of the main branch. It creates new commits Eโ€™, Fโ€™, and Gโ€™ for each commit in the feature branch.

The benefit of rebase is that it has ๐ฅ๐ข๐ง๐ž๐š๐ซ ๐œ๐จ๐ฆ๐ฆ๐ข๐ญ ๐ก๐ข๐ฌ๐ญ๐จ๐ซ๐ฒ. Image
/5 Rebase can be dangerous if โ€œthe golden rule of git rebaseโ€ is not followed.

๐“๐ก๐ž ๐†๐จ๐ฅ๐๐ž๐ง ๐‘๐ฎ๐ฅ๐ž ๐จ๐Ÿ ๐†๐ข๐ญ ๐‘๐ž๐›๐š๐ฌ๐ž
Never use it on public branches!
/6 ๐Ÿ‘‰ Over to you: When do you usually use git rebase?
/7 I will provide a more in-depth analysis of this topic. Subscribe to our newsletter to get the latest update: bit.ly/3whEH2D Image
/8 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

Jan 23
/1 8 Data Structures That Power Your Databases. Which one should we pick?
/2 The answer will vary depending on your use case. Data can be indexed in memory or on disk. Similarly, data formats vary, such as numbers, strings, geographic coordinates, etc. The system might be write-heavy or read-heavy.
/3 All of these factors affect your choice of database index format.

The following are some of the most popular data structures used for indexing data:

๐Ÿ”นSkiplist: a common in-memory index type. Used in Redis
Read 9 tweets
Jan 19
/1 How do Visa ๐๐ข๐ฌ๐ฉ๐ฎ๐ญ๐ž and ๐œ๐ก๐š๐ซ๐ ๐ž๐›๐š๐œ๐ค work?

A dispute happens when a cardholder disagrees with a merchantโ€™s charge. A chargeback is a process of reversing the charge. Sometimes, the two terms are used interchangeably. Image
/2 A dispute is ๐ž๐ฑ๐ฉ๐ž๐ง๐ฌ๐ข๐ฏ๐ž: for every dollar in disputed transactions, an additional $1.50 is spent on fees and expenses.

The diagram below shows why. ๐Ÿ‘‡ Image
/3 ๐Ÿ”น Steps 1-3: The cardholder Bob raises a dispute with the card issuer. Details are reviewed by the issuing bank. In cases of legitimate disputes, the issuing bank submits a chargeback request to the card network. Image
Read 9 tweets
Jan 17
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 โŒ
Read 9 tweets
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

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!

:(