in reply to Member profiles - file or db?

Databases have several advantages over files when it comes to storing and retrieving data. The principal buzzwords would be effecient, faster, scalable, maintainable, portable and so on.

Two reasons to consider _not_ using a file as a 'database' at all. There are other more compelling reasons, but these two really do matter.

1. A file stores its records sequentially, so the bigger the file gets, average transaction times increase linearily. Databases use an array of methods to leverage non-sequential random access, a much quicker and independant average transaction time is guaranteed, also growth of databases do not directly affect lookup times.

2. No implicit locking is done over individual records so you will have to explicitly lock the entire file before data manipulation or you potentially risk ending up with corrupt/incorrect data as a result of 2 or more simultaneous transactions. Locking an entire file means that during a long transaction, a queue of other transactions can build up and programming around this needs to be done carefully otherwise you end up with pissed-off customers, program deadlocks, crashes, data corruption, grey-hair, etc. It also gets worse as the size of the file grows. Databases on the other hand can lock individual records and most databses allow some simultaneous transactions, they multi-task and handle requests well, so already it's one big monkey off your back.

Files make bad busy databases, no buts at all. If you expect to have a backend that caters to more than a request per second, and you want quick, consistent lookup times, now or in the future, it would make sense to start off using a professional database now. You also avoid the big headache of having to migrate data over from the file to database later on, which you are bound to do eventually anyway. Databases might be complex and require a lot more work before the wheels start moving but they are the foundation(s) to both your technological (programming) and business models, so it makes sense to get them sorted out first and sorted out right as well.