Tutorial :How to speed up Flat File Database in PHP?



Question:

I noticed that ffdb in PHP are awfully slow. So how would I go about speeding up the ffdb without SQL?


Solution:1

Flat file will become more slow the more data it's contain. This is because in order to get a data, the engine need to get all data first into memory, then select the requested data.

SQL database have random seek feature, because the data placement is in a known location, plus it have index table. That's why any SQL database is not affected with the number of data stored in it.

You can try sqlite if you need single file database. Firefox and Thunderbird use sqlite to store bookmark and browsing history.


Solution:2

Tokyo Cabinet is amazingly fast for key/value lookups. There is also the search addition (tyrant) that allows for more complex queries

http://1978th.net/tokyocabinet/ PHP implementation http://code.google.com/p/phptyrant/


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »