PostgreSQL — the database behind your website and online store
Every product, order, lead and page you create on 4buildsite lives in a PostgreSQL database. You never have to administer it — but it is worth knowing why we chose it: transactional integrity for payments, reliability proven over almost 30 years, and zero licence cost in your price.
What PostgreSQL is and what it stores for your website
PostgreSQL is an open-source relational database system, in continuous development since 1996 — with roots in the POSTGRES project at the University of California, Berkeley (1986). On 4buildsite, PostgreSQL is where your website data lives: products and stock, orders and payments, leads from forms and page content. You work in the visual editor; PostgreSQL keeps every change safe.
Why does this matter to you if you are not a programmer? Because the difference between a serious database and a fragile one shows up exactly in the hard moments: a traffic spike during a promotion, a payment retried twice, a server restart. PostgreSQL is designed to get through those moments without losing or corrupting data — which is why companies like Instagram and Reddit run it at scale, and historically it powered Skype’s infrastructure.
- Products, variants and stock — your store’s complete catalog
- Orders, Stripe payments and invoices — your sales history, with no gaps
- Leads from forms — every quote request, guaranteed saved
- Page and template content — everything you edit in the visual editor
- Your site’s domains, settings and published versions
Orders and payments without corrupted data — ACID integrity
When a customer places an order, several things happen at once: stock decreases, the order is created, the Stripe payment is recorded. PostgreSQL executes them as a single transaction: either all of them happen, or none. If the payment fails halfway, stock automatically returns to its initial value. This behaviour is called ACID (Atomicity, Consistency, Isolation, Durability) and PostgreSQL guarantees it on every table, with no special configuration.
Beyond transactions, PostgreSQL enforces integrity rules directly in the database: an order line cannot reference a product that does not exist, stock cannot go negative, an account e-mail cannot be duplicated. These constraints (foreign keys, check, unique) stop bad data before it gets in — not after it has broken your sales report.
For marketplaces, integrity matters twice over: commissions and split payments through Stripe Connect are calculated from order data. A duplicated order or an inconsistent amount would mean money split incorrectly between vendors. PostgreSQL transactions keep those calculations correct, order by order.
Fast catalog search and flexible content
PostgreSQL ships a full-text search engine: customers type “running shoes” and find the right products, with stemming dictionaries including Romanian. The pg_trgm extension adds typo tolerance. For a store, these capabilities mean a catalog can be searched well without a separate Elasticsearch-style service — so fewer components that can fail and lower infrastructure costs.
The content of pages built in the visual editor has no fixed structure — a hero block, a form and a gallery all have different fields. PostgreSQL solves this with JSONB: native JSON storage, indexable with GIN indexes, queryable like any column. You get the flexibility of a document database while keeping relational integrity for orders and payments — in one system, not two.
- tsvector + stemming dictionaries (Romanian included) — relevant catalog search
- pg_trgm — customers find the product even with a typo
- JSONB with GIN indexes — flexible page blocks stay fast to query
Reliability: backup, recovery and no surprises
PostgreSQL writes every change to a journal first (WAL — Write-Ahead Log) and only then to the actual data. If the server stops abruptly, the database rebuilds itself from the journal on restart, with no corrupted data. The same mechanism is what PostgreSQL builds point-in-time recovery (PITR) on — a standard engine capability for installations that archive the WAL journal. On 4buildsite, data lives on persistent volumes, separate from the application, so a platform restart or update never touches it.
PostgreSQL also supports streaming replication — a synchronised copy of the database, ready to take over traffic when needed. For your website, database reliability translates directly into SEO and GEO: a site that responds consistently is crawled and indexed consistently, while repeated 5xx errors lower your Google rankings and your chances of being cited as a source by AI engines.
Scaling and costs — grow without licence bills
When your store grows, PostgreSQL grows with it: indexes keep queries fast on catalogs with hundreds of thousands of products, partitioning splits order history by period, and read replicas absorb reporting traffic. Instagram and Reddit scaled on PostgreSQL to hundreds of millions of users — an online store hits this technology’s limits far later than it thinks.
PostgreSQL has a free licence (the PostgreSQL License, BSD-style) — no licence fees and no commercial owner who can change the rules overnight. Commercial databases are typically licensed per CPU core, and that cost inevitably ends up in the client’s price. On 4buildsite, the database is included in your plan, alongside hosting and SSL — with no separate fee.
Pros and cons
Pros
- Full ACID transactions — orders and payments stay consistent even through errors or server crashes.
- Reliability proven since 1996, in production at Instagram, Reddit and, historically, Skype.
- Native JSONB — flexible page content without sacrificing relational integrity.
- Built-in full-text search, with Romanian stemming — catalog search without a separate service.
- Free licence — zero licence cost hidden in your plan price.
- WAL journal — after an abrupt server stop, the database rebuilds itself on restart with no corrupted data.
Limitations
- Advanced administration (tuning, replication, failover) takes expertise — on 4buildsite we handle it, but self-hosting is demanding.
- Writes live on a single primary node — spreading them across nodes (sharding) is not native and needs extra tooling.
- Each connection uses comparatively more memory — many connections require pooling (PgBouncer).
- Full-text search is good, but below dedicated engines for advanced relevance and search suggestions.
Quick verdict
PostgreSQL is the standard choice for websites, online stores, marketplaces and SaaS platforms where orders, payments and leads must never be lost. A simple blog could get by with less — but the free licence means on 4buildsite you get this level of safety anyway, at no extra cost.
Specifications table
| Capability | Limit / threshold | Typical use | |
|---|---|---|---|
| Transactional integrity | Full ACID + MVCC, on every table | Very long transactions hold resources | Orders, payments, stock |
| JSONB | Native JSON, GIN-indexable | Very complex JSON queries are slower than classic columns | Page content, settings, product attributes |
| Full-text search | tsvector + pg_trgm, multilingual (Romanian included) | Relevance below dedicated search engines | Store catalog search |
| Backup & replication | WAL, PITR, streaming replication | Automatic failover needs external tooling (e.g. Patroni) | Incident recovery, high availability |
| Scaling | Read replicas, table partitioning | Writes stay on the primary node | Large catalogs and order histories |
| Cost | Open-source, free licence | The real cost is infrastructure and administration | Included in 4buildsite plans |
PostgreSQL vs MySQL vs MongoDB
| Criterion | PostgreSQL | MySQL | MongoDB |
|---|---|---|---|
| ACID integrity | Full, on every table, by default | Full only with the InnoDB engine | Multi-document transactions only since v4.0, with limits |
| Data types & JSON | Indexable JSONB + rich types (array, range) | Valid JSON, indirect indexing (generated columns) | Native BSON documents, no enforced schema |
| Full-text search | Built-in: tsvector, pg_trgm, multilingual stemming | Basic (InnoDB FTS) | Basic; the advanced one (Atlas Search) only in the commercial cloud |
| Licence / cost | PostgreSQL License — free, no commercial owner | GPL, owned by Oracle (commercial editions) | SSPL — no longer a classic open-source licence |
| Ecosystem | Strong extensions (PostGIS, pgvector), supported by every ORM | Ubiquitous in classic PHP/WordPress hosting | Strong on Node.js, narrower elsewhere |
| E-commerce fit | Excellent — orders, stock and payments guaranteed consistent | Good — the historical standard (Magento, WooCommerce) | For flexible catalogs; order consistency takes extra effort |
Frequently asked questions
Does PostgreSQL affect my website’s speed?
Not negatively. Public pages are served from Next.js with caching, and indexed PostgreSQL queries answer in milliseconds. At the size of a typical website or store, the database is never the bottleneck — the frontend and images matter far more for perceived speed.
Why not WordPress with MySQL, like everyone else?
WordPress is a PHP CMS with themes and plugins that need constant maintenance and updates. 4buildsite generates Next.js websites backed by PostgreSQL: faster, with no plugins to patch and fewer security holes. MySQL is not a bad choice — but PostgreSQL adds indexable JSONB, better full-text search and stricter integrity, under the same free licence.
What happens to my data if the server goes down?
PostgreSQL writes every change to the WAL journal first, so on restart the database rebuilds itself without corrupted data — an abrupt server crash does not corrupt your orders. On top of that, data lives on persistent volumes, separate from the application, so a platform restart or update never touches it.
Can I export my data if I leave 4buildsite?
Yes. Your data lives in PostgreSQL, an industry-standard format — products, orders and customers can be exported in common formats (CSV, SQL). There is no proprietary format locking you to the platform.
Can PostgreSQL keep up if my store grows?
Yes, with a very large margin. Instagram and Reddit scaled on PostgreSQL to hundreds of millions of users, using indexes, partitioning and read replicas — the same techniques available on 4buildsite. An online store hits PostgreSQL’s limits far later than its own logistics limits.
How much does the PostgreSQL licence cost?
Nothing. PostgreSQL has a free licence (the PostgreSQL License, BSD-style), with no per-server or per-core fees. On 4buildsite, the database is included in your plan, together with hosting and SSL — you pay nothing separate for it.