Alex Xu Profile picture
Feb 7 โ€ข 5 tweets โ€ข 2 min read
/1 Why is Redis so ๐Ÿ๐š๐ฌ๐ญ?

The diagram below shows 3 main reasons:

1๏ธโƒฃ Redis is RAM-based. Access to RAM is at least 1000 times faster than access to random disks. Redis can be used as a cache to improve application responsiveness and reduce database load when used as a cache. Image
/2 2๏ธโƒฃ Redis implements IO multiplexing and single-threaded execution.

3๏ธโƒฃ Several efficient lower-level data structures are leveraged by Redis. By keeping these data structures in memory, serialization and deserialization costs are reduced.
/3 SortedSet, for example, makes the implementation of leaderboards so simple and efficient. On the other hand, a bitmap can be used to aggregate month-over-month login statuses.

๐Ÿ‘‰ Over to you: What do you use Redis for in your projects?
/4 Subscribe to our weekly free newsletter to learn something new every week: bit.ly/3FEGliw Image
/5 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

Feb 8
/1 Caching is one of the ๐ฆ๐จ๐ฌ๐ญ ๐œ๐จ๐ฆ๐ฆ๐จ๐ง๐ฅ๐ฒ used techniques when building ๐Ÿ๐š๐ฌ๐ญ ๐จ๐ง๐ฅ๐ข๐ง๐ž ๐ฌ๐ฒ๐ฌ๐ญ๐ž๐ฆ๐ฌ. When using a cache, here are the top 6 things to consider: Image
/2 The first draft of the cheatsheet was written by guest author @Zonito87.
/3 ๐’๐ฎ๐ข๐ญ๐š๐›๐ฅ๐ž ๐’๐œ๐ž๐ง๐š๐ซ๐ข๐จ๐ฌ:
โ€ข In-memory solution
โ€ข Read heavy system
โ€ข Data is not frequently updated

๐‚๐š๐œ๐ก๐ข๐ง๐  ๐“๐ž๐œ๐ก๐ง๐ข๐ช๐ฎ๐ž๐ฌ:
โ€ข Cache aside
โ€ข Write-through
โ€ข Read-through
โ€ข Write-around
โ€ข Write-back Image
Read 10 tweets
Feb 6
/1 Git Workflow & Immutability

Immutability here means that once data is written into Git, it cannot be changed. Modifications only create new data versions. The old data remains unchanged.
/2 Immutable system designs are commonly used in systems that require high levels of auditability, such as financial systems and version control systems. Here's how it's used in Git design:
/3 ๐Ÿ”นUsers' local Git storage consists of three sections: working copy, staging area, and local repository.
๐Ÿ”นWorking copies contain the files you are currently working on. The data is mutable, so you can do whatever you want with it
Read 9 tweets
Jan 31
/1 How does ChatGPT work?

Disclaimer: since OpenAI hasn't provided all the details, some parts of the diagram may be inaccurate. @sama, we would love to hear your feedback.

We attempted to explain how it works in the diagram below. The process can be broken down into two parts.
/2 1. Training. To train a ChatGPT model, there are two stages:

- Pre-training: In this stage, we train a GPT model (decoder-only transformer) on a large chunk of internet data.
/3 The objective is to train a model that can predict future words given a sentence in a way that is grammatically correct and semantically meaningful.

After the pre-training stage, the model can complete given sentences, but it is not capable of responding to questions.
Read 12 tweets
Jan 30
/1 ๐ƒ๐จ๐ž๐ฌ ๐ญ๐ก๐ž ๐œ๐ฅ๐จ๐ฎ๐ ๐ซ๐ž๐š๐ฅ๐ฅ๐ฒ ๐ฌ๐š๐ฏ๐ž ๐œ๐จ๐ฌ๐ญ๐ฌ?

Letโ€™s look at this question ๐ข๐ง ๐š ๐ฅ๐จ๐ง๐ ๐ž๐ซ ๐ญ๐ข๐ฆ๐ž ๐ซ๐š๐ง๐ ๐ž to see what the cloud brings us.
/2 ๐Ÿ”น When a company or a business line initially starts, product-market fit is key. The cloud enables quick setup to run the system with minimal necessary hardware. The cost is also transparent.
/3 For example, if we run the databases on-premise, we need to take care of hardware setup, operating system installation, DBMS maintenance, etc. But if we use Amazon RDS, we need to take care of optimization.

This saves us the trouble to hire Linux admins and DB admins
Read 10 tweets
Jan 26
/1 What is Buy Now, Pay Later (BNPL), and how does it work? What is the revenue model for BNPL providers?
/2 The growth of BNPL has been dramatic in recent years. The BNPL provider represents the primary interface between the merchants and the customers for both eCommerce and POS (Point of Sale).
/3 The diagram below shows how the process works:

Step 0. Bob registers with AfterPay. An approved credit/debit card is linked to this account.

Step 1. The "Buy Now, Pay Later" payment option is chosen by Bob when he wants to purchase a $100 product.
Read 10 tweets
Jan 24
/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
Read 8 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!

:(