Skip to content
TopicTracker
From HackerNewsView original
TranslationTranslation

Optimization tales with CockroachDB: the slow password reset flow

A password reset flow in CockroachDB was slower than expected despite a 3-second timeout. The author traces the problem to unnecessary network round trips caused by sequential synchronous storage calls, rather than batching or parallelizing them.

Background

- **CockroachDB** is a distributed SQL database designed for high availability and horizontal scalability, built by Cockroach Labs. It is modeled after Google Spanner and is widely used in production systems that need strong consistency across data centers. - This post is part of a series ("Optimization tales") where the author shares real-world performance debugging stories from a CockroachDB cloud service. - **Password reset flows** are a common feature in web applications. Even minor inefficiencies in database queries can cause noticeable delays under load, especially when the database is geo-distributed. - The article walks through a slow query investigation using tools like `EXPLAIN ANALYZE`, execution traces, and index tuning — techniques familiar to backend engineers and DBAs.

Related stories