Pebellslearn by building
0%
RoadmapsMatrixCoursesSandboxSign in
Introduction  ›  Capstone Project

PostgreSQL vs Other RDBMS

PostgreSQL vs Other RDBMS 12 minPostgreSQL is free, standards-strict and extensible, runs DDL in transactions, and serves each connection with its own process.

PostgreSQL vs Other RDBMS

Pedal's new investor asks why the team chose PostgreSQL rather than MySQL or SQL Server. "Everyone uses it" is not an answer a DBA should give. The honest answer lists what PostgreSQL does well, and what it makes you manage yourself.

The rule

PostgreSQL: free, strict, extensible, one process per connection.

Each word is a real difference from the other popular relational systems:

  • Free: released under the PostgreSQL Licence, a short permissive licence. No paid editions and no per-core fees, unlike Oracle or SQL Server.
  • Strict: it follows the SQL standard closely and rejects bad input instead of guessing. Inserting 'abc' into an integer column is an error, not a silent zero.
  • Extensible: you can add data types, functions, index types and whole features as extensions, such as PostGIS for maps or pgvector for embeddings.
  • One process per connection: every client connection gets its own operating-system process on the server. This is simple and robust, but each process costs memory, so thousands of idle connections hurt. Busy systems put a connection pooler such as PgBouncer in front.

PostgreSQL also runs DDL inside transactions. A migration that fails halfway can be rolled back completely:

BEGIN;
ALTER TABLE bikes ADD COLUMN battery_pct smallint;
ALTER TABLE rentals ADD COLUMN distance_km numeric(6,2);
ROLLBACK;  -- both changes vanish, the tables are untouched

In MySQL, most DDL statements commit on their own, so the first change would stay.

A quick map of the neighbours:

System Typical reason to pick it
MySQL / MariaDB Very common in web hosting, simple replication
SQL Server Deep ties to the Microsoft ecosystem
Oracle Large enterprises with existing contracts and tooling
SQLite Embedded in an app, no server at all

The shortcut

Turn the rule into four checks against any requirement: cost, correctness, features, connections.

Checking PostgreSQL against Pedal's needsStep 1 of 4
  1. Cost

    Pedal is small and wants no licence bill. PostgreSQL is free for any use.

The trap is treating SQLite as a small PostgreSQL. SQLite is a library inside one program with one writer at a time. It is superb on a phone, but it is not a shared server for many clients.

Drills

Answer fast — trust the rule.

quick drill

How does PostgreSQL handle each new client connection?

quick drill

A migration runs two ALTER TABLE statements inside BEGIN and the second fails. What happens in PostgreSQL?

quick drill

Which need points to SQLite rather than PostgreSQL?

quick drill

What is the usual fix when an app opens thousands of mostly idle connections to PostgreSQL?

Remember

  • PostgreSQL: free, strict, extensible, one process per connection.
  • Check any choice against cost, correctness, features and connections.
  • SQLite is an embedded library, not a small server; DDL in PostgreSQL can be rolled back.

Practice — level up

0/1 solved

Write your answer, then compare it with a rubric and a model answer.

ExplainAnswer the investor

An investor asks why Pedal chose PostgreSQL over MySQL, SQL Server or SQLite. Give an honest answer that covers at least two strengths and one thing PostgreSQL makes the team manage.