Friday, September 2, 2005

How Much Are Backpacks Ar Ross

. RDBMS - that is, performance and convenience vs. popularity and availability;)

the last few days I create an application that productivity is the key - whether it will work a few percent faster is of paramount importance. Therefore, I try to save everything - the amount of data (because it is a client-server application), the number of new threads created to handle requests, and of the time of an operation on the database.

admit that so far when it comes to database applications that I created them just based on relational databases (both in Java and in PHP). Some time ago I also started to use the frameworks the mapping O / R (JDO , Hibernate , Propel ). But I never thought that the application of these technologies may be inappropriate for any application. And yet ...

Today in creating web-applications are used almost exclusively relational databases (I do not know any PHP this site, which she used to something else). The reality, however, shows that in the case of databases, which sends a large number of queries that solution is not efficient, and even comfortable (!).

programming systems using object-oriented languages \u200b\u200bprorgamowania would like to use only the language and nothing more. Meanwhile, programming database applications using RDBMS must have regard to the structure of the database, to know how such a database is working, many worry about unnecessary things. The worst, however, is that this database does not store collections of objects and only the records that must be mapped to objects (or vice versa). Here come the tool with the help of O / R - JDO, Hibernate (Hibernate + Spring + Transactions) Propel - but let's see at what cost? The more intermediate layers, the lower yield App. I'll go one step further - and whether he is a powerful JDBC? After all, for each column in a JDBC query creates new objects - a large number of such operations could substantially ordered our application.

come here with the help of object-oriented database - a simple, efficient, easy to use, and above all 'object') Prevayler is one of the most ODBMS for Java. It assumes that all data from your application will be kept in RAM. Someone might say: "Well, then why even use the database since everything can to be in RAM. "Of course you can keep all objects in RAM, but their search can take a very long time (unless you write some sort of mechanism for its efficient, but it is in August passed with the objective;) application that uses the same Prevayler must therefore manage the creation of discharges database (backup in case of accident or restart the server). Moreover, one has to reckon with the fact that if the amount of data is very large it will take a lot of space in memory - and yet we do not have it in infinite quantities. Returning to the heart of the matter, namely Performance - if such a database is faster than the example database MySQL ? Odpowiedź może być zaskakująca - kilkaset-kilka tysięcy razy
szybsza (!). Zachęcam do zapoznania się z wynikami testów wydajnościowych na stronie projektu (czytając go trzeba mieć na względzie, że testy te dotyczą tylko prostych zapytań, nie ma np. porównania z testami na SQLu wykorzystującymi złączenia, procedury, widoki itp.).



Nieco "ulepszoną" wersją dla Prevayler jest db4objects - baza, która potrafi już bezpośrednio operować na plikach (oczywiście kosztem wydajności). Projekt ten posiada 2 licencje: GPL i komercyjną. Gorąco zachęcam to zapoznania with both technologies, because they really worth it. Sam, I wonder which one to choose - Probably for simple systems in which it is not so important "data security" (about the possibility of losing some data in the event) and the amount of data does not exceed a few dozen MB of RAM - I use Prevayler. In other db4objects situation may be a good solution.

the forum Java.net can read my thread on comparison of ODBMS and RDBMS.