缓存每小时更新一次 - 存储位置?

I have a python script that generates data(every hour), to be later read by a PHP web page. Where should I store the data - in a database, in a file, or somewhere else? There will be something close to 100-200KB/user of data. Which will be a beter solution? The data is not plain text, which means I'll have to use json or xml to store it.

Example data:(XML is easy to read, don't blame me!)

    <item uid="1">
<title>Malala's voice stronger, not silenced</title>
<rating>3</rating>
<date>Wednesday, May 8, 2013 2:03 PM</date>
<text>The attack was meant to silence the outspoken teenager who dared to defy the Taliban's ban against girls in school. Instead, it only made Malala's voice more powerful. After a school year that started with a shooting, Malala now eyes a summer of speaking at the U.N., telling her story in a new book and amplifying the issue of girls education.    </text>
</item>

Generally querying a database is expensive and if you eventually scale your application you will get problems as every time you need to read the data you also need to query the database. Which will cause reading the data to fail.

There is a technique to avoid this. It's called memcache. A good intro to memcache can be found at the Udacity course it's lesson 6. There was also another post at stackoverflow which explained how they successfully shared the memcache with the languages python and php.

I think it depends on the scale of your web application. If it's going to be fairly small and not grow that big over time, the file system would be fine. It's a great option because it's so simple. Very easy to read/write files.

If you want something more serious, you can go for a distributed cache and start it with just one node running locally.

Lots of options there:

Lots of databases in general support JSON these days:

I would definitely go with JSON as your serialized data format.