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
/4 🔹When you type "git add", your files will be added to the staging area. These files are now immutable. It is no longer possible to edit them
/5 🔹When you type "git commit", your staging files are added to the local repository. Local repository is a tree version of the append-only write-ahead log (WAL). They are both immutable: you can only append to the end of the data structure.
/6 🔹When you type "git push", your local repository data will be synced to the remote repository. As the remote repository uses the same data structure as your local repository, it is also immutable: you can only add data to it
/7 👉 Over to you: there are two ways to save the history of a file: either save every version of the file, or save every delta change to the file and reconstruct the file by aggregating all delta changes. Would you recommend Git using one over another, and why?
/8 Subscribe to our weekly free newsletter to learn something new every week: bit.ly/3FEGliw
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.
/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?
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.
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
/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.
/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