Section Insights
Transition from Dynamo DB to Cobble DB
Why did Perplexity move away from Dynamo DB?
Perplexity transitioned from Dynamo DB due to high costs and lack of control over data management, which affected performance.
- Perplexity's search backend required fetching many pages simultaneously.
- Dynamo DB's cost escalated with the growth of Perplexity's index.
- Lack of control over partitioning and caching led to performance issues.
Limitations of Dynamo DB
What were the limitations of using Dynamo DB for Perplexity?
Dynamo DB's managed nature limited Perplexity's control over data partitioning and caching, leading to potential slowdowns in data retrieval.
- Perplexity faced challenges with slow replicas affecting batch reads.
- The inability to control machine allocation hindered performance.
Introduction of Cobble DB
How did Cobble DB improve performance for Perplexity?
Cobble DB, built on Rox DB, improved read performance by allowing parallel reads across replicas, significantly reducing latency.
- Cobble DB allows for faster reads by distributing requests across replicas.
- Median batch read latency improved from 31.4 ms to 5.6 ms.
Performance Metrics of Cobble DB
What were the performance improvements observed with Cobble DB?
Cobble DB achieved a significant reduction in latency, with P99 latency dropping from 123 ms to 24 ms, and it was also more cost-effective than Dynamo DB.
- Cobble DB is approximately five times faster than Dynamo DB.
- It is at least 20% cheaper than Dynamo DB according to Perplexity's cost model.
Development of Cobble DB
How was Cobble DB developed?
Cobble DB was developed in two months by two engineers with the assistance of AI agents for various tasks, while the engineers maintained oversight.
- The development involved a combination of human engineers and AI agents.
- AI agents contributed to testing, monitoring, and documentation.
Transcript
0:00 Perplexity just fired Dynamo DB and its replacement was built by two engineers. That's not even the crazy thing here. So, let's break it down. Perplexity search backend fetches a lot of pages at once. A single API request needs around 100 to 120 page keys split into batches of 10 to 20 with each record around 50 kilobytes. And on Dynamo DB, every bite you read or write is build. So, as Perplexity's index grew, so did the bill. But the cost wasn't the only problem because Dynamo DB is managed.
0:32 Perplexity couldn't control which machine held a partition. How much memory was used for caching or even which replica answered a request. And when you're reading a whole batch at once, one slow replica can hold everything up. So, Perplexity built its own key value hot store called Cobble DB. Each node runs on Rox DB. Keys are grouped by partition. Reads happen across replicas and parallel. And if one replica is too slow, Cobble DB can send that same read to another one. And the difference here was massive. In production, median batch read latency dropped from 31.4 milliseconds to 5.6.
1:11 P99 dropped from 123 milliseconds to just 24. So roughly five times faster, while Perplexity's own cost model says it's also at least 20% cheaper than Dynamo DB at every commitment lately. But there's the part everyone was arguing about. Cobbled DB is around 40,000 lines of, you guessed it, Rust. And it was built in two months by two engineers plus AI agents. Those agents wrote fixes, tests, monitoring agents, and docs, and even tracked CI and review gates. But they weren't running production. The engineers still designed the architecture, reviewed the changes, and explicitly pushed on those button.
1:48 If you want more engineering breakdowns like this, be sure to subscribe to the Better Stack
Summary
- Perplexity's previous use of DynamoDB led to high costs and limited control over data management.
- Cobble DB was created to optimize performance, utilizing Rox DB and parallel reads across replicas.
- Batch read latency improved dramatically, with median times dropping from 31.4 ms to 5.6 ms.
- The 99th percentile latency decreased from 123 ms to 24 ms, making it roughly five times faster than DynamoDB.
- Cobble DB is estimated to be at least 20% cheaper than DynamoDB at every commitment level.
- The development involved AI agents for tasks like writing fixes, tests, and documentation, while engineers focused on architecture and oversight.
- The entire project consisted of around 40,000 lines of Rust code.
Questions Answered
Why did Perplexity move away from Dynamo DB?
Perplexity transitioned from Dynamo DB due to high costs and lack of control over data management, which affected performance.
What were the limitations of using Dynamo DB for Perplexity?
Dynamo DB's managed nature limited Perplexity's control over data partitioning and caching, leading to potential slowdowns in data retrieval.
How did Cobble DB improve performance for Perplexity?
Cobble DB, built on Rox DB, improved read performance by allowing parallel reads across replicas, significantly reducing latency.
What were the performance improvements observed with Cobble DB?
Cobble DB achieved a significant reduction in latency, with P99 latency dropping from 123 ms to 24 ms, and it was also more cost-effective than Dynamo DB.
How was Cobble DB developed?
Cobble DB was developed in two months by two engineers with the assistance of AI agents for various tasks, while the engineers maintained oversight.