Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id CBB61200BDD for ; Sat, 10 Dec 2016 11:15:57 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id CA477160B2B; Sat, 10 Dec 2016 10:15:57 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 1D378160B1A for ; Sat, 10 Dec 2016 11:15:56 +0100 (CET) Received: (qmail 48369 invoked by uid 500); 10 Dec 2016 10:15:56 -0000 Mailing-List: contact user-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@couchdb.apache.org Delivered-To: mailing list user@couchdb.apache.org Received: (qmail 48358 invoked by uid 99); 10 Dec 2016 10:15:55 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 10 Dec 2016 10:15:55 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 7CE4F1812E6 for ; Sat, 10 Dec 2016 10:15:55 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1 X-Spam-Level: * X-Spam-Status: No, score=1 tagged_above=-999 required=6.31 tests=[KAM_LAZY_DOMAIN_SECURITY=1] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id VoUqEsp79PmJ for ; Sat, 10 Dec 2016 10:15:54 +0000 (UTC) Received: from vie01a-dmta-ch02-2.mx.upcmail.net (vie01a-dmta-ch02-2.mx.upcmail.net [84.116.36.95]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id 5B4985FAE7 for ; Sat, 10 Dec 2016 10:15:54 +0000 (UTC) Received: from [172.31.216.43] (helo=vie01a-pemc-psmtp-pe01) by vie01a-dmta-ch02.mx.upcmail.net with esmtp (Exim 4.87) (envelope-from ) id 1cFeh7-0006l6-4y for user@couchdb.apache.org; Sat, 10 Dec 2016 11:15:53 +0100 Received: from [192.168.0.18] ([77.58.202.198]) by vie01a-pemc-psmtp-pe01 with SMTP @ mailcloud.upcmail.net id JAFf1u01P4HLUKR01AFmv7; Sat, 10 Dec 2016 11:15:53 +0100 X-SourceIP: 77.58.202.198 X-Authenticated-Sender: aowen@hispeed.ch From: Andreas Owen Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: proper nosql modelling Message-Id: Date: Sat, 10 Dec 2016 11:15:39 +0100 To: user@couchdb.apache.org Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) X-Mailer: Apple Mail (2.3124) archived-at: Sat, 10 Dec 2016 10:15:58 -0000 =08I have read a couple of articles about couchdb and nosql modelling = because I=E2=80=99m finally changing from mysql. Unfortunately I still = haven=E2=80=99t been able to answer a couple of questions, maybe someone = can enlighten me. i have a design document with views,lists,templates that make up an app = and i=E2=80=99m using the builtin web-server. My app works with = appointments in calendars where i have to check overlapping and minimum = separation time on so on. that means i=E2=80=99m working a lot with date = ranges, durations and weekNumbers. Appointments can also have = linked/nested documents so sometimes i have to fetch other docTypes with = a doc. questions: - should view only contain _ids or also all the data you want to fetch? - what do you do about nested Documents, get them in the view or fetch = the while rendering using lists / shows / templates (design doc)? For = example calling db.openDoc() in list to get data of doc or nested doc. - when i check for overlapping should i use views and then write a = js-function to step through all results and check stuff or is it better = to use nQ1-queries (pseudo-sql)? For example: appointment2.start >=3D appointment1.end + minSeperationTime && = appointment2.end <=3D appointment3.start + minSeperationTime