Hi @Jiale, thanks for the interest in CockroachDB. As you noted above, CockroachDB can be used as a key value store through SQL with very little loss in performance. I’ll break down each of your requirements:
UUID Primary Key - String Value
CockroachDB provides a UUID data type specifically for this use case. Because UUIDs are a fixed 128-bits, they can be more efficiently encoded than a variable length string.
~ 5 Billion records
Given enough disk space, this should be manageable. Do have an estimate on how large each record will be?
~ 15000 qps for read
This should be fine.
~ 20000 records/s for write
This should also be fine as long as these writes are not contended.
remove everything whose last_updated_at is before 1 year
CockroachDB doesn’t yet support row-level TTLs. This is discussed further in this forum post: Auto-Expiring data. You can probably work around this with a cron-job.
across multiple data centers and cloud providers but sync latency can be at seconds
Check out this blog post
read latency 95percentile < 15 ms
This is very reasonable given proper SQL indexing. Point lookups should be in the single-digit ms range.
Can we deploy this on kubernetes?
Yes, please see our docs on this.