Menu

1 / 5

DB Locking 101 for Serverless Devs

DEV Community·srinu madhav vysyaraju·7 months ago
#YJxyt2Tf
Long article (2101 words) — no AI summary yet.
Reading 0:00
15s threshold

A flash sale goes live on a popular booking platform. Fifty dollars off the Friday evening flight from New York to London. Within seconds, a thousand Lambdas wake up and each one runs:

UPDATE flight_inventory SET seats_available = seats_available - 1 WHERE flight_id = 'NYC-LON-FRI' AND fare_class = 'Y' ;

Enter fullscreen mode

Exit fullscreen mode

Your p99 latency jumps from 50ms to 30 seconds. No code changed. No deploy. CPU is fine. Connections look healthy-ish. What happened?

The answer is locks . If your mental model of database locking is fuzzy, serverless will find every gap and turn it into a pager alert.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.