I implemented a CPU and RAM. In Javascript. For a blog.
Ben Dicken retweeted
can attest to this. you learn a ton, help others and get good incident / war room stories to share over 🍻
Career hack: Make yourself the database expert. Your colleagues will thank you.
1
13
Career hack: Make yourself the database expert. Your colleagues will thank you.
63
71
14
1,548
What happens when you INSERT a row in Postgres? Postgres needs to ensure that data is durable while maintaining good write performance + crash recovery ability. The key is in the Write-Ahead Log (WAL). (1) Postgres receives the query and determines what data page to place it in. This could already be in memory (buffer pool), or it may have to load one from disk, or even create a new one. (2) The new record is written to this page in memory only. The page is marked as “dirty” meaning it needs to get flushed to disk in the future, but not immediately. (3) A new record is inserted into the memory buffer for the WAL. It contains all the information needed to reconstruct the insert. (4) The WAL is flushed to disk (via fsync or similar) to ensure the data resides in durable storage. After this succeeds, Postgres return success to the client. When you get a success at the client, the data has definitely been written to the sequential WAL (good write performance) but not necessarily to the table data file (less predictable I/O patterns). The latter happens later on via checkpointing, background jobs, or forced flushes due to memory page eviction. If a server crash happens before the data is flushed, the log is replayed to restore committed data. The WAL is the key to all of this! It facilitates high-performance I/O and crash recovery.
9
64
4
634
PlanetScale now supports PgBouncers (connection poolers) for your replicas. Connection pooling is broadly important for databases, but especially for Postgres because of its process-per-connection architecture. Don't know what that means? I have the perfect article!
You can now provision dedicated PgBouncers for your Postgres replicas. This gives you a connection pool that evenly distributes connections across your available replicas, making it simple to scale out read-only traffic.
6
11
221
0
Much of the the internet runs on Elastic Block Storage. It's the default (and in most cases, required) storage layer for every EC2 instance running in AWS. This article by @molson was a delightful read on its history and engineering challenges.
3
19
289
Maybe link suppression *is* fixed?
Want to understand B-trees better? Try btree.app and bplustree.app. These are standalone sandboxes of the visuals I built for my "B-trees and database indexes" article. Helpful for learning B-tree insertion, search, and node splits.
6
1
66
Want to understand B-trees better? Try btree.app and bplustree.app. These are standalone sandboxes of the visuals I built for my "B-trees and database indexes" article. Helpful for learning B-tree insertion, search, and node splits.
Ben Dicken retweeted
I'm hiring an Engineering Manager at @intercom to lead our Infra-Platform team. This is a high-autonomy team of senior experts (5yr median tenure!) who own the base layer we build on. Preferably someone who has been Senior+ in infra and then transitioned to being a manager. DMs open. Link in the replies to the job spec etc...
1
6
2
11
Glad we settled on a dynamically-typed language.
The hottest new programming language is English
6
2
63
Ben Dicken retweeted
Have you ever wondered what the best cost/performance ratio is for AWS instances? What if you wanted to find GCP's equivalent of an c8i.32xlarge? (c4-highcpu-144 btw) Now, you can. Check out the instance explorer!
Never mind, query planner papers got hands.
Why I like database papers.
6
7
2
149
Explain is a powerful tool in Postgres. If you care about performance, get comfortable running `explain` and `explain analyze` commands regularly, and learn how to interpret its output. This blog is a great intro.
Why I like database papers.
42
305
33
5,588
The fastest Postgres just got way more accessible. 3 nodes. High-availability. Low-latency I/O. $50. We're making PlanetScale THE place to run your database, no matter the scale.
Coming soon: $50 PlanetScale Metal and the ability to dynamically allocate CPU and memory independent of storage size. planetscale.com/blog/50-doll…
8
2
1
223
I'm baffled that Postgres logical replication doesn't fully support sequences. Keeping nextval() in sync shouldn't be that hard. What am I missing?
8
1
1
87
Why would you translate away from the best language?
3
1
34