Skip to content

`devshards` Postgres support for `devshard` storage #1098

Closed @akup opened 2026-04-21 20:36 UTC 3 comments Updated 2026-05-25 18:30 UTC

Problem

devshard/storage is sqlite-only today (storage/sqlite.go, modernc.org/sqlite). Running production devshards on embedded sqlite is the wrong default:

  • Every devshardd instance holds its own file, so nothing aggregates across hosts or across versions managed by versiond.
  • A production operator already runs Postgres for decentralized-api (see decentralized-api/payloadstorage/, decentralized-api/statsstorage/); forcing a second on-box database in sqlite duplicates backup, monitoring, and retention setups.
  • Integration tests and CI, by contrast, benefit from sqlite: zero dependencies, per-test cleanup, in-memory mode, fast startup.

We want both backends behind a single interface, chosen at runtime the same way decentralized-api/payloadstorage does it.

Also we should prune the old epoch's devshard data

Goals

  • Keep devshard/storage.Storage as the sole interface consumed by devshard/host and the rest of the module; do not leak backend specifics into callers.
  • Add a Postgres backend alongside the existing sqlite backend. It should be default db
  • Prune data related to devshards created at epochs < currentEpoch - 2

💬 Comments (3)

@Mayveskii commented 2026-04-24 20:22 UTC

RE

Hi, can i grab this one for couple of week ?

@tcharchian commented 2026-04-29 21:21 UTC

https://github.com/gonka-ai/gonka/pull/1126

@x0152 commented 2026-05-07 08:41 UTC

Closed by #1145


🔄 Auto-synced from Issue #1098 every hour.