views:

39

answers:

1

Is it feasible to store data for a web application inside the program itself, e.g. as a large dictionary? The data would mostly be just a few hundred short-ish text blocks (roughly blog post size), and it will not be altered/added to at all by the users (although I would want to be able to update it myself every so often).

Up until now I've been looking at standard database storage solutions, but since (for this set of objects at least) they will not be modified, is it possible simply to store them as a dictionary? Or are there serious downsides I have not considered?

Thanks.

+2  A: 

It is certainly possible. The amount of data you can store will be limited mostly by memory available.

If you are planning to perform database-like operations on the data then you are better off with an in-memory database like SQLite. If the data is picked up from a database and hashed then you might want to use Memcached. If you are limiting yourself to plain text and the data won't grow then you can stick to memory.

The approach will start losing its charm if the data will grow in the future. In that case you are better off with other solutions.

Manoj Govindan