Build1 publisher2 min readPublished
JSONB and pgvector cover two of the five roles this Postgres consolidation absorbs
A dev.to design guide moves JSON documents and vector search into one PostgreSQL instance, and the evidence it offers is operational: deleted ETL pipelines and sync bugs, with no query timings on either side.
The Engineer · Build desk

What happened
- A dev.to design guide sets out how to run JSON documents, time-series data and vector similarity search inside one PostgreSQL instance, with the aim of eliminating multi-database sprawl.
- Its account of the mid-2010s stack lists six categories, including MongoDB for documents, Redis for session state, Elasticsearch for log analytics and Pinecone or Qdrant for embeddings.
- The charge it lays against that stack is that teams spent more time on cross-database synchronization, eventual consistency bugs, ETL pipelines, hosting costs and local dev setups than on shipping features.
- Feature-flag lookups are written as JSONB containment matches, asking for rows whose settings contain a nested feature_flags object with beta_access set to true.
- For vectors it enables pgvector and builds an HNSW index over cosine distance with m set to 16 and ef_construction set to 64.
Compiled by The EngineerSomething wrong?How this is made
Why it matters
- decision The consolidation call now rests on evidence each team has to gather locally: hours lost keeping two stores in step, weighed against the latency budget a specialised engine was bought to meet.
- cost Copying the listing wholesale means adopting its HNSW build settings as production settings, and the instance serving transactions is the one paying for index builds and approximate scans.
- capability Scoping a similarity search by tenant in the same statement removes the round trip a separate vector store needs, and the candidate IDs stay inside one system.
- constraint Absorbing the vector role as an extension ties that workload to one Postgres version and one maintenance window shared with the relational data.
JSONB differs from a JSON text column at write time. Postgres decomposes the document into a binary format then, and that is what makes indexing and partial updates possible [6]. The listing puts two GIN indexes on the same column, one over the whole settings document and one over the feature_flags path inside it [8]. Updates go through jsonb_set, which changes a nested billing tier and leaves the rest of the document in place [10]. Before keeping both indexes in production I would want to know how often that column is written.
Vectors are the half I would test first. The embedding column is declared vector(1536), sized in a comment for OpenAI's text-embedding-3-small [13]. The search filters on tenant_id, orders by the cosine distance operator and takes five rows [15]. One equality predicate over a single tenant, one approximate index built across every tenant's rows: I would measure recall on that combination, at the build parameters the DDL supplies [14]. Whether the tenant predicate is applied before or after the approximate scan changes which five rows come back.
The performance claim is a single sentence. With GIN indexing, the article says, Postgres can query nested JSON fields "at speeds comparable to native document databases" [7]. The article publishes no measurement, for Postgres or for the document engine it is compared against [17]. To move that claim onto another workload you would need documents of a similar size, query shapes GIN can serve, an index that fits in memory and comparable write concurrency.
Count the categories in the stack the piece displaces and there are six. One of them is Postgres, which leaves five roles to move, and DDL with worked queries appears for two of them, documents and embeddings [18]. The time-series case opens on append-only metric streams such as telemetry, audit logs and financial tickers, and the text available stops there [16].
I would act on the operational claim first, because a team can price it from its own incident log [4], and the latency comparison needs a run on your own data before it counts for anything [7].
What to watch
- Whether the guide's time-series section leans on stock Postgres partitioning or on the Timescale extension. That choice decides whether the consolidation stays on vanilla Postgres.
- Whether recall figures appear for filtered HNSW search under tenant scoping at the build parameters the listing uses.
- Whether the caching and full-text search roles from the article's own list get the same DDL treatment as documents and vectors.