Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion introductions. and: is RavenDB right for me?

Received: by 10.14.199.133 with SMTP id x5mr1820259een.7.1334493017917;
        Sun, 15 Apr 2012 05:30:17 -0700 (PDT)
X-BeenThere: ravendb@googlegroups.com
Received: by 10.213.31.206 with SMTP id z14ls871498ebc.0.gmail; Sun, 15 Apr
 2012 05:30:14 -0700 (PDT)
Received: by 10.213.21.203 with SMTP id k11mr621292ebb.24.1334493014699;
        Sun, 15 Apr 2012 05:30:14 -0700 (PDT)
Received: by 10.213.21.203 with SMTP id k11mr621291ebb.24.1334493014660;
        Sun, 15 Apr 2012 05:30:14 -0700 (PDT)
Return-Path: <ryan.q.he...@gmail.com>
Received: from mail-ee0-f51.google.com (mail-ee0-f51.google.com [74.125.83.51])
        by gmr-mx.google.com with ESMTPS id y52si15070674eef.2.2012.04.15.05.30.14
        (version=TLSv1/SSLv3 cipher=OTHER);
        Sun, 15 Apr 2012 05:30:14 -0700 (PDT)
Received-SPF: pass (google.com: domain of ryan.q.he...@gmail.com designates 74.125.83.51 as permitted sender) client-ip=74.125.83.51;
Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of ryan.q.he...@gmail.com designates 74.125.83.51 as permitted sender) smtp.mail=ryan.q.he...@gmail.com; dkim=pass header...@gmail.com
Received: by eeke50 with SMTP id e50so1290179eek.24
        for <ravendb@googlegroups.com>; Sun, 15 Apr 2012 05:30:14 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20120113;
        h=mime-version:in-reply-to:references:date:message-id:subject:from:to
         :content-type;
        bh=9KMROqCpaquPh8q0hCkB7gHCfVwDfKJzRJqXgI2Q3Go=;
        b=p1Hk63nT1G9V+hv/ZFNnDAfdHDejbi2GpRMLFcyapAb1eNcpWMj97Zle3FZlcqmNQv
         Fab0RMXcsvPfeNnaHl2krbEXof3CYJFcmSQmVIWbIIiEsJ9fxKNF6fjJeYxaaD4qqQ3+
         kWBns7wwk1A6RLcVlidIRA4fJmf8hs4P1JtAiDPpBra0cNn0xQj7TGgWWYTk/YIBrnPJ
         qiFZMoy7BTxeSc9ZPObxob4tiAOQrmAsJfgbKc76rMSK7SR0QLluN/KzP/9v0DivACK6
         jG8U8cIVIjHpzJwZMk1aQSRClZMPPAQh4jpQfpeb0E8WnTpqk41jTmBzx+kjXnpRPyXB
         eXMg==
MIME-Version: 1.0
Received: by 10.213.105.70 with SMTP id s6mr540511ebo.45.1334493014502; Sun,
 15 Apr 2012 05:30:14 -0700 (PDT)
Received: by 10.213.106.18 with HTTP; Sun, 15 Apr 2012 05:30:14 -0700 (PDT)
In-Reply-To: <29962960.1784.1334491007669.JavaMail.geo-discussion-forums@vbut24>
References: <23039802.60.1334172372860.JavaMail.geo-discussion-forums@vbgj4>
	<CAF0G-ZjkE5hCyGSw+HmQ0w1h44DUtQCvv64UJq+mDjS7Dit...@mail.gmail.com>
	<5058557.50.1334241567794.JavaMail.geo-discussion-forums@yneo2>
	<CALfNUtXpxNpWGxv8SYTGaStoMnE1vSm3x89sJ9B2m35Se9-...@mail.gmail.com>
	<15381614.66.1334246417098.JavaMail.geo-discussion-forums@vbuo5>
	<CAF0G-ZgV2=Lm+X6j0hwxr7SqcVn_Oj_8kK9_7JTMVc_7vig...@mail.gmail.com>
	<15680165.332.1334257619708.JavaMail.geo-discussion-forums@vbuo5>
	<CAF0G-Zi1bbX-_yUeCLgpdDtAmJ44i07mx37OSVY--S2O9FZ...@mail.gmail.com>
	<29962960.1784.1334491007669.JavaMail.geo-discussion-forums@vbut24>
Date: Sun, 15 Apr 2012 14:30:14 +0200
Message-ID: <CABcSOXhNcxCogmE1VmNg+y4HnVq0wnO_vW=t1XjP70NdhiB...@mail.gmail.com>
Subject: Re: [RavenDB] introductions. and: is RavenDB right for me?
From: Ryan Heath <ryan.q.he...@gmail.com>
To: "ravendb@googlegroups.com" <ravendb@googlegroups.com>
Content-Type: multipart/alternative; boundary=0015174c415215ae7004bdb6deea

--0015174c415215ae7004bdb6deea
Content-Type: text/plain; charset=ISO-8859-1

Inline ***

On Sunday, April 15, 2012, Serge van den Oever wrote:

> Thanks for the discussion, I think I learned a lot.
>
> I'm working on a really simple example to get the hang of it. What I want
> to do is create website/mobile app on top of MVC Web API.
> Say I want to model FAQ list:
>
> public class Faq
> {
>   string Id { get; set; }
>   string Question { get; set; }
>   string Answer { get; set; }
>   List<Category> Categories { get; set; }
> }
>
> public class Category
> {
>   string Id {get; set; }
>   string Name { get; set; }
>   int Order { get; set; } // need order when presenting for example list
> of categories
> }
>
> I started first with List<string> CategoryIds, but from the above
> discussion I learned not to do that.
>

*** in this case I would use a list of ids ... Since one category could be
used in one or more Faqs.


>  Ok, still have the question what if we rename the category? Should we go
> through all Faq's containing the category? What happens in cloud hosted
> scenario when you have to update a lot of Faq's? If each request costs
> money, we would have an O(n) approach?
>

*** you can issue patch commands which operate on documents at a time.


>
> I see also advantages, I assume full text search can index all info on
> your document, so you get more meaningful results instead of searching over
> documents having references!
>
> Now I want to put an MVC web api on top.
> i will get requests like:
>
> GET REQUEST: http://myserver/API/Faqs/123
>
> Will I return the same FAQ class used for persistance, or create a Web API
> "View model" class, and thanslate?
>

*** I would separate it yes where it makes sense. Think how your persistent
model could change but you still need to support version 1.0 of your api.


> I don't want the user of my api get a category Id categories/123, she
> should only see 123, so an new GET REQUEST
> http://myserver/API/Categories/123 can be done.
>

*** One small thing, you are not required to have integer ids, you might as
well have categories/mobile, categories/desktop etc etc as ids. Making your
api look more 'natural' or 'discoverable'.


> Another question: Should I maintain a separate set of Category documents?
> I need a picker for available categories, so need to trach them
> somewhere... Should I have each category as a seperate document, or create
> a single document witth all categories?
>

*** in this case I would yes separate category from FAQ
If category was nothing more than a name then I would have put it into FAQ


>
> Any ideas on this?
>

// Ryan

Sent from my iPhone

--0015174c415215ae7004bdb6deea
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Inline ***<br><br>On Sunday, April 15, 2012, Serge van den Oever  wrote:<br=
><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1=
px #ccc solid;padding-left:1ex"><div>Thanks for the discussion, I think I l=
earned a lot.</div>
<div><br></div><div>I&#39;m working on a really simple example to get the h=
ang of it. What I want to do is create website/mobile app on top of MVC Web=
 API.</div><div>Say I want to model FAQ list:</div><div><br></div><div>
public class Faq</div><div>{</div><div>=A0 string Id { get; set; }</div><di=
v>=A0 string Question { get; set; }</div><div>=A0 string Answer { get; set;=
 }</div><div>=A0 List&lt;Category&gt; Categories { get; set; }</div><div>}<=
/div>
<div><br></div><div>public class Category</div><div>{</div><div>=A0 string =
Id {get; set; }</div><div>=A0 string Name { get; set; }</div><div>=A0 int O=
rder { get; set; } // need order when presenting for example list of catego=
ries</div>
<div>}</div><div><br></div><div>I started first with List&lt;string&gt; Cat=
egoryIds, but from the above discussion I learned not to do that.</div></bl=
ockquote><div>=A0</div><div>*** in this case I would use a list of ids ... =
Since one category could be used in one or more Faqs.=A0</div>
<div>=A0</div><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;=
border-left:1px #ccc solid;padding-left:1ex"><div>=A0Ok, still have the que=
stion what if we rename the category? Should we go through all Faq&#39;s co=
ntaining the category? What happens in cloud hosted scenario when you have =
to update a lot of Faq&#39;s? If each request costs money, we would have an=
 O(n) approach?</div>
</blockquote><div><br></div><div>*** you can issue patch commands which ope=
rate on documents at a time.=A0</div><div>=A0</div><blockquote class=3D"gma=
il_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-lef=
t:1ex">
<div><br></div><div>I see also advantages, I assume full text search can in=
dex all info on your document, so you get more meaningful results instead o=
f searching over documents having references!</div><div><br></div><div>
Now I want to put an MVC web api on top.</div><div>i will get requests like=
:</div><div><br></div><div>GET REQUEST: <a href=3D"http://myserver/API/Faqs=
/123" target=3D"_blank">http://myserver/API/Faqs/123</a></div><div><br></di=
v>
<div>Will I return the same FAQ class used for persistance, or create a Web=
 API &quot;View model&quot; class, and thanslate?</div></blockquote><div><b=
r></div><div>*** I would separate it yes where it makes sense. Think how yo=
ur persistent model could change but you still need to support version 1.0 =
of your api.=A0</div>
<div>=A0</div><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;=
border-left:1px #ccc solid;padding-left:1ex"><div>I don&#39;t want the user=
 of my api get a category Id categories/123, she should only see 123, so an=
 new GET REQUEST <a href=3D"http://myserver/API/Categories/123" target=3D"_=
blank">http://myserver/API/Categories/123</a> can be done.</div>
</blockquote><span class=3D"Apple-style-span" style><div><span class=3D"App=
le-style-span" style><br></span></div></span><span class=3D"Apple-style-spa=
n" style>*** One small thing, you are not required to have integer ids, you=
 might as well have categories/mobile, categories/desktop etc etc as ids. M=
aking your api look more &#39;natural&#39; or &#39;discoverable&#39;.=A0</s=
pan><div>
<span class=3D"Apple-style-span" style><br></span><blockquote class=3D"gmai=
l_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left=
:1ex"><div><br></div><div>Another question: Should I maintain a separate se=
t of Category documents? I need a picker for available categories, so need =
to trach them somewhere... Should I have each category as a seperate docume=
nt, or create a single document witth all categories?</div>
</blockquote><div><br></div><div>*** in this case I would yes separate cate=
gory from FAQ=A0</div><div>If category was nothing more than a name then I =
would have put it into FAQ=A0</div><span class=3D"Apple-style-span" style>=
=A0</span><div>
</div><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-l=
eft:1px #ccc solid;padding-left:1ex"><div><br></div><div>Any ideas on this?=
</div></blockquote><div><br></div><div>// Ryan</div><div><br></div><div>Sen=
t from my iPhone =A0<span></span></div>
</div>

--0015174c415215ae7004bdb6deea--