I'm going to go with Bolt on this. Go for a database approach.
You DON'T want to get into programming against text files if you are doing web development. That would be better left to the C programmers. (Well, other languages can do the same, but C is just well known...)
Data access against text files is slow. VERY SLOW. Databases are meant for fast access to information.
You cannot program in a web language for speed. Web languages are slow. For a commercial application, you need something more. It can be done on the web, but not in a 'web language'.