A quest for speed
Tracks state through the life of a user session
Increasing demand for up-to-date information
Site speed directly impacts the rate at which users complete a desired outcome.
An average Time to Last Byte (TTLB) of 750 milliseconds per endpoint response.
Performance
A quick aside
"when given the same arguments, if a service call yields the same results every time, then it is a good candidate for caching"
The art of the possible
Task | Duration |
---|---|
L1 cache reference | 0.5 ns |
L2 cache reference | 4 ns |
Main memory reference | 100 ns |
Round trip within DC | 500,000 ns |
Round trip from DC to cloud | 30,000,000 ns |
Round trip CA -> Netherlands -> CA | 150,000,000 ns |
Task | Duration |
---|---|
Read 1MB from memory | 3,000 ns |
Read 1MB from SSD | 49,000 ns |
Read 1MB over network | 80,000 ns |
Read 1MB from Disk | 825,000 ns |
The user session
Long lived data
Update on read and write
If data changes at source, what value should be returned from the cache?
A quest for speed
Between a user and the primary data store there are often multiple different caches.
"a collection of information on severe (SEV-0 or SEV-1 incidents at Twitter that were at least partially attributed to cache"
data in memory
SELECT balance FROM /brand WHERE account.id = 12345678 AND account.brand = $1;
run code on the cache