Technologies

← Home
Data & storage

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

CapabilityLimit / thresholdTypical use
Transactional integrityFull ACID + MVCC, on every tableVery long transactions hold resourcesOrders, payments, stock
JSONBNative JSON, GIN-indexableVery complex JSON queries are slower than classic columnsPage content, settings, product attributes
Full-text searchtsvector + pg_trgm, multilingual (Romanian included)Relevance below dedicated search enginesStore catalog search
Backup & replicationWAL, PITR, streaming replicationAutomatic failover needs external tooling (e.g. Patroni)Incident recovery, high availability
ScalingRead replicas, table partitioningWrites stay on the primary nodeLarge catalogs and order histories
CostOpen-source, free licenceThe real cost is infrastructure and administrationIncluded in 4buildsite plans

PostgreSQL vs MySQL vs MongoDB

CriterionPostgreSQLMySQLMongoDB
ACID integrityFull, on every table, by defaultFull only with the InnoDB engineMulti-document transactions only since v4.0, with limits
Data types & JSONIndexable JSONB + rich types (array, range)Valid JSON, indirect indexing (generated columns)Native BSON documents, no enforced schema
Full-text searchBuilt-in: tsvector, pg_trgm, multilingual stemmingBasic (InnoDB FTS)Basic; the advanced one (Atlas Search) only in the commercial cloud
Licence / costPostgreSQL License — free, no commercial ownerGPL, owned by Oracle (commercial editions)SSPL — no longer a classic open-source licence
EcosystemStrong extensions (PostGIS, pgvector), supported by every ORMUbiquitous in classic PHP/WordPress hostingStrong on Node.js, narrower elsewhere
E-commerce fitExcellent — orders, stock and payments guaranteed consistentGood — 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.

4b2b.net
Business Ecosystem
4conta.ro
Accounting
4invoices.net
Invoicing App
4expenses.net
Expense Management
4notify.net
Notifications
4hosting.net
Hosting
4database.net
Databases
4buildsite.net
Website Builder
4myapp.net
App Builder
4avatars.net
AI Avatars
4chaty.net
AI Chatbot
4webagency.net
Web Agency Software
4softedu.net
Education Websites
4softcrm.net
CRM Platform
4softerp.net
ERP System
4softhr.net
HR Management
4mystaff.net
Staff Portal
4myprojects.net
Project Manager
4mycontracts.net
Contracts
4docs.net
Document Management
4appointments.net
Appointments
4marketingonline.net
Marketing
4insurance.net
Insurance
4property.net
Real Estate
4lawyers.net
Legal Software
4mygarage.net
Auto Service
4driving.net
Driving Schools
4fleet.net
Fleet Management
4myevents.net
Events
4therapy.net
Therapy
4clinics.net
Clinics
4dental.net
Dental Practices
4restaurants.net
Restaurants
4beautify.net
Beauty Salon
4gym.net
Fitness Gyms
4guards.net
Security Companies
4softvet.net
Veterinary Clinics
4softauto.net
Automotive Business Software
4construct.net
Construction Companies
4marketplace.net
Marketplace
4shopy.net
Online Store
4pricing.net
Price Comparison
4salefood.net
Food Delivery
4rentify.net
Rentals
4transports.net
Transport
4agencytravel.net
Travel Agency
4hotel.net
Hotel Management
4ong.net
NGO Management