←back to thread

Why AO3 Was Down

(www.reddit.com)
153 points danso | 2 comments | | HN request time: 0.403s | source
Show context
RainyDayTmrw ◴[] No.44470247[source]
It's kinda impressive that they got to 2 billion rows - with indexes, no less - without falling over.
replies(1): >>44471169 #
jiggawatts ◴[] No.44471169[source]
Point queries — typical of this kind of app - scales as log(n) in the number of rows. (Assuming a typical b-tree database index.)

This kind of workload cheerfully “scales” to your disk capacity.

replies(1): >>44477412 #
1. RainyDayTmrw ◴[] No.44477412[source]
Locking would make that more complex, I believe?
replies(1): >>44478691 #
2. jiggawatts ◴[] No.44478691[source]
Not necessarily. Typically a b-tree single-row modification updates only one leaf page. Higher levels change only 1/N times where N is the number of items per page, typically in the hundreds. So three levels up the chance of a lock conflict is only 1/N^3 or about one in a million. Four levels it is one in a hundred million, etc...