Database Reference
In-Depth Information
"23"
:
20457
},
minute
:
{
"0"
:
{
"0"
:
3612
,
"1"
:
3241
,
...
"59"
:
2130
},
"1"
:
{
"0"
:
...,
},
...
"23"
:
{
"59"
:
2819
}
}
}
Example 4-2. Monthly statistics
{
_id
:
"201010/site-1/apache_pb.gif"
,
metadata
:
{
date
:
ISODate
(
"2000-10-00T00:00:00Z"
),
site
:
"site-1"
,
page
:
"/apache_pb.gif"
},
daily
:
{
"1"
:
5445326
,
"2"
:
5214121
,
... }
}
To support this operation, our event logging operation adds a second
update
operation, which
does slow down the operation, but the gains in query performance should be well worth it.
Operations
This section outlines a number of common operations for building and interacting with real-
time analytics-reporting systems. The major challenge is in balancing read and write perform-
ance. All our examples here use the Python programming language and the
pymongo
driver,
but you can implement this system using any language you choose.