Who Is the World's Most Successful Database? An In‑Depth Technical Comparison of PostgreSQL and MySQL
The article evaluates database success by comparing PostgreSQL and MySQL across popularity, features, licensing, transaction behavior, MVCC, concurrency models, and use cases, showing PostgreSQL leads in complex queries and feature richness while MySQL remains the most widely used OLTP system, especially in China.
According to the 2023 StackOverflow Technology Survey, PostgreSQL has overtaken MySQL to become the most popular database among professional developers (about 50% of respondents), while beginners still favor MySQL (about 54%).
The article examines what "success" means for a database—popularity, technical features, application domains, and user preference—and uses the DB‑Engines ranking methodology to evaluate databases. The ranking considers website mentions (Google and Bing), search interest (Google Trends), technical discussion frequency (Stack Overflow and DBA Stack Exchange), job postings (Indeed, Simply Hired), LinkedIn profiles, and Twitter mentions. Scores are normalized and averaged to produce a relative popularity index.
While Oracle tops the DB‑Engines list, it is a commercial product whose market share in China is expected to shrink. MySQL ranks second, with a score roughly twice that of PostgreSQL, making it the most widely used database today.
The article also discusses the trade‑offs between distributed and centralized databases, citing examples such as Tencent Cloud's TDSQL (compatible with MySQL) and the need for distributed solutions in massive data‑volume scenarios.
Transaction behavior example:
BEGIN; INSERT INTO t VALUES (1,...); INSERT INTO t VALUES (1,...); -- primary‑key conflict, error COMMIT; SELECT * FROM t; -- returns the first row
This demonstrates that in MySQL (and also Oracle, SQL Server) a COMMIT after a failed statement still persists the successful inserts, whereas PostgreSQL rolls back the entire transaction. The article clarifies that this is a configurable feature, not a bug.
The licensing differences are highlighted: PostgreSQL uses a permissive PostgreSQL License (similar to MIT), while MySQL is released under GPLv2, which requires derivative works to be open‑source.
On MVCC implementation, PostgreSQL stores both historic and current tuples in the heap and relies on the vacuum process to clean up dead rows. MySQL and Oracle use undo segments to keep old versions, allowing in‑place updates.
Regarding concurrency models, PostgreSQL adopts a multi‑process architecture, offering stability and memory isolation at the cost of higher resource usage and context‑switch overhead. MySQL uses a multi‑thread model, providing better resource efficiency and high concurrency but with potential stability risks if a thread fails.
The article also compares heap tables (PostgreSQL) with index‑organized tables (MySQL), outlining their respective advantages and disadvantages in terms of query speed, space utilization, and maintenance complexity.
In summary, PostgreSQL excels in complex query performance and feature richness, while MySQL dominates in OLTP workloads, popularity, and operational simplicity. The piece concludes with observations about the Chinese market, mentioning TXSQL (Tencent Cloud) and OceanBase as MySQL‑compatible solutions used in large‑scale financial systems.
Finally, readers are invited to comment on which database they consider the most successful, with a chance to win a custom tote bag.
Tencent Cloud Developer
Official Tencent Cloud community account that brings together developers, shares practical tech insights, and fosters an influential tech exchange community.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.