Skip to main content

What are you looking for?

Explore our services and discover how we can help you achieve your goals

PostgreSQL: the relational default for transactional and JSON data

PostgreSQL, the open-source relational database, fits an application's core records — accounts, orders, invoices and anything that must stay consistent under concurrent writes — plus reporting queries joined against that same data, JSON fields stored next to relational columns, and full-text search over content already living in the database.

Submit a project See the cloud ERP record

Reviewed by Huy Nguyen (David), CEO · Updated 17 Oct 2026

star

OutsourcingVN is operated by Netbase JSC, and this page decides the operational database engine behind an application, separate from the shared data and AI platform a workload may later sit inside.

Image

When does PostgreSQL fit, and when does it not?

Good fit

  • Transactional records that must stay consistent under concurrent writes, such as orders, accounts or inventory ledgers
  • Reporting and analytical queries run against the same data the application already owns
  • A handful of flexible JSON fields stored alongside otherwise structured, relational columns
  • Full-text search over a catalogue or content set that already lives in the same database

Another route fits better

  • Data whose shape changes often or nests deeply, such as a catalogue or event stream, where MongoDB is the more direct fit
  • A large, separate analytics workload serving several systems, which the data and AI platform engineering service scopes as shared infrastructure
  • A product whose central record is the JSON document itself, with few fixed columns around it
  • A product-wide relevance or retrieval feature serving several workflows, which the embeddings and semantic search guide works through directly

Implementation patterns

A PostgreSQL schema starts from the entities and relationships the application owns, normalised into tables with foreign keys that enforce referential integrity at the database layer rather than only in application code. Versioned migrations move the schema forward in small, reversible steps, each one reviewed alongside the application change it supports, so a rollback never depends on remembering what a column used to mean. Alongside strictly relational columns, PostgreSQL's jsonb type stores JSON as a decomposed binary value rather than raw text, which trades a small write-time conversion cost for far faster queries, containment operators and index support than a plain json column offers; it earns its place on a handful of flexible fields, such as a per-tenant settings blob, not as the shape of the whole schema. Full-text search runs inside the same database through tsvector and tsquery: documents are parsed and normalised into lexemes, then matched and ranked without a separate search service, which suits a catalogue or content set that does not yet need a dedicated index.

Backups combine continuous write-ahead log archiving with periodic base backups, so a restore can reach any point in time rather than only the last snapshot; a read replica, kept current from the same write-ahead log, absorbs reporting queries so they do not compete with transactional traffic on the primary. On the multi-tenant cloud ERP record, PostgreSQL is one of four database engines in the stack, alongside MySQL, MariaDB and MongoDB, for a US client that is not named; phase one, from 2020 to 2023, covered CRM, real-time messaging, HR, a knowledge base, custom fields and workflows, work and project management and API integrations, deployed on AWS, one of the providers Netbase chooses between per workload alongside Google Cloud, DigitalOcean and Cloudflare.

What trade-offs should you weigh?

  1. Consistency against write throughput. PostgreSQL enforces transactional consistency at the database layer, which protects data integrity under concurrent writes but means a schema change is a planned migration, not a silent shape change the application absorbs on its own.
  2. A few JSON fields against a document-shaped schema. jsonb columns carry flexibility well for a handful of fields; a schema that is mostly JSON fights the relational model it sits inside and usually signals a document database is the better starting point.
  3. Vertical scale against sharding. A single PostgreSQL primary scales a long way with enough CPU, memory and fast storage, and read replicas absorb reporting load; a workload that outgrows one writer needs an explicit sharding or partitioning design, which PostgreSQL does not provide automatically.
  4. Operational ownership against convenience. Running PostgreSQL yourself means owning backup verification, replica failover and the annual upgrade cycle; a managed service shifts that work to a provider at the cost of configuration limits that provider sets.

A worked scenario

A hypothetical subscription billing platform needs strict consistency on invoices and payment records, a reporting view finance checks weekly, a per-customer settings panel whose fields vary by plan, and a searchable log of support notes attached to each account.

  • Milestone one builds the core relational schema for customers, subscriptions, invoices and payments, with foreign keys enforcing that a payment always references a real invoice.
  • Milestone two adds a jsonb settings column per customer for the fields that vary by plan, rather than a sparse table of optional columns that grows with every new plan type.
  • Milestone three indexes the support notes with PostgreSQL full-text search, so account staff can search by keyword without a separate search service.
  • Milestone four stands up a read replica for the weekly finance report, so that query never competes with payment processing on the primary.

Each milestone closes against a schema and a migration a reviewer can run against a copy of production data, not a design document, since a schema that only exists as a diagram has not yet shown it holds up under real writes.

Where does AI fit on a PostgreSQL database?

With AI, every new capability — a retrieval index, an evaluation pipeline, a model-scoring step — is new to every supplier, and Netbase takes each one on and combines it into delivery rather than waiting for a long track record to form first. On a PostgreSQL-backed application, that usually means an AI feature reads from the same governed schema through an API rather than through its own private copy of the data, and the database stays the system of record while the model or retrieval layer runs as a service the application calls. Hosting for that service is chosen per workload among AWS, Google Cloud, DigitalOcean and Cloudflare, not fixed to one provider in advance.

What to check before committing

PostgreSQL releases a new major version about once a year and supports each one for five years from release, with a final minor release marking the end of that window; minor releases ship at least every three months with bug fixes and security fixes only, and the project recommends always running the current minor release of whichever major version is in use. Confirm before scoping a build:

  • Which major version, and how close it is to end of support, since a major version stops receiving fixes five years after its release.
  • Whether a field is a handful of flexible attributes or the shape of the whole record, since that decides between a jsonb column and a document database such as MongoDB.
  • Whether search or reporting load should run on a replica, so it never competes with transactional writes on the primary.
  • Who owns the backup restore test and the annual upgrade, since nothing forces either the way a managed service's schedule would.

Failure modes

  • A document-shaped schema forced into tables

    Data whose shape changes often, normalised into many joined tables to keep it relational, costs more to query and migrate than storing it as a document in the first place.

  • No restore ever tested

    A backup that has never been restored is not yet a backup; the write-ahead log and base backup only prove useful once a restore has actually been rehearsed.

  • Reporting queries left on the primary

    A heavy weekly report run directly against the transactional database competes with the writes the application depends on, exactly the load a read replica exists to absorb.

  • A major version run past its support window

    PostgreSQL's five-year support clock does not pause for a busy roadmap, and an unsupported major version stops receiving security fixes.

What Netbase has built with PostgreSQL

PostgreSQL is part of the stack of the multi-tenant cloud ERP, for a client and product that are not named; phase one, from 2020 to 2023, covered CRM, messaging, HR, a knowledge base, custom fields and workflows, work and project management and API integrations. The underlying stack adds MySQL, MariaDB and MongoDB alongside PostgreSQL, deployed on AWS. These are delivered as Custom Product Engineering milestones: most Netbase projects are agreed as fixed-scope contracts after discovery, following discovery and strategic alignment, team assembly and architecture planning, agile execution with outcome-based milestones, modular components, training and rollout, and ongoing support.

Multi-tenant cloud ERP SaaS platform
Multi-tenant cloud ERP SaaS platform

This record covers phase-one scope for agency SMEs; the client and product are not named, and no usage or business result is claimed.

Keep Reading

Common questions

Not for data whose shape changes often or nests deeply; jsonb carries a handful of flexible fields well, but a schema that is mostly JSON usually fits a document database such as MongoDB better.

Yes, for a catalogue or content set already living in the database; tsvector and tsquery parse, normalise and rank matches inside PostgreSQL itself, without the operational cost of running a separate search index.

Minor releases ship at least every three months with fixes only, and a major version is supported for five years, so a yearly review of the current major version and a quarterly check for minor updates keeps a deployment inside its support window.

No. A move between database engines is a data and query migration, not necessarily an application rewrite; the legacy data migration planning guide covers how that migration is scoped and verified.

Yes; both are common pairings. The Laravel and Strapi pages cover the application and content-API layer that sits on top of the schema this page describes.

Wherever the workload is hosted; Netbase chooses the cloud provider — AWS, Google Cloud, DigitalOcean or Cloudflare — per workload rather than defaulting to one.

Yes. Every service on this site is delivered remotely from Hanoi, and Netbase has worked with clients in 80 countries. Delivery communication is in English, with weekly reviews and a named project manager.

Netbase takes on projects in any industry where the work can be delivered remotely and accepted by milestones. The industry pages describe the approach sector by sector, and the Work records show delivered projects.

Payment is by bank transfer to the company account of Netbase JSC or through PayPal Business. The payee is always Netbase JSC, the company that operates OutsourcingVN.

Talk to Huy Nguyen (David), Founder and CEO of Netbase JSC: message him on WhatsApp at +84 937 869 689 or email project@netbasejsc.com. You can also send your brief through the project request form. Say which workflow or system the project concerns and what has to stay unchanged; the first step is a discovery conversation, and scope and milestones are agreed after it.

Custom product engineering for a bounded release outcome Custom product engineering for a bounded release outcome

One defined release of your product, built to named outcomes and handed over with acceptance evidence.

Learn More
line

From database decision to project

Bring the records your application owns, the reporting and search queries run against them, and your plans for a shared data platform, and custom product engineering scopes the schema, migrations and backup design before a line of code is written; the other platform pages sit under Technologies, and a workload serving several AI or analytics features at once is scoped through data and AI platform engineering instead. OutsourcingVN is operated by Netbase JSC and is Netbase's own outsourcing-services platform; submit a project with the data your application needs to keep consistent.

Tell us what you want to build or automate.

Submit a project