couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dmitriy Fot <dmitriy....@gmail.com>
Subject Re: CouchDB document design for facebook insights
Date Sun, 09 Dec 2012 19:04:57 GMT
great responses, thank you guys,

Dmitriy Fot
---------------------------------
dmitriy.fot@gmail.com


On 7 December 2012 19:51, Jens Alfke <jens@couchbase.com> wrote:
>
> On Dec 7, 2012, at 12:32 AM, Dmitriy Fot <dmitriy.fot@gmail.com<mailto:dmitriy.fot@gmail.com>>
wrote:
>
> - Is it right decision to use an array for the timestamp, or it is
> better to use a long?
>
> Depends what you’ll be using it for. The array you have is great if you’ll be doing
a lot of tests based on the components of the date, i.e. all the posts from November 2012.
If you just need to compare times or look at the interval between two times, a numeric timestamp
is best (at the expense of not being directly human-readable.) A string timestamp is more
compact than an array and can be converted into either a number or components by the JS Date
class, although the conversion is somewhat expensive.
>
> (Another thing to consider about timestamps is whether you need to remember the time
zone or not. For most purposes you can just pre-convert everything to UTC, but for some queries
you might want to know the local time, i.e. “what time of day do people post most often?”)
>
> —Jens

Mime
View raw message