Posts in category ‘Storage’.
The Roadmap to The First Beta Version of CppCMS
After quite a long period of development I had decided to get prepared to first public beta release of CppCMS.
The major components of this blog and the framework I want to introduce in first beta are following:
- Implementation of Django style templates inheritance, filters (done 70%)
- Introduce powerful cache system (done 100%)
- Replace SOCI by LibDBI (done 100%)
- Improve blog: true markdown, LaTeX equations, categories etc. (done 100%)
- Write Documentation (done 20%)
- Migrate my Hebrew blog from Word Press to CppCMS (done 100%)
There are lots of work to do, but CppCMS now looks much mature then before.
more...SOCI or DBI, stage 2
Discussing soci performance with its developers I had found that soci is compiled without any optimizations by default.
So, after recompiling soci with -O2 option I've got much better results. Simple comparison of dbixx and soci had given very close result. I had run my tests once more and got following results – pages per second (no gzip):
DB soci dbixx
--------------------
MySQL 710 800
Sqlite3 550 410
PgSQL 385 430
We can clearly see that for MySQL and PostgreSQL dbixx is still faster in about 10% however in case of Sqlite3 dbixx is significantly slower (25%).
So it seems to me that both solutions are quite reasonable to use without clear advantage of one over another.
SOCI or DBI
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...The Cost of SQL - First Measurements
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?
Berkeley DB Out, MySQL In...
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:
- MySQL
- PostgreSQL
- Sqlite3
- Firebird
- Oracle
- MS SQL via odbc.
About SOCI
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...