<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Databases on Blogs</title><link>https://hbisheng.github.io/blogs/database/</link><description>Recent content in Databases on Blogs</description><generator>Hugo</generator><language>en-us</language><copyright>Bisheng Huang</copyright><lastBuildDate>Mon, 22 May 2023 00:00:00 +0000</lastBuildDate><atom:link href="https://hbisheng.github.io/blogs/database/index.xml" rel="self" type="application/rss+xml"/><item><title>Database Consistency Model</title><link>https://hbisheng.github.io/blogs/database/consistency-model/</link><pubDate>Mon, 20 Mar 2023 00:00:00 +0000</pubDate><guid>https://hbisheng.github.io/blogs/database/consistency-model/</guid><description>&lt;p&gt;&lt;strong&gt;TL;DR&lt;/strong&gt; Consistency is a problem when your system stores multiple copies of the same data. Consistency levels allow us to reason about the guarantees provided by a database system and what outcomes are allowed/forbidden.&lt;/p&gt;</description></item><item><title>Transaction Isolation Levels</title><link>https://hbisheng.github.io/blogs/database/transaction-isolation-levels/</link><pubDate>Sun, 26 Mar 2023 00:00:00 +0000</pubDate><guid>https://hbisheng.github.io/blogs/database/transaction-isolation-levels/</guid><description>&lt;p&gt;&lt;strong&gt;TL;DR&lt;/strong&gt; Transaction isolation levels define the permitted behaviors of a system when concurrent transactions are executed.&lt;/p&gt;&#10;&lt;h2 id="background"&gt;Background&lt;/h2&gt;&#10;&lt;p&gt;What&amp;rsquo;s a transaction? A &lt;strong&gt;transaction&lt;/strong&gt; is a group of operations (possibly operating on multiple data items) that either succeeds as a whole (commit) or fails as a whole (abort). There&amp;rsquo;s no state of partial success or partial failure. Transactions allow application developers to focus on the correctness of operations within a transaction and worry less about the existence of concurrent operations. The &lt;strong&gt;serializability&lt;/strong&gt; isolation level maintains the illusion that there&amp;rsquo;s no concurrent transaction execution at all.&lt;/p&gt;</description></item><item><title>Datastore design: B+ tree and LSM tree</title><link>https://hbisheng.github.io/blogs/database/datastore-design/</link><pubDate>Mon, 03 Apr 2023 00:00:00 +0000</pubDate><guid>https://hbisheng.github.io/blogs/database/datastore-design/</guid><description>&lt;p&gt;&lt;strong&gt;TL;DR&lt;/strong&gt; B+ tree was the dominating data structure for database indexing. The LSM tree has become increasingly popular in the distributed database world. Let&amp;rsquo;s consider building an &lt;strong&gt;OLTP (online transactional processing)&lt;/strong&gt; data store from scratch.&lt;/p&gt;</description></item><item><title>MySQL and InnoDB</title><link>https://hbisheng.github.io/blogs/database/mysql-and-innodb/</link><pubDate>Mon, 22 May 2023 00:00:00 +0000</pubDate><guid>https://hbisheng.github.io/blogs/database/mysql-and-innodb/</guid><description>&lt;h2 id="intro"&gt;Intro&lt;/h2&gt;&#10;&lt;p&gt;&lt;strong&gt;Relational database:&lt;/strong&gt; MySQL is a relational database. In a relational database, all data is organized in the shape of a &lt;strong&gt;table&lt;/strong&gt;,with &lt;strong&gt;rows&lt;/strong&gt; and &lt;strong&gt;columns&lt;/strong&gt;. The first row can be thought of as the header. Similar to a table in its common sense, the header describes what information will be present for each row in the table; the header forms the &lt;strong&gt;schema&lt;/strong&gt; of the table. Each row is a data point; each column is a property of that data point.&lt;/p&gt;</description></item><item><title>What I know about Redis</title><link>https://hbisheng.github.io/blogs/database/redis/</link><pubDate>Sat, 08 Apr 2023 00:00:00 +0000</pubDate><guid>https://hbisheng.github.io/blogs/database/redis/</guid><description>&lt;p&gt;&lt;strong&gt;TL;DR&lt;/strong&gt; Redis is an in-memory data store that supports many kinds of data structures.&lt;/p&gt;&#10;&lt;p&gt;Redis is a datastore written in C. It is a TCP server that waits for client requests.&lt;/p&gt;&#10;&lt;p&gt;Redis offers multiple data structures for storing the data, including string, list, hash map, and sorted set. The APIs are rich and powerful which enables all kinds of use cases. Redis is a good fit when your data fits into memory and &lt;strong&gt;durability is not required&lt;/strong&gt;. Redis provides speedy access to the data structures, and manages them with bounded memory, allowing you to configure an eviction policy, e.g. LRU, LFU. &lt;strong&gt;Caching&lt;/strong&gt; is a good use case and probably the most common one.&lt;/p&gt;</description></item><item><title>Raft</title><link>https://hbisheng.github.io/blogs/database/raft/</link><pubDate>Sat, 11 Mar 2023 00:00:00 +0000</pubDate><guid>https://hbisheng.github.io/blogs/database/raft/</guid><description>&lt;p&gt;&lt;strong&gt;TL;DR&lt;/strong&gt; Raft is a protocol for distributed consensus. It&amp;rsquo;s a strong leader protocol where the leader forces the followers to have the same log entries. Only an up-to-date candidate can be elected which guarantees that a committed entry is contained in all future leaders.&lt;/p&gt;</description></item><item><title>Paxos</title><link>https://hbisheng.github.io/blogs/database/paxos/</link><pubDate>Sat, 11 Mar 2023 00:00:00 +0000</pubDate><guid>https://hbisheng.github.io/blogs/database/paxos/</guid><description>&lt;p&gt;&lt;strong&gt;TL;DR&lt;/strong&gt; Paxos is a protocol for distributed consensus. In its simplest form, a group of participants collectively decide and agree on a single value of the system.&lt;/p&gt;&#10;&lt;p&gt;The problem in general was discussed in the &lt;a href="https://hbisheng.github.io/blogs/database/raft/"&gt;Raft post&lt;/a&gt;. We&amp;rsquo;ll be talking about single-decree Paxos where a group of participants want to decide on a single value. A value can be considered as a log entry—an event that leads to state changes. Single-decree Paxos can be repeated to decide on multiple values, forming a log.&lt;/p&gt;</description></item><item><title>Etcd</title><link>https://hbisheng.github.io/blogs/database/etcd/</link><pubDate>Sun, 12 Mar 2023 00:00:00 +0000</pubDate><guid>https://hbisheng.github.io/blogs/database/etcd/</guid><description>&lt;p&gt;&lt;strong&gt;TL;DR&lt;/strong&gt; Etcd is a distributed MVCC key-value store that implements the Raft protocol. It&amp;rsquo;s wildly used in distributed coordination, such as storing system configurations (e.g. Kubernetes).&lt;/p&gt;&#10;&lt;h2 id="background"&gt;Background&lt;/h2&gt;&#10;&lt;p&gt;&lt;a href="https://etcd.io/docs/v3.5/tutorials/"&gt;https://etcd.io/docs/v3.5/tutorials/&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;With Raft, etcd maintains a replication log where each entry is a mutative operation. The operations are committed to Boltdb, a persistent storage engine using B+ tree. The revision concept in etcd:&lt;/p&gt;</description></item><item><title>Cassandra notes</title><link>https://hbisheng.github.io/blogs/database/cassandra-notes/</link><pubDate>Mon, 22 May 2023 00:00:00 +0000</pubDate><guid>https://hbisheng.github.io/blogs/database/cassandra-notes/</guid><description>&lt;p&gt;Cassandra is a leaderless distributed key-value database.&lt;/p&gt;&#10;&lt;p&gt;Cassandra does not support &lt;strong&gt;secondary indexes&lt;/strong&gt;. It does support &lt;strong&gt;range queries&lt;/strong&gt; for data on a particular node (things are always easy when the data is colocated; it&amp;rsquo;s hard when the data is distributed).&lt;/p&gt;</description></item><item><title>TLA+</title><link>https://hbisheng.github.io/blogs/database/tla-plus/</link><pubDate>Fri, 10 Mar 2023 00:00:00 +0000</pubDate><guid>https://hbisheng.github.io/blogs/database/tla-plus/</guid><description>&lt;p&gt;&lt;strong&gt;TL;DR&lt;/strong&gt; TLA+ is a language used for &lt;strong&gt;specifying&lt;/strong&gt; concurrent and distributed systems**.** It&amp;rsquo;s useful for finding flaws in your high-level system design, before writing a single line of code. It&amp;rsquo;s a tool of math or logic.&lt;/p&gt;</description></item></channel></rss>