Return-Path: X-Original-To: apmail-couchdb-dev-archive@www.apache.org Delivered-To: apmail-couchdb-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 39E28CA52 for ; Fri, 8 Jun 2012 17:08:58 +0000 (UTC) Received: (qmail 21667 invoked by uid 500); 8 Jun 2012 17:08:57 -0000 Delivered-To: apmail-couchdb-dev-archive@couchdb.apache.org Received: (qmail 21626 invoked by uid 500); 8 Jun 2012 17:08:57 -0000 Mailing-List: contact dev-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@couchdb.apache.org Delivered-To: mailing list dev@couchdb.apache.org Received: (qmail 21615 invoked by uid 99); 8 Jun 2012 17:08:57 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 08 Jun 2012 17:08:57 +0000 X-ASF-Spam-Status: No, hits=2.2 required=5.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [81.3.94.35] (HELO mail1.powerreg.newnet.co.uk) (81.3.94.35) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 08 Jun 2012 17:08:49 +0000 Received: (qmail 5910 invoked by uid 89); 8 Jun 2012 17:07:53 -0000 Received: from unknown (HELO ?192.168.1.10?) (david.martin@lymegreen.co.uk@80.175.243.41) by 0 with ESMTPA; 8 Jun 2012 17:07:53 -0000 Message-ID: <4FD23172.10501@lymegreen.co.uk> Date: Fri, 08 Jun 2012 18:08:02 +0100 From: david martin User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:12.0) Gecko/20120430 Thunderbird/12.0.1 MIME-Version: 1.0 To: dev@couchdb.apache.org Subject: Re: versioning for sensors data storage References: In-Reply-To: Content-Type: multipart/alternative; boundary="------------050607010306000300070503" --------------050607010306000300070503 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 08/06/12 12:08, Maxim Osipov wrote: > Hi, > > Warning: I'm new to CouchDB! And I'm in a process pf selecting a > database to store data from sensors. The scenario looks like this: > > There are sensors on the net (may be thousands or later millions) for > things like temperature, motion, etc. Each sensors has an IPv6 address > and pushes data to central server in JSON format, like: > { temp: 36.6; humidity: 80 } > We don't know in advance what exactly sensor will push, but most of > the time the format of JSON structure is the same. Data is updated ... > say every second for each sensor. > > > From the "architecture" point of view it could be a nice solution with > CouchDB, where each sensor is represented by a document and each > sample of sensor data is a version of this document. Each sample time is represented by a document and each sensor has a field in the document. If multiple sensors read at the same time different documents are produced for each sensor. If sensors are all read at the same time multiple fields can exist in a single time document. Versions have nothing to do with what you are trying to do. > > The questions are: > - do we have time/date information for versions not a viable idea > - is it easy/good to access document version history not for this purpose > - what is a limit on number of versions and how it affects performance arbitrary 1000, but not to be used for this purpose > - is it possible/easy/good to get a time snapshot of database yes > > All other comments are also welcome! > > Kind regards, > Maxim > http://otperl.com/my_nanode 381153 minute readings of temperature data in Couchdb visualized by couchapp running d3.js data comes from Nanode #490 some issues with negative degree readings on Nanode. press Next (not start) to visualize. You cannot break anything! records in JSON, date is coded in id dt = new Date(parseInt(parseInt(json.rows[0].id.slice(0,14),16)/1000)); |{ "|_id|":|"04c1f8cbefdf8af6aa4f5cff8291a2fb"|, "|_rev|":|"1-56da4c7f440fcd48fd60a222e502d30b"|, "|Nanode|":|"5.0.0"|, "|NodeNo|":|"0490"|, "|comment|":|"comment"|, "|datastreams|":|[ |{ "|id|":|"temperatureC"|, "|value|":|"8.83"| }|, |{ "|id|":|"F"|, "|value|":|"47.24"| }|, |{ "|id|":|"mv"|, "|value|":|"0.58"| }| ]| }| David Martin (davidoccam) --------------050607010306000300070503--