CouchDB document maximum size
Just after some advice, as I'm brand new to CouchDB (and loving it so far). Just wondering if there are any limitations to the size of a single Document. Below is an example of a Document example.
{
"_id": "client_info",
"name": "Client Name",
"role": "admin",
....
},
{
"_id": "1199145600",
"alert_1_value": 0.150
"alert_2_value": 1.030
"alert_3_value": 12.500
...
...
},
{
"_id": "1199145900",
"alert_1_value": 0开发者_开发百科.150
"alert_2_value": 1.030
"alert_3_value": 12.500
...
...
},
{
"_id": "1199146200",
"alert_1_value": 0.150
"alert_2_value": 1.030
"alert_3_value": 12.500
...
...
},
etc...literally millions more of these every 5 minutes...
The example above shows that I'll be storing data (timestamp and value) for several Data objects (eg, Data_1, Data_2, etc) under the object "values".
The trick here, is that each "values" object will need to store a significant amount of timestamp/value objects (around 2.5 million). I've added these through a script, just to test the limitations of the Document, but Futon crashes as it can't handle it.
I have a feeling i'm going about this the wrong way...
UPDATE: Revised code, now storing each data set in seperate documents.
When you design CouchDB database, you must think in terms of documents. Here's an excerpt from http://guide.couchdb.org which I find very good:
A rule of thumb: break up into documents everything that you will be handling separately in your application. Items are single, and comments are single, but you don’t need to break them into smaller pieces. Views are a convenient way to group your documents in meaningful ways.
精彩评论