Skip to main content

KeraDB vs DuckDB Benchmark (v0.1.0) — OLTP Meets OLAP (Quack Quack)

· 3 min read
KeraDB Team
Core Team

Before we begin… yes, we know.
DuckDB is OLAP. KeraDB is OLTP.
One is built to slice through massive analytical datasets like a lightsaber.
The other is optimized for fast, tiny transactional operations.

This benchmark is not a fair fight — and we knew that.
But developers kept asking questions, and curiosity got the best of us.
So we ran it anyway using Rust’s criterion.rs benchmarking suite.

And in the spirit of DuckDB:
Quack quack. 🦆
Let's see what happened.


Quick Summary

Despite being an OLAP engine, DuckDB held its own in range scans, while KeraDB — as expected — dominated on OLTP-style operations such as inserts, updates, deletes, point lookups, mixed workloads, and JSON-heavy tasks.

In other words:

  • When the workload looks like “give me a bunch of rows, now!” → DuckDB shines.
  • When the workload looks like “insert, update, lookup, delete… repeat fast!” → KeraDB zooms.

This test confirms what we already suspected — and reveals where each engine’s internal design flexes its muscles.


Quick Comparison

CategoryWinnerPerformance Advantage
Single InsertKeraDB~29× faster
Bulk Insert (100–5,000 docs)KeraDB16–19× faster
Point QueryKeraDB~66× faster
Range Query (10 docs)DuckDB~1.5× faster
Range Query (100 docs)KeraDBslight win
Range Query (1000 docs)DuckDB~3.6× faster
UpdatesKeraDB~70× faster
DeletesKeraDB~40× faster
Complex JSON InsertKeraDB~27× faster
Mixed Workload (80/20)KeraDB~66× faster
Storage Sync (5k docs)KeraDB~11× faster

Takeaway:
DuckDB can sprint across columns like an Olympian, but KeraDB handles OLTP-style workloads with ease — exactly as intended.


Key Metrics

1. Single Insert

DatabaseMean Time
KeraDB53.97 µs
DuckDB1.58 ms

2. Bulk Insert Performance

Batch SizeKeraDBDuckDB
100 docs6.48 ms125.67 ms
1,000 docs55.38 ms955.61 ms
5,000 docs283.96 ms4.69 s

3. Point Query

DatabaseMean Time
KeraDB9.62 µs
DuckDB635.78 µs

4. Range Queries

LimitKeraDBDuckDBWinner
10 docs1.221 ms0.799 msDuckDB
100 docs2.331 ms2.462 msKeraDB (slight)
1000 docs12.379 ms3.455 msDuckDB

This is the OLAP sweet spot: scanning across columns in batch.

5. Updates

DatabaseMean Time
KeraDB23.18 µs
DuckDB1.61 ms

6. Deletes

CountKeraDBDuckDB
100 docs2.14 ms85.12 ms
500 docs11.22 ms336.45 ms

7. Complex JSON Insert

DatabaseMean Time
KeraDB60.33 µs
DuckDB1.65 ms

8. Mixed Read/Write (80% read / 20% write)

DatabaseMean Time
KeraDB18.69 µs
DuckDB1.24 ms

9. Storage Sync (5,000 docs)

DatabaseMean Time
KeraDB279 ms
DuckDB3.05 s

Interpretation: OLTP vs OLAP (aka “The Quackening”)

DuckDB excels in exactly what it was designed for:

  • analytic workloads
  • scanning many rows
  • vectorized execution
  • heavy range queries

When we hit it with OLTP-style micro-operations (single inserts, updates, point lookups), it politely responded with:

“Sir… this is a columnar engine.” - 🧐

Meanwhile, KeraDB — being a lightweight document OLTP store — tore through these tasks with microsecond-level latency.

This test didn’t crown a universal winner. It simply reaffirmed their different purposes.


Where KeraDB Excels

  • Single inserts
  • JSON-heavy writes
  • Point lookups
  • Updates & deletes
  • Mixed workloads
  • Storage syncs
  • Bulk inserts

More importantly: KeraDB’s performance profile aligns with its OLTP design goals.


Where DuckDB Excels

  • Range queries
  • Analytical scans
  • Columnar operations
  • Batched reads

And of course: being a duck that quacks loudly in analytics.