Better HN
topnewbestaskshowjobs
Log inSign up

Sirupsen

1,121 karma · joined Apr 20, 2010 (16y ago) · 103 submissions

https://sirupsen.com

co-founder of https://turbopuffer.com

Submissions

1.

Rust zero-cost abstractions vs. SIMD(turbopuffer.com ↗)

24 points · by Sirupsen · 8mo ago · 4 comments

2.

SpacetimeDB: A Short Technical Review(strn.cat ↗)

9 points · by Sirupsen · 9mo ago · discuss

comment 9mo ago · link · parent

Yep! Other than random reads (~p99=200ms on larger ranges), it's essential to get good download performance of a single file. A single (range) request can "only" drive ~500 MB/s, so you need multiple offsets.

https://github.com/sirupsen/napkin-math

comment 9mo ago · link · parent

Due to the batching, this will only consume a few million class B per month. They are $5/million

comment 9mo ago · link · parent

(cofounder of tpuf here)

We don't have a relational database, otherwise that would work great for a queue! You can imagine us continuing to iterate here to Step 5, Step 6, ... Step N over time. The tradeoff of each step is complexity, and complexity has to be deserved. This is working exceptionally well currently.

6.

A distributed queue in a single JSON file on object storage(turbopuffer.com ↗)

171 points · by Sirupsen · 9mo ago · 55 comments

7.

Vectorized MAXSCORE over WAND, especially for long LLM-generated queries(turbopuffer.com ↗)

4 points · by Sirupsen · 11mo ago · discuss

comment 1y ago · link · parent

Our query planner has that built in! We've spent a lot of time making high recall with any selectivity in the fitler work.

comment 1y ago · link · parent

The short of it is that building a database on top of object storage has generally required a complicated, distributed system for consensus/metadata. CAS makes it possible to build these big data systems without any other dependencies. This is a win for simplicity and reliability.

comment 1y ago · link · parent

To avoid any dependencies other than object storage, we've been making use of this in our database (turbopuffer.com) for consensus and concurrency control since day one. Been waiting for this since the day we launched on Google Cloud Storage ~1 year ago. Our bet that S3 would get it in a reasonable time-frame worked out!

https://turbopuffer.com/blog/turbopuffer

11.

Amazon S3 Adds Put-If-Match (Compare-and-Swap)(aws.amazon.com ↗)

524 points · by Sirupsen · 1y ago · 160 comments

comment 2y ago · link · parent

It works great. We’ve had SPANN in production since October of 2023 at https://turbopuffer.com/

comment 2y ago · link · parent

tpuf’s ANN index uses a variant of SPFresh, yup. These are the only two production implementations I am aware of. I don’t think it is in production at MSFT yet

comment 2y ago · link · parent

Ya, the world needed S3 to become fully consistent. This didn't happen until end of 2020!

comment 2y ago · link · parent

Yeah, thinking about this more I now understand Clickhouse to be more of an operational warehouse similar to Materialize, Pinot, Druid, etc. if I understand correctly? So bunching with BigQuery/Snowflake/Trino/Databricks... wasn't the right category (although operational warehouses certainly can have a ton of overlap)

I left that category out for simplicity (plenty of others that didn't make it into the taxonomy, e.g. queues, nosql, time-series, graph, embedded, ..)

16.

Turbopuffer: Fast search on object storage(turbopuffer.com ↗)

379 points · by Sirupsen · 2y ago · 64 comments

comment 2y ago · link · parent

Most production storage systems/databases built on top of S3 spend a significant amount of effort building an SSD/memory caching tier to make them performant enough for production (e.g. on top of RocksDB). But it's not easy to keep it in sync with blob...

Even with the cache, the cold query latency lower-bound to S3 is subject to ~50ms roundtrips [0]. To build a performant system, you have to tightly control roundtrips. S3 Express changes that equation dramatically, as S3 Express approaches HDD random read speeds (single-digit ms), so we can build production systems that don't need an SSD cache—just the zero-copy, deserialized in-memory cache.

Many systems will probably continue to have an SSD cache (~100 us random reads), but now MVPs can be built without it, and cold query latency goes down dramatically. That's a big deal

We're currently building a vector database on top of object storage, so this is extremely timely for us... I hope GCS ships this ASAP. [1]

[0]: https://github.com/sirupsen/napkin-math [1]: https://turbopuffer.com/

comment 3y ago · link · parent

Emil if you email me at info@turbopuffer.com I can let you into the alpha :)

comment 3y ago · link · parent

While I never owned a VanMoof, I read they painted pictures of flat screen TVs on the shipping boxes after months of issues with bikes being damaged by the time they got to customers. Clever!

comment 3y ago · link · parent

Are you aware of a good write-up on how Clickhouse/other columnar databases do the intersection?

comment 3y ago · link · parent

MySQL can do skip-scans

https://dev.mysql.com/doc/refman/8.0/en/range-optimization.h...

comment 3y ago · link · parent

Ideally, I would add three graphs to the post:

(1) Table size on the x-axis, and time on the y-axis for index merge vs composite index

(2) Number of columns on the x-axis, and time on the y-axis for both

(3) Number of final matches on the x-axis, and time on the y-axis for both

But ran out of time and decided to test with the table size of 10M rows, and a 100-ish result set. That's in my experience a decent representation for what you might be doing with a relational database.

comment 3y ago · link · parent

You're absolutely right!

I forgot to move this around when I updated the article's structure. This is only relevant when doing the index merge. The article has been updated

comment 3y ago · link · parent

Excellent, thank you! I'll add that to the article.

comment 3y ago · link · parent

I've added this to the article, thanks!

Composite index (int64, int64): ~70 MiB in Postgres, ~350 MiB in MySQL

Single index (int64): ~70 MiB in Postgres, ~240 MiB in MySQL

If you assume the majority of an index are index entries of (int64, int64, int64) where the third number is some sort of identifier for the record on the heap, you'd expect this to be ~230 MiB. So Postgres does some compression very well here, and MySQL has a bit more overhead for its indexes it seems.

26.

Index Merges vs. Composite Indexes in Postgres and MySQL(sirupsen.com ↗)

175 points · by Sirupsen · 3y ago · 38 comments

comment 3y ago · link · parent

You might be very right about that! It's been a while since I did the SSD benchmarks. Glad to hear it's most likely entirely accurate at 4 GiB/s then!

comment 3y ago · link · parent

`madvise(2)` doesn't matter _that_ much in my experience with [1] on modern Linux kernels. SSD just can't read _quite_ as quickly as memory in my testing. Sure, SSD will be able to re-read a lot into ram, analogous to how memory reading will be able to rapidly prefetch into L1.

I get ~30 GiB/s for threaded sequential memory reads, but ~4 GiB/s for SSD. However, I think the SSD number is single-threaded and not even with io_uring—so I need to regenerate those numbers. It's possible it could be 2-4x better.

[1]: https://github.com/sirupsen/napkin-math

comment 3y ago · link · parent

Yes, sequential I/O bandwidth is closing the gap to memory. [1] The I/O pattern to watch out for, and the biggest reason why e.g. databases do careful caching to memory, is that _random_ I/O is still dreadfully slow. I/O bandwidth is brilliant, but latency is still disappointing compared to memory. Not to mention, in typical Cloud workloads, IOPS are far more expensive than memory.

[1]: https://github.com/sirupsen/napkin-math

comment 4y ago · link · parent

We spent a fair amount of time trying to get this executing fast on SQL. However, with spreadsheets you recursively compute a lot of values. You can do this in SQL with recursive CTEs, but it’s slow, they’re not optimized for this. They also of course won’t do smart caching and dependency management for the cache. Fundamentally, it’s possible, but then we’d need to start hacking on a DB engine to make it work as a sheet. We concluded it’s better to continue on our existing engine.
1234