技術

← Acasă
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.

Avantaje și limitări

Avantaje

  • 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.

Limitări

  • 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.

Verdict scurt

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.

Tabel de specificații

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

Întrebări frecvente

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
商業生態系統
4conta.ro
會計
4invoices.net
發票應用程式
4expenses.net
開支管理
4notify.net
通知提醒
4hosting.net
網站寄存
4database.net
資料庫
4buildsite.net
網站建構工具
4myapp.net
應用程式建構工具
4avatars.net
AI 虛擬人
4chaty.net
AI 聊天機械人
4webagency.net
網頁設計公司軟件
4softedu.net
教育網站
4softcrm.net
CRM 平台
4softerp.net
ERP 系統
4softhr.net
人力資源管理
4mystaff.net
員工入口
4myprojects.net
項目管理
4mycontracts.net
合約管理
4docs.net
文件管理
4appointments.net
預約管理
4marketingonline.net
市場推廣
4insurance.net
保險
4property.net
地產
4lawyers.net
法律軟件
4mygarage.net
汽車維修
4driving.net
駕駛學校
4fleet.net
車隊管理
4myevents.net
活動管理
4therapy.net
治療服務
4clinics.net
診所
4dental.net
牙科診所
4restaurants.net
餐廳
4beautify.net
美容院
4gym.net
健身中心
4guards.net
保安公司
4softvet.net
獸醫診所
4softauto.net
汽車業務軟件
4construct.net
建築公司
4marketplace.net
網上商貿平台
4shopy.net
網上商店
4pricing.net
價格比較
4salefood.net
外賣速遞
4rentify.net
租賃
4transports.net
運輸
4agencytravel.net
旅行社
4hotel.net
酒店管理
4ong.net
非牟利機構管理