Visualizzazione degli ultimi post con etichetta mysql. Mostra i post precedenti
Visualizzazione degli ultimi post con etichetta mysql. Mostra i post precedenti

giovedì 25 settembre 2008

MySQL - CouchDB performance comparison

Here you are with the results of our benchmarks!


mercoledì 24 settembre 2008

Yesterday... and plans for today

Yesterday we completed two user stories of our project in java using couchdb4j:

- add a custom field and be able to see it in listings;
- find records by a specific field.

Then we switched to a more difficult task: evaluate the performance differences between CouchDB and MySQL. It's a difficult task because the two databases are logically very different, and it's not easy to find the common operations to test and compare.

In example, the "find" operation in MySQL can be done with a query; it can be a compiled query or an interpreted one.
In CouchDB we need to create a view function and execute it; we can have "named" views - that resemble the MySQL compiled queries - and temporary views, that are executed on demand.

In the CouchDB Futon utility - the web application builtin with CouchDB - it is possible to run a suite of tests and see their execution time.
Editing the file /usr/local/share/couchdb/www/script/couch_tests.js it is possible to modify the default tests or to add new ones, so we quickly wrote a new javascript function to check the execution time of a named view.

Our results were really poor for the first access, when the view is created - around 1 second to create a view on a single field, for a database with only 5000 records; after the view was created, access times were much slower, in the range of 5 to 15 ms.

I don't know if this problem is related to any error we made in the test-writing process, but I'm pretty sure I can exclude this; maybe there is another way to iprove performances of the standard javascript view server, I'll try to find out today. Otherwise, we'll have to change our project, because such a poor performance would make CouchDB not usable in any productive environment.

Keep in touch! Andrea