Posts in category ‘Berkeley DB’.
One of the problematic issues in writing cross-SQL code is an API that differs from one SQL to another.
There are two open source libraries that provide unified API
At the first point I had chosen soci as native solution of C++ programmer. After running some benchmarks on the new version of this blog I had found 20% performance reduction for MySQL database. But I also remembered that there should be negligible difference between MySQL and Berkeley DB. This was mostly due to incorrect design of my BDB database layout I had done.
That had seem to be strange and I stared benchmarking the system more and more.more...
There are the preliminary benchmarks comparing different DB backends. I've measured pages per second ratio for fetching different pages from the blog that includes 5,000 articles and 50,000 comments to them. The client and the server had run on the same PC.
The settings and the database is the same that is used in this article.
Backend gzip no-gzip gzip no-gzip % ------------------------------------------------ Berkeley DB 565 830 N/A N/A MySQL InnoDB 475 645 -16% -22% Sqlite3 410 515 -27% -38% PostgreSQL 305 360 -46% -57%
We can see:
- There is not negligible cost of using SQL Data Bases. However the price is not too high with fast data bases like MySQL.
- PostgreSQL had badly surprised me with its real performance. Maybe I'm doing something wrong?
After long period of tests and thoughts I had finally decided to move from Berkeley DB to traditional data base that is used for web development.
I had choosen soci library as a backend that provides a universal C++ driver that gives access to all popular data bases:
- MS SQL via odbc.
I had used latest CVS version of this library that goes towards "boostification". I had implemented several patches to this library in order make it more useful for this project. I had send them to developers and they are waiting to be merged to CVS tree.more...
At the beginning of the project I had several options for president storage for CppCMS:
- Use standard SQL databases like MySQL, PostgreSQL.
- Use embedded SQL data base like Sqlite3
- Use Berkeley DB
- Implement my own storage model.
At the beginning I wanted to use MySQL. At certain point I decided to switch to Berkeley DB, and now I come back to the original question: "what data storage to use?"
In order to make a proper design I had run lots of micro benchmarks and finally I had chosen Berkeley DB. However I never used queries from real DB. And now, when I had implemented a simple blog I decided to run benchmarks on the situation that is closer to real one.
I had reimplemented an operation of fetching single post using MySQL and imported the database that included 5000 articles with 10 comments each one and tested.more...
There are many high quality, high performance, both open and closed source data bases available on the market: MySQL, PostgreSQL, Firebird, Sqlite, Oracle, MS SQL etc. These are industry standard SQL databases that usually power many web sites. The well known LAMP stack is de-facto standard for the web hosting companies.
So why had I chosen to use Berkeley DB instead of many other data bases that most of web technologies work with?
There are several reasons:
- Outstanding performance.
- Direct C++ API instead of SQL one.
- It is as mature as any other databases.
In order to understand the advantages of Berkeley DB over standard SQL data bases we need to understand the architectures of typical DB.more...