in reply to General question (speed, disk access etc)

Let me see. You lack basic knowledge about filesystem access times, yet you think that you are in a position to reinvent a basic wheel. And you are confident enough in your ability that you expect to have "quite high traffic".

There is a fairly obvious disconnect here.

If you're just dealing with 100 ads, it doesn't much matter what you do since the operating system is going to keep everything in filesystem cache.

If you have enough ads to blow the cache, reading 100 ads means 100 disk seeks, and disk seeks are expensive enough that this would take a full half second.

If you have not blown your cache and you need to only read 10% of the ads, keeping them in one file means you're always reading 90% of the ads unnecessarily.

Of course you are far from the first to face this problem. Even if you want to stay away from a regular database, BerkeleyDB gives you a choice of efficient solutions.

  • Comment on Re: General question (speed, disk access etc)