When comparing Postgres vs SQLite, the Slant community recommends Postgres for most people. In the question“What are the best ACID-compliant scalable databases?” Postgres is ranked 1st while SQLite is ranked 2nd. The most important reason people chose Postgres is:
Built by passionate developers, available for free, and is well supported by its active community.
Specs
Ranked in these QuestionsQuestion Ranking
Pros
Pro Open Source
Built by passionate developers, available for free, and is well supported by its active community.
Pro Supports migration from other major proprietary and open source databases
With the extensive SQL support and migration tools, Postgres users are easily able to migrate their databases over to the Postgres database with little effort.
Pro JSON support
JSON support allows for Postgres to transfer data as raw text and without attributes and markup overhead. This will result in new levels of speed, efficiency and flexibility for developers.
Pro Highly scalable
Continues to work well under low or heavy loads in order to meet the users' need.
Pro Object-Oriented Database
You can reuse existing approved design table and extend its capability by inheritance. You can reuse ancestor method byy declaring new trigger for descendant but reuse ancestor trigger procedure. You can add, remove or override column constraint making it differ from its ancestor. Applying OOP with database design help me reuse, extend, and encapsulate business logic and end up a rapid design, and less errants. PostgreSQL is a powerful RDBMS while its OOP is sufficient for OOP modular design. Especially its Open Source ,and free.
Pro True ACID-compliance
Built in, so users won't have to worry about atomicity, consistency, isolation and the durability of the database.
Pro Multi-Version Concurrency Control (MVCC)
Postgres uses MVCC. For each user connected to the database the Postgres database shows a snapshot of the database at a particular instance. When the database needs to update an item it will add the newer version and mark the old version as obsolete. This allows the database to save overhead but requires a regulated sweep to delete the old, obsolete data.
Pro Multiple Language Interfaces
"There are interfaces for Java (JDBC), ODBC, Perl, Python, Ruby, C, C++, PHP, Lisp, Scheme, and Qt just to name a few."
Pro Great query planner
Unlike MySQL, you generally don't spend time on hinting the query planner in order to make PostGres perform well.
Pro RETURNING option on INSERT queries
For example:
INSERT INTO table (field_1, field_2, field_3) VALUES (value_1, value_2, value_3) RETURNING id;
Pro Small
SQLite is also only 350KiB in size.
Pro Great language support
SQLite has bindings for a large number of programming languages, including BASIC, Delphi, C, C#, C++, Clipper//Harbour, Common Lisp, Curl, D, Free Pascal, Haskell, Java, JavaScript, Livecode, Lua, newLisp, Objective-C (on OS X and iOS), OCaml, Perl, PHP, Pike, PureBasic, Python, R, REALbasic, REBOL, Ruby, Scheme, Smalltalk, Tcl, Visual Basic.
Pro Self-contained
SQLite is largely self-contained. It requires very minimal support from external libraries or from the operating system.
Pro Portable
An SQLite database is a single ordinary disk file that can be located anywhere in the directory hierarchy. It works by sending requests to a single file where all the data is kept instead of communicating with a hosted database which gives access to an interface by making use of sockets and ports. The file format used is also cross-platform, so can easily be migrated to various machines.
This makes SQLite extremely portable throughout different applications, all that's needed to transfer the whole database is to make a copy of the file.
Pro Great for testing and first stages of development
Because of it's ability to scale and with the portability that a single-file database gives you without losing much of the power and features that SQL gives developers, it's a great choice for testing applications and for the early stages of development when the workload and the data that needs to be stored is not that large.
Pro Not unnecessarily fiddly
Pro Reliable
With less complication, there is less to go wrong.
Pro Zero configuration
There is literally no configuration required to get SQL lite up and running. This is mainly due to SQLite being serverless, there is no separate server process to install, setup, configure, initialize, manage, and troubleshoot.
Cons
Con Overkill for simple setups
If a database will be doing many simple operations Postgres may be over-kill.
Con Vaccuuming can cause headaches
Con Can't be run as an embedded database
Con No multi user
Lacks multi-user capabilities, see SQLite vs. MySQL vs. PostgreSQL: A Comparison of Relational Databases.
Also see: Appropriate Uses For SQLite.
Con Some SQL features are missing
SQLite is made to be extremely lightweight and portable, but it still uses SQL. However, some SQL features such as RIGHT OUTER JOIN
and FOR EACH STATEMENT
are missing.