HN user

bddicken

473 karma

databases @ https://planetscale.com

Also benjdd.com

Posts32
Comments115
View on HN
planetscale.com 2mo ago

How to not screw up a benchmark

bddicken
3pts0
www.figma.com 2mo ago

Managing Postgres traffic spikes at Figma

bddicken
4pts0
vondra.me 4mo ago

20 Years of Postgres Performance

bddicken
2pts0
planetscale.com 4mo ago

Scaling Postgres Connections with Pgbouncer

bddicken
1pts0
www.simeongriggs.dev 4mo ago

Add AI to Any App

bddicken
1pts0
benhylak.substack.com 4mo ago

Startups Are Sequencing Problems

bddicken
2pts1
planetscale.com 9mo ago

Benchmarking Postgres 17 vs. 18

bddicken
184pts64
medium.com 12mo ago

Performance of Threads vs. Processes

bddicken
1pts0
benjdd.com 1y ago

Benchmarking EC2 Instance Storage

bddicken
1pts0
benjdd.com 1y ago

A Graveyard of Hard Drives

bddicken
2pts1
planetscale.com 1y ago

An Interactive Guide to Database Sharding

bddicken
1pts0
benjdd.com 1y ago

Hard Drive Graveyard

bddicken
7pts0
benjdd.com 1y ago

12 years of Backblaze data center storage drives, visualized

bddicken
147pts47
benjdd.com 1y ago

Microsoft Azure data center latencies, visualized

bddicken
4pts0
repofiles.com 1y ago

Show HN: I made a tool to navigate your GitHub repo files

bddicken
2pts1
planetscale.com 1y ago

Database Sharding

bddicken
2pts0
benjdd.com 1y ago

1B Nested Loop Iterations

bddicken
7pts4
benjdd.com 1y ago

JavaScript, Python, Go, and C

bddicken
1pts0
benjdd.com 1y ago

Visualizing how storage cost changes over time

bddicken
1pts0
benjdd.com 1y ago

AWS us-east-2 latencies, visualized

bddicken
1pts0
benjdd.com 1y ago

Show HN: A tool to visualize AWS region latencies

bddicken
1pts0
hnrank.app 1y ago

Check your HN submission rankings with HNRank

bddicken
1pts0
bplustree.app 1y ago

Bplustree.app

bddicken
36pts4
benjdd.com 2y ago

Benchmarking MySQL on a Raspberry Pi

bddicken
3pts0
benjdd.com 2y ago

Display Your Images in MySQL

bddicken
1pts0
benjdd.com 2y ago

Display Images in MySQL

bddicken
2pts0
planetscale.com 2y ago

Profiling Memory Usage in MySQL

bddicken
4pts0
benjdd.com 2y ago

Memory Access Patterns and Performance

bddicken
3pts0
benjdd.com 2y ago

Turn Images into Contour Maps

bddicken
8pts0
benjdd.com 2y ago

Stylized image binning algorithm, for the web

bddicken
57pts14

Author here, thank you.

Technically, they are using js + gsap + svg embedded i the article with iframes.

Process-wise, I drafted most of them as static images in excalidraw, passed the images along to cursor for a first draft, applied styling rules, and then did a bunch of fine-tuning.

A lot of what you're referring to is dictated by the sharding strategy. Vitess and Neki both let you configure this via the VSchema / data topology (That's what I'm getting at here)

https://planetscale.com/blog/making-768-servers-look-like-1#...

This decision matters a ton. I drilled into this specific point on sharding in one of my articles from awhile back:

https://planetscale.com/blog/database-sharding

This is something you face any time you shard data, no matter the system. Single-shard queries are preferred to cross-shard ones. We want 99% of what we do to be single shard, but occasionally cross-shard work is unavoidable.

So an extreme example is OpenAI needing 50 replicas, but we're doing five blades ... err, we're doing 768 servers because the need arose "pretty quickly"?

If you read the OpenAI article, you'll see that they actually used sharding to offload a bunch of work from their "1 primary 50 replicas setup"

>> "To mitigate these limitations and reduce write pressure, we’ve migrated, and continue to migrate, shardable (i.e. workloads that can be horizontally partitioned), write-heavy workloads to sharded systems such as Azure Cosmos DB..."

The 768 servers and 1PB example is just one of many configurations. A business with 10TB may choose to go from a monolithic database to a 8-shard setup to improve backup times, eliminate single-point-of-failure, have more breathing room for scaling.

Hey, author here.

Technically, they're powered by js + gsap + svg.

Process wise (for most of them) I sketched them out in advance in excalidraw for figure out layout, then passed these along to cursor to have it build out an initial draft from the image, then used some styling rules to get all the styles inline, then did a bunch of fine-tuning.

Caching at all levels is key to good db performance (cpu cache <-> ram <-> disk). CPU cache optimization is not my area of expertise, but I did write another fun article on io devices and how it related to databsae perf:

https://planetscale.com/blog/io-devices-and-latency

Network saturation, and just resource saturation broadly, is a huge reason to shard. If/When the network, cpu, or disk for a subset of shards becomes a bottleneck, add more shards.

B+trees combined with sequential IDs are great for writes. This is because we are essentially just appending new rows to the "linked list" at the bottom level of the tree. We can also keep a high fill % if we know there isn't a lot of data churn.

If you're sharding based purely on sequential ID ranges, then yes this is a problem. Its better practice to shard based on a hash of your ID, so sequential id assignments turn into non-sequential shard keys, keeping things evenly distributed.

It's really just a matter of tradeoffs. B-trees are great, but are better suited for high read % and medium/low write volume. In the opposite case, things like LSMs are typically better suited.

If you want a comprehensive resource, I'd recommend reading either Designing Data Intensive Applications (Kleppman) or Database Internals (Petrov). Both have chapters on B-trees and LSMs.

I've read this paper and it's a neat idea. It hasn't been introduced into popular oss databases like postgres and mysql, and my understanding is it has some drawbacks for real prod use vs ths simplistic benchmarks presented in the paper.

Would love to know if anyones built something using it outside of academic testing.

These are still transactions! It's not uncommon for a large % of transactions in an OLTP workload to be only one query without explicit BEGIN / COMMIT; This is called an autocommit transactions or implicit transaction.

Author here. This is good feedback.

The combination of transactions, isolation levels, and MVCC is such a huge undertaking to cover all at once, specially when comparing how it's done across multiple DBs which I attempted here. Always a balance between technical depth, accessibility to people with less experience, and not letting it turn into an hour-long read.