HackerTrans
トップ新着トレンドコメント過去質問紹介求人

KraftyOne

1,176 カルマ登録 7 年前
Hello! I'm Peter Kraft. I love databases and distributed systems and recently co-founded DBOS to help developers build reliable software effortlessly.

Website: http://petereliaskraft.net/

投稿

Postgres transactions are a distributed systems superpower

dbos.dev
232 ポイント·投稿者 KraftyOne·9 日前·94 コメント

Just Use Postgres for Task Queues

dbos.dev
2 ポイント·投稿者 KraftyOne·15 日前·0 コメント

Is this blog written by AI?

brooker.co.za
5 ポイント·投稿者 KraftyOne·16 日前·0 コメント

Show HN: DBOSify – Drop-in Temporal replacement built on Postgres

github.com
91 ポイント·投稿者 KraftyOne·17 日前·19 コメント

Surprising economics of load-balanced systems

brooker.co.za
160 ポイント·投稿者 KraftyOne·22 日前·37 コメント

Just Co-Locate Data in Postgres

dbos.dev
2 ポイント·投稿者 KraftyOne·23 日前·0 コメント

Can Postgres Replace Task Queues at Scale?

dbos.dev
2 ポイント·投稿者 KraftyOne·30 日前·0 コメント

Our First Customers Were the Exception

apurvamehta.com
3 ポイント·投稿者 KraftyOne·先月·0 コメント

Can Postgres Queues Scale?

dbos.dev
4 ポイント·投稿者 KraftyOne·先月·1 コメント

Building durable workflows on Postgres

dbos.dev
359 ポイント·投稿者 KraftyOne·先月·147 コメント

Postgres Is All You Need for Durable Execution

dbos.dev
1 ポイント·投稿者 KraftyOne·2 か月前·0 コメント

What's Easy Now? What's Hard Now?

brooker.co.za
4 ポイント·投稿者 KraftyOne·2 か月前·0 コメント

Goto Considered Harmful: Why Event-Driven Is a Poor Architecture

dbos.dev
2 ポイント·投稿者 KraftyOne·2 か月前·2 コメント

Build Reliable Notifications with Postgres

dbos.dev
2 ポイント·投稿者 KraftyOne·2 か月前·0 コメント

Who even uses jemalloc anyway?

theconsensus.dev
3 ポイント·投稿者 KraftyOne·2 か月前·0 コメント

Does Postgres Scale?

dbos.dev
192 ポイント·投稿者 KraftyOne·2 か月前·95 コメント

Measuring AI Ability to Complete Long Software Tasks

muratbuffalo.blogspot.com
2 ポイント·投稿者 KraftyOne·2 か月前·0 コメント

Benchmarking How Postgres Scales

dbos.dev
2 ポイント·投稿者 KraftyOne·3 か月前·0 コメント

Async Python Is Secretly Deterministic

dbos.dev
79 ポイント·投稿者 KraftyOne·3 か月前·36 コメント

Bridging Languages with Postgres and Workflows

dbos.dev
2 ポイント·投稿者 KraftyOne·4 か月前·0 コメント

コメント

KraftyOne
·9 日前·議論
Outbox's power is that it turns an atomicity problem into an idempotency problem. You atomically write to the outbox, then you have an idempotent "workflow" that processes events from the outbox. This turns "at most once" semantics (where an event could be dropped entirely) to "at least once" semantics (where the event processing could run multiple times). For many systems, that's a big improvement.
KraftyOne
·9 日前·議論
You still need idempotency for side effects outside your database, that's true (and fundamental to durability). But now you get exactly-once semantics for operations on your database, which can be quite valuable if your workflow performs many such updates or they're particularly complicated or stateful.
KraftyOne
·9 日前·議論
That's what the post is about! Once you're doing that, you really do have transactions between the state and the queue.
KraftyOne
·9 日前·議論
Every item will be written to the queue exactly once (as the update is transactional). Queue processing may need at-least-once semantics, yes, depending on what exactly you're doing.
KraftyOne
·9 日前·議論
You build a distributed system on top of this! For example, you may have many distributed workers durably executing workflows from the Postgres-backed task queue. The Postgres transactions allow you to atomically perform operations spanning both your task queue and your business data.

Here's another blog post about how a Postgres-backed task queue can run at scale: https://www.dbos.dev/blog/making-postgres-queues-scale
KraftyOne
·9 日前·議論
Yes, the core design is building a workflow system on a database--essentially, replacing the central orchestrator most workflow systems use with a Postgres database. This previous blog post goes into more detail: https://www.dbos.dev/blog/postgres-is-all-you-need-for-durab... (HN discussion: https://news.ycombinator.com/item?id=48313530)
KraftyOne
·9 日前·議論
[dead]
KraftyOne
·9 日前·議論
The key is that the UDF's enqueue is transactional with the database update. Let's say the database update is inserting a new order. This provides the guarantee that if a new order is inserted, a job to process the order is also enqueued. It's impossible for a new order to be inserted without its processing job also being enqueued. Then the durable workflow/queue system is responsible for making sure the processing job, once enqueued, actually executes.
KraftyOne
·9 日前·議論
Exactly! It's a distributed system, with many processes performing work in parallel, with a central database as a coordination point, used as little as possible. A mutex wouldn't get quite the same performance :)
KraftyOne
·14 日前·議論
Unfortunately, DSQL is still lacking many core Postgres features (most notably foreign keys) that DBOS and DBOSify depend on. DBOS works with most flavors of Postgres though, including regular Aurora/RDS, Cloud SQL, AlloyDB, Supabase, Neon, CockroachDB, and others.
KraftyOne
·14 日前·議論
Take any Temporal example and swap the imports and connection strings, it's a drop-in replacement :)
KraftyOne
·14 日前·議論
We'd need DBOS in C# first! It's something we're considering for the future--if you're working in C#, happy to chat about it, reach out at [email protected].
KraftyOne
·14 日前·議論
Exactly, Postgres as an orchestrator instead of a Temporal server as an orchestrator. This page goes into more detail (for DBOS, but DBOSify is the same principle but using the Temporal API directly): https://docs.dbos.dev/explanations/comparing-temporal
KraftyOne
·14 日前·議論
I'm very sorry about this. I'll figure out why the form wasn't responded to. In the meantime, email me directly at [email protected].
KraftyOne
·14 日前·議論
Yes it can (with documented exceptions)! The suite is here: https://github.com/dbos-inc/dbosify-py/tree/main/tests/confo...

Here's the documentation: https://github.com/dbos-inc/dbosify-py/blob/main/docs/ARCHIT...
KraftyOne
·17 日前·議論
Hi HN, I'm Peter, creator of DBOSify. Here to answer any questions you have!
KraftyOne
·先月·議論
Secrets are orthogonal to durable execution--what are your concerns about using them together?
KraftyOne
·2 か月前·議論
> Based on the shown graph, this is misleading at best, essentially false. After 120K writes/s p50 spikes from 10ms to 1s (1 second for a write!!!!). That's two orders of magnitude latency spike, and an unacceptable one for an OLTP workload. It clearly shows the server is completely saturated, which is clearly a non operational regime. Quoting 144K is equivalent to quoting the throughput of a highway at the moment traffic comes to a standstill.

> Based on this graph the highest number I'd quote is 120K. And probably you want to keep operating the server within a safe margin below peak, but since this is a benchmark, let's call 120K the peak. Because actually p50 is not even the clear-cut. It should be a higher percentile (say p95) at which latency is within reasonable bounds. But for the shake of not over complicating, it could be taken as a reference.

You definitely don't want to run a production system at saturation! But it's worthwhile to measure a complex system like Postgres at saturation, see when it gets there and how it behaves there, and then run at a slightly lower throughput.

> Therefore, you are not measuring Postgres peak performance, but rather Postgres performance under the IO constraints of this particular system. Certainly, 120K IOPS is the maximum that this particular instance can have. But it doesn't show if Postgres could do better under a more performant IO disk. Actually, a good test would have been to try the next instance (db.m7i.48xlarge) with 240K IOPS and see if performance doubles (within the same envelop of p50 latency) or not. And afterwards to test on an instance with local NVMe (you won't find this in RDS).

I've done some testing (not in the blog post)--doubling instance size/IOPS doesn't improve performance significantly because it doesn't affect the WAL bottleneck. Local NVMe should have a significant impact in theory, but I haven't tested this myself.

> 300 seconds test duration?? This is not operational. You are not accounting for checkpoints, background writer, and especially autovacuum. Given that workflow pattern includes UPDATEs, you must validate bloat generation (or, equivalently, bloat removal) by a) observing much longer periods of time (e.g. 1h) and b) making sure the autovacuum configuration (and/or individual table vacuum configuration if required) makes bloat contained in a stable way. Otherwise, shown performance numbers will degrade over time, making them not realistic.

Those are usage examples (notice the 1000 rps)--actual benchmarks were run at and were stable at much longer duration.
KraftyOne
·2 か月前·議論
Yes, this benchmark deliberately uses RDS defaults to make the comparison fairer/more general.

One warning--the setting that would increase throughput the most (synchronous_commit = off) sacrifices durability to do so.
KraftyOne
·3 か月前·議論
Yes, this only applies for tasks created from the same (sync or async) function. If tasks are creating other tasks, anything is possible.