<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
	<title>CppCMS Blog :: Storage</title>
	<link>http://art-blog.no-ip.info/cppcms/blog</link>
	<description>A blog on CppCMS - C++ Web Development Framework</description>
	<atom:link 
		href="http://art-blog.no-ip.info/cppcms/blog/rss" 
		rel="self" type="application/rss+xml" />
	
		
		<item>
			<title>Session Management in CppCMS</title>
			<link>http://art-blog.no-ip.info/cppcms/blog/post/33</link>
			<guid>http://art-blog.no-ip.info/cppcms/blog/post/33</guid>
			<description>
			&lt;div style=&quot;direction:ltr&quot;&gt;
			&lt;p&gt;Session management branch was merged to trunk, now you can use sessions transparently in CppCMS.&lt;/p&gt;

&lt;p&gt;Quite full tutorial about sessions in CppCMS was written:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://art-blog.no-ip.info/wikipp/en/page/tut_sessions&quot;&gt;Starting With Sessions&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://art-blog.no-ip.info/newpress/blog/post/193&quot;&gt;Management Sessions with CppCMS&lt;/a&gt; (Hebrew) was published as well.&lt;/li&gt;
&lt;/ul&gt;


			&lt;p&gt;
			&lt;a href="/cppcms/blog/post/33"&gt;more...&lt;/a&gt;
			&lt;/p&gt;
			&lt;/div&gt;
			</description>
		</item>
		
		<item>
			<title>DbiXX Documentation</title>
			<link>http://art-blog.no-ip.info/cppcms/blog/post/32</link>
			<guid>http://art-blog.no-ip.info/cppcms/blog/post/32</guid>
			<description>
			&lt;div style=&quot;direction:ltr&quot;&gt;
			&lt;p&gt;DbiXX SQL Library documentation is completed. It can be found in the wiki:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://art-blog.no-ip.info/wikipp/en/page/ref_dbixx&quot;&gt;http://art-blog.no-ip.info/wikipp/en/page/ref_dbixx&lt;/a&gt;&lt;/p&gt;

			&lt;p&gt;
			&lt;a href="/cppcms/blog/post/32"&gt;more...&lt;/a&gt;
			&lt;/p&gt;
			&lt;/div&gt;
			</description>
		</item>
		
		<item>
			<title>The Roadmap to The First Beta Version of CppCMS</title>
			<link>http://art-blog.no-ip.info/cppcms/blog/post/15</link>
			<guid>http://art-blog.no-ip.info/cppcms/blog/post/15</guid>
			<description>
			&lt;div style=&quot;direction:ltr&quot;&gt;
			&lt;p&gt;After quite a long period of development I had decided to get prepared to first public beta release of CppCMS.&lt;/p&gt;

&lt;p&gt;The major components of this blog and the framework I want to introduce in first beta are following:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Implementation of Django style templates inheritance, filters (done 70%)&lt;/li&gt;
&lt;li&gt;Introduce powerful cache system (done 100%)&lt;/li&gt;
&lt;li&gt;Replace &lt;a href=&quot;http://soci.sourceforge.net&quot;&gt;SOCI&lt;/a&gt; by &lt;a href=&quot;http://libdbi.sourceforge.net&quot;&gt;LibDBI&lt;/a&gt; (done 100%)&lt;/li&gt;
&lt;li&gt;Improve blog: true markdown, LaTeX equations, categories etc. (done 100%)&lt;/li&gt;
&lt;li&gt;Write Documentation (done 20%)&lt;/li&gt;
&lt;li&gt;Migrate my Hebrew blog from Word Press to CppCMS (done 100%)&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;There are lots of work to do, but CppCMS now looks much mature then before.&lt;/p&gt;

			&lt;p&gt;
			&lt;a href="/cppcms/blog/post/15"&gt;more...&lt;/a&gt;
			&lt;/p&gt;
			&lt;/div&gt;
			</description>
		</item>
		
		<item>
			<title>SOCI or DBI, stage 2</title>
			<link>http://art-blog.no-ip.info/cppcms/blog/post/13</link>
			<guid>http://art-blog.no-ip.info/cppcms/blog/post/13</guid>
			<description>
			&lt;div style=&quot;direction:ltr&quot;&gt;
			&lt;p&gt;Discussing soci &lt;a href=&quot;http://sourceforge.net/mailarchive/forum.php?forum_name=soci-users&quot;&gt;performance&lt;/a&gt; with its developers I had found that soci is compiled without any optimizations by default.&lt;/p&gt;

&lt;p&gt;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 &amp;ndash; pages per second (no gzip):&lt;/p&gt;

&lt;pre name=&quot;code&quot; class=&quot;cpp&quot; &gt;DB        soci dbixx
--------------------
MySQL      710   800
Sqlite3    550   410
PgSQL      385   430
&lt;/pre&gt;

&lt;p&gt;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%).&lt;/p&gt;

&lt;p&gt;So it seems to me that both solutions are quite reasonable to use without clear advantage of
one over another.&lt;/p&gt;

			&lt;p&gt;
			&lt;a href="/cppcms/blog/post/13"&gt;more...&lt;/a&gt;
			&lt;/p&gt;
			&lt;/div&gt;
			</description>
		</item>
		
		<item>
			<title>SOCI or DBI</title>
			<link>http://art-blog.no-ip.info/cppcms/blog/post/12</link>
			<guid>http://art-blog.no-ip.info/cppcms/blog/post/12</guid>
			<description>
			&lt;div style=&quot;direction:ltr&quot;&gt;
			&lt;p&gt;One of the problematic issues in writing cross-SQL code is an API that differs from
one SQL to another.&lt;/p&gt;

&lt;p&gt;There are two open source libraries that provide unified API&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;a href=&quot;http://soci.sourceforge.net&quot;&gt;soci&lt;/a&gt; &amp;ndash; C++ library.&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://libdbi.sourceforge.net&quot;&gt;dbi&lt;/a&gt; &amp;ndash; C library.&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;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 &lt;a href=&quot;http://art-blog.no-ip.info/cppcms/blog/post/11&quot;&gt;20% performance&lt;/a&gt; reduction for MySQL
database. But I also remembered that there should be &lt;a href=&quot;http://art-blog.no-ip.info/cppcms/blog/post/8&quot;&gt;negligible difference&lt;/a&gt; between MySQL and Berkeley DB.
This was mostly due to incorrect design of my BDB database layout I had done.&lt;/p&gt;

&lt;p&gt;That had seem to be strange and I stared benchmarking the system more and more.&lt;/p&gt;

			&lt;p&gt;
			&lt;a href="/cppcms/blog/post/12"&gt;more...&lt;/a&gt;
			&lt;/p&gt;
			&lt;/div&gt;
			</description>
		</item>
		
		<item>
			<title>The Cost of SQL - First Measurements</title>
			<link>http://art-blog.no-ip.info/cppcms/blog/post/11</link>
			<guid>http://art-blog.no-ip.info/cppcms/blog/post/11</guid>
			<description>
			&lt;div style=&quot;direction:ltr&quot;&gt;
			&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;The settings and the database is the same that is used in this &lt;a href=&quot;http://art-blog.no-ip.info/cppcms/blog/post/4&quot;&gt;article&lt;/a&gt;.&lt;/p&gt;

&lt;pre name=&quot;code&quot; class=&quot;cpp&quot; &gt;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%
&lt;/pre&gt;

&lt;p&gt;We can see:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;There is not negligible cost of using SQL Data Bases. However the price is not too high with fast data bases like MySQL.&lt;/li&gt;
&lt;li&gt;PostgreSQL had badly surprised me with its real performance. Maybe I'm doing something wrong?&lt;/li&gt;
&lt;/ol&gt;


			&lt;p&gt;
			&lt;a href="/cppcms/blog/post/11"&gt;more...&lt;/a&gt;
			&lt;/p&gt;
			&lt;/div&gt;
			</description>
		</item>
		
		<item>
			<title>Berkeley DB Out, MySQL In...</title>
			<link>http://art-blog.no-ip.info/cppcms/blog/post/10</link>
			<guid>http://art-blog.no-ip.info/cppcms/blog/post/10</guid>
			<description>
			&lt;div style=&quot;direction:ltr&quot;&gt;
			&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;I had choosen &lt;a href=&quot;http://soci.sourceforge.net&quot;&gt;soci&lt;/a&gt; library as a backend that provides a universal C++ driver that gives access to all popular data bases:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;MySQL&lt;/li&gt;
&lt;li&gt;PostgreSQL&lt;/li&gt;
&lt;li&gt;Sqlite3&lt;/li&gt;
&lt;li&gt;Firebird&lt;/li&gt;
&lt;li&gt;Oracle&lt;/li&gt;
&lt;li&gt;MS SQL via odbc.&lt;/li&gt;
&lt;/ol&gt;


&lt;h3&gt; About SOCI&lt;/h3&gt;

&lt;p&gt;I had used latest CVS version of this library that goes towards &quot;boostification&quot;. 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.&lt;/p&gt;

			&lt;p&gt;
			&lt;a href="/cppcms/blog/post/10"&gt;more...&lt;/a&gt;
			&lt;/p&gt;
			&lt;/div&gt;
			</description>
		</item>
		
		<item>
			<title>BDB or not BDB - that is the question...</title>
			<link>http://art-blog.no-ip.info/cppcms/blog/post/8</link>
			<guid>http://art-blog.no-ip.info/cppcms/blog/post/8</guid>
			<description>
			&lt;div style=&quot;direction:ltr&quot;&gt;
			&lt;p&gt;At the beginning of the project I had several options for president storage for CppCMS:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Use standard SQL databases like MySQL, PostgreSQL.&lt;/li&gt;
&lt;li&gt;Use embedded SQL data base like Sqlite3&lt;/li&gt;
&lt;li&gt;Use Berkeley DB&lt;/li&gt;
&lt;li&gt;Implement my own storage model.&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;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: &quot;what data storage to use?&quot;&lt;/p&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;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.&lt;/p&gt;

			&lt;p&gt;
			&lt;a href="/cppcms/blog/post/8"&gt;more...&lt;/a&gt;
			&lt;/p&gt;
			&lt;/div&gt;
			</description>
		</item>
		
		<item>
			<title>Understanding Berkeley DB</title>
			<link>http://art-blog.no-ip.info/cppcms/blog/post/5</link>
			<guid>http://art-blog.no-ip.info/cppcms/blog/post/5</guid>
			<description>
			&lt;div style=&quot;direction:ltr&quot;&gt;
			&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;So why had I chosen to use Berkeley DB instead of many other data bases that most of web technologies work with?&lt;/p&gt;

&lt;p&gt;There are several reasons:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Outstanding performance.&lt;/li&gt;
&lt;li&gt;Direct C++ API instead of SQL one.&lt;/li&gt;
&lt;li&gt;It is as mature as any other databases.&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;In order to understand the advantages of Berkeley DB over standard SQL data bases we need to understand the architectures of typical DB. &lt;/p&gt;

			&lt;p&gt;
			&lt;a href="/cppcms/blog/post/5"&gt;more...&lt;/a&gt;
			&lt;/p&gt;
			&lt;/div&gt;
			</description>
		</item>
		
	
</channel>
</rss>
