Following tests were using Synopse mORMot framework 1.18, compiled with Delphi XE4, against SQLite 3.8.4.3.
We won't show all database engine, but the most representative ones.
Please refer to this other benchmark
article for some more complete information.
Insertion speed
'MongoDB ack/no ack' for direct MongoDB access
(SynMongoDB.pas
) with or without write acknowledge.
For the testings, we used a local MongoDB 2.6 instance in 64 bit mode.
Direct | Batch | Trans | Batch Trans | |
SQLite3 (file full) | 466 | 437 | 81754 | 108752 |
SQLite3 (file off) | 2012 | 2044 | 84550 | 111731 |
SQLite3 (file off exc) | 25079 | 28192 | 83943 | 115159 |
SQLite3 (mem) | 69961 | 94871 | 87279 | 118657 |
TObjectList (static) | 232385 | 400608 | 252678 | 402803 |
TObjectList (virtual) | 242812 | 409131 | 240003 | 405712 |
SQLite3 (ext full) | 490 | 11918 | 87556 | 151144 |
SQLite3 (ext off) | 2141 | 47266 | 89249 | 160616 |
SQLite3 (ext off exc) | 33199 | 145471 | 90025 | 158815 |
SQLite3 (ext mem) | 76411 | 184706 | 89834 | 192618 |
MongoDB (ack) | 10081 | 84585 | 9800 | 85232 |
MongoDB (no ack) | 33223 | 189186 | 27974 | 206355 |
ZEOS SQlite3 | 474 | 11917 | 36740 | 55767 |
FireDAC SQlite3 | 20735 | 40083 | 40408 | 121359 |
ZEOS Firebird | 10056 | 10155 | 18769 | 20335 |
FireDAC Firebird | 19742 | 48684 | 19904 | 47803 |
MSSQL2012 local | 3470 | 35510 | 10750 | 47653 |
ODBC MSSQL2012 | 3659 | 6252 | 5537 | 6290 |
FireDAC MSSQL2012 | 3276 | 5838 | 9540 | 40040 |
ZEOS PostgreSQL | 2953 | 23740 | 6913 | 29780 |
ODBC PostgreSQL | 2902 | 25040 | 3576 | 28714 |
FireDAC PostgreSQL | 3054 | 23329 | 7149 | 24844 |
MongoDB bulk insertion has been implemented, which shows an amazing
speed increase in Batch mode. Depending on the MongoDB write concern
mode, insertion speed can be very high: by default, every write process will be
acknowledge by the server, but you can by-pass this request if you set the
wcUnacknowledged
mode - note that in this case, any error (e.g. an
unique field duplicated value) will never be notified, so it should not be used
in production, unless you need this feature to quickly populate a database, or
consolidate some data as fast as possible.
Read speed
The same records are now read, either one by one, either as a list:
By one | All Virtual | All Direct | |
SQLite3 (file full) | 21607 | 455083 | 458757 |
SQLite3 (file off) | 22177 | 456454 | 458001 |
SQLite3 (file off exc) | 98014 | 454215 | 457540 |
SQLite3 (mem) | 99190 | 461808 | 464252 |
TObjectList (static) | 235504 | 756773 | 750300 |
TObjectList (virtual) | 233666 | 332402 | 733460 |
SQLite3 (ext full) | 103917 | 210863 | 458379 |
SQLite3 (ext off) | 101498 | 209634 | 441033 |
SQLite3 (ext off exc) | 101839 | 218292 | 439947 |
SQLite3 (ext mem) | 102414 | 185494 | 438904 |
MongoDB (ack) | 8002 | 242353 | 251268 |
MongoDB (no ack) | 8234 | 252079 | 254582 |
ZEOS SQlite3 | 31135 | 173593 | 263060 |
FireDAC SQlite3 | 6318 | 67169 | 92291 |
ZEOS Firebird | 12076 | 67853 | 85828 |
FireDAC Firebird | 1918 | 37113 | 44894 |
MSSQL2012 local | 7904 | 182401 | 349797 |
ODBC MSSQL2012 | 8693 | 113973 | 178526 |
FireDAC MSSQL2012 | 3054 | 63730 | 86051 |
ZEOS PostgreSQL | 7031 | 122327 | 176298 |
ODBC PostgreSQL | 7281 | 66843 | 91489 |
FireDAC PostgreSQL | 1644 | 45184 | 61252 |
MongoDB appears as a serious competitor to SQL databases, with the potential benefit of horizontal scaling and installation/administration ease - performance is very high, and its document-based storage fits perfectly with mORMot's advanced ORM features like Shared nothing architecture (or sharding).
You can get more information about low-level integration of
MongoDB in mORMot, or our integrated ORM/ODM support in the
framework.
Feedback is welcome
on our forum, as usual!