DB

Notes around database

Introduction Random notes and summary of database. Connection pooling Connection pooling is a technique to keep the reusable open database connections so that applications do not need to open and close a new connection for every request. Why connections are expensive: Creating a connection requires TCP handshake The DB must authenticate and allocate memory/resources PostgreSQL forks a process per connection MySQL creates a thread per connection (context switching for thread is 5x faster than process) Connection Pool Size Formula (HikariCP recommendation):

Designing Data-Intensive Applications

What’s this article about These are my notes on a book called Designing Data-Intensive Applications. SSTables and LSM Trees(P.76) SSTables (Sorted String Tables) are files that contain a set of arbitrary and sorted key-value pairs. https://www.igvita.com/2012/02/06/sstable-and-log-structured-storage-leveldb/ SSTables and Log-Structured Merge Trees are still used in some database. As a rule of thumb, LSM Trees are faster for writes but slower for reads than B-Tree indexes. B-Trees The B-Tree is the most widely used indexing structure.

DB Random Notes(DB関連)

RAID 複数の Disk をまとめて一つの storage とする技術。 基本的にはデータを冗長化すること可用性を高めるためのものである。パフォーマンス向上のために用いられる