﻿<?xml version="1.0" encoding="utf-8"?><rss version="2.0"><channel><title>Ayende @ Rahien</title><link>http://ayende.com</link><description>Ayende @ Rahien</description><copyright>Copyright (C) Ayende Rahien  2004 - 2021 (c) 2026</copyright><ttl>60</ttl><item><title>Ayende Rahien commented on Document based modeling: Auctions &amp;amp; Bids</title><description>Mauricia,
Why would I want the bidders? 
In general, tertiary associations aren't needed in most document models, because they exists on either the primary or secondary documents</description><link>http://ayende.com/96257/document-based-modeling-auctions-bids#comment22</link><guid>http://ayende.com/96257/document-based-modeling-auctions-bids#comment22</guid><pubDate>Thu, 20 Oct 2011 21:36:45 GMT</pubDate></item><item><title>Mauricia Ragland commented on Document based modeling: Auctions &amp;amp; Bids</title><description>Great Example! I'm currently trying to wrap my head around this exact concept. 

One question I see in the example you retrieved Auction 1234 and its bids. How would you go about Retrieving Auction 1234 and its "bidders"? Would it be as simple to say
var bidders = session.Load&lt;Bids&gt;("auctions/1234/bidders");
although this seems more realistic
var bidders = session.Load&lt;Bids&gt;("auctions/1234/bids/bidders"); //Not sure how to make it distinct?

I'm COMPLETELY new to Raven and NoSQL so forgive me if it seems like a dumb question</description><link>http://ayende.com/96257/document-based-modeling-auctions-bids#comment21</link><guid>http://ayende.com/96257/document-based-modeling-auctions-bids#comment21</guid><pubDate>Thu, 20 Oct 2011 18:04:55 GMT</pubDate></item><item><title>Ayende Rahien commented on Document based modeling: Auctions &amp;amp; Bids</title><description>Bobby,
I don't think that the model has been significantly denormalized. In particular, the product copy was done to make sure that it is immutable. So changes wouldn't affect it.
In such a system, you don't delete a product. Also, see this:
http://www.udidahan.com/2009/09/01/dont-delete-just-dont/

I don't understand the question about roles, and it is probably better suited for the mailing list</description><link>http://ayende.com/96257/document-based-modeling-auctions-bids#comment20</link><guid>http://ayende.com/96257/document-based-modeling-auctions-bids#comment20</guid><pubDate>Fri, 14 Oct 2011 08:03:49 GMT</pubDate></item><item><title>Bobby D commented on Document based modeling: Auctions &amp;amp; Bids</title><description>This article has cleared a lot of things up for me.. two questions, though:

1. Given that the domain has essentially been de-normalized, how would the developer (or ravendb, for that matter) handle deleting an aggregate or flagging it as no longer available?  Would the delete have to cascade across all document affected, or would a flag have to be included in each document that references it (thus avoiding the N+1 problem)?

2. This is probably OT.  This morning, I had an "ah ha!" moment regarding DDD and contextual security.  Basically, if you have aggregate roots, you don't have to worry about contextual security.  However, in a system where, say, a user has more than one role, I am not sure you could cohesively represent multiple aggregates in different ways from the same root.  (This question might be better answered in another format, but I was just thinking about it today).</description><link>http://ayende.com/96257/document-based-modeling-auctions-bids#comment19</link><guid>http://ayende.com/96257/document-based-modeling-auctions-bids#comment19</guid><pubDate>Fri, 14 Oct 2011 07:21:44 GMT</pubDate></item><item><title>Ayende Rahien commented on Document based modeling: Auctions &amp;amp; Bids</title><description>Bil,
For the Aggregates, yes, it is the same.
The real saving is in the things that you can embed, like the product itself, comments, buying information, etc.</description><link>http://ayende.com/96257/document-based-modeling-auctions-bids#comment18</link><guid>http://ayende.com/96257/document-based-modeling-auctions-bids#comment18</guid><pubDate>Thu, 13 Oct 2011 09:10:02 GMT</pubDate></item><item><title>Bil Simser commented on Document based modeling: Auctions &amp;amp; Bids</title><description>If you modelled this in an object based system stored in SQL (for example) would it be any different? I would see 3 classs (Product, Auction, and Bids) that would eventualy be stored in 3 dbs with a relationship between Bids -&gt; Auction. So it makes sense to me to separate out bids (I agree that updating two documents instead of one is a better strategy vs. loading all the bids into an auction). 

Even if you do lazy loading, you're probably going to want the aggregated value in the Auction class because you don't want to be doing a query to find out the bidscount. 

I'm curious if the object model would be that much different in C# for SQL storage vs. a document store. Would a NoSQL store be any different (or is a document store considered NoSQL).</description><link>http://ayende.com/96257/document-based-modeling-auctions-bids#comment17</link><guid>http://ayende.com/96257/document-based-modeling-auctions-bids#comment17</guid><pubDate>Wed, 12 Oct 2011 15:27:44 GMT</pubDate></item><item><title>DaylightSavings commented on Document based modeling: Auctions &amp;amp; Bids</title><description>Future post error: the post is already published. Post Id: Hiring Questions-The phone book-responding to commentary, PublishAt: 10/3/2011 12:00:00 PM +03:00, Now: 10/3/2011 11:53:44 AM +02:00

System.InvalidOperationException: Future post error: the post is already published. Post Id: Hiring Questions-The phone book-responding to commentary, PublishAt: 10/3/2011 12:00:00 PM +03:00, Now: 10/3/2011 11:53:44 AM +02:00
   at RaccoonBlog.Web.ViewModels.FuturePostViewModel.DistanceOfTimeInWords(Double minutes) in C:\Work\RaccoonBlog\src\RaccoonBlog.Web\ViewModels\FuturePostViewModel.cs:line 32
   at RaccoonBlog.Web.ViewModels.FuturePostViewModel.get_Time() in C:\Work\RaccoonBlog\src\RaccoonBlog.Web\ViewModels\FuturePostViewModel.cs:line 25
   at ASP._Page_Views_Section_FuturePosts_cshtml.Execute() in c:\Sites\ayende.com\blog\Views\Section\FuturePosts.cshtml:line 11
   at System.Web.WebPages.WebPageBase.ExecutePageHierarchy()
   at System.Web.Mvc.WebViewPage.ExecutePageHierarchy()
   at System.Web.WebPages.StartPage.ExecutePageHierarchy()
   at System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage)
   at System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context)
   at System.Web.Mvc.ControllerActionInvoker.&lt;&gt;c__DisplayClass1c.&lt;InvokeActionResultWithFilters&gt;b__19()
   at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation)
   at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation)
   at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation)
   at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext controllerContext, IList`1 filters, ActionResult actionResult)
   at System.Web.Mvc.ControllerActionInvoker.</description><link>http://ayende.com/96257/document-based-modeling-auctions-bids#comment16</link><guid>http://ayende.com/96257/document-based-modeling-auctions-bids#comment16</guid><pubDate>Mon, 03 Oct 2011 10:02:17 GMT</pubDate></item><item><title>Ayende Rahien commented on Document based modeling: Auctions &amp;amp; Bids</title><description>Error,
Yes, we know. We got caught in Winter Clock problem, because the server timzone changed. 
Will be fixed in a few minutes</description><link>http://ayende.com/96257/document-based-modeling-auctions-bids#comment15</link><guid>http://ayende.com/96257/document-based-modeling-auctions-bids#comment15</guid><pubDate>Mon, 03 Oct 2011 10:02:02 GMT</pubDate></item><item><title>error commented on Document based modeling: Auctions &amp;amp; Bids</title><description>An error occurred on our server, error details:
Future post error: the post is already published. Post Id: Hiring Questions–The phone book–responding to commentary, PublishAt: 10/3/2011 12:00:00 PM +03:00, Now: 10/3/2011 11:42:13 AM +02:00

System.InvalidOperationException: Future post error: the post is already published. Post Id: Hiring Questions–The phone book–responding to commentary, PublishAt: 10/3/2011 12:00:00 PM +03:00, Now: 10/3/2011 11:42:13 AM +02:00
   at RaccoonBlog.Web.ViewModels.FuturePostViewModel.DistanceOfTimeInWords(Double minutes) in C:\Work\RaccoonBlog\src\RaccoonBlog.Web\ViewModels\FuturePostViewModel.cs:line 32
   at RaccoonBlog.Web.ViewModels.FuturePostViewModel.get_Time() in C:\Work\RaccoonBlog\src\RaccoonBlog.Web\ViewModels\FuturePostViewModel.cs:line 25
   at ASP._Page_Views_Section_FuturePosts_cshtml.Execute() in c:\Sites\ayende.com\blog\Views\Section\FuturePosts.cshtml:line 11
   at System.Web.WebPages.WebPageBase.ExecutePageHierarchy()
   at System.Web.Mvc.WebViewPage.ExecutePageHierarchy()
   at System.Web.WebPages.StartPage.ExecutePageHierarchy()
   at System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage)
   at System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context)
   at System.Web.Mvc.ControllerActionInvoker.&lt;&gt;c__DisplayClass1c.&lt;InvokeActionResultWithFilters&gt;b__19()
   at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation)
   at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation)
   at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation)
   at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext controllerContext, IList`1 filters, ActionResult actionResult)
   at System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName)

</description><link>http://ayende.com/96257/document-based-modeling-auctions-bids#comment14</link><guid>http://ayende.com/96257/document-based-modeling-auctions-bids#comment14</guid><pubDate>Mon, 03 Oct 2011 09:43:22 GMT</pubDate></item><item><title>Ayende Rahien commented on Document based modeling: Auctions &amp;amp; Bids</title><description>Nadav,
Yes, you can use paging for this, but since you rarely if ever need old bids, it is easier to just shove them out of the way</description><link>http://ayende.com/96257/document-based-modeling-auctions-bids#comment13</link><guid>http://ayende.com/96257/document-based-modeling-auctions-bids#comment13</guid><pubDate>Sat, 01 Oct 2011 10:55:27 GMT</pubDate></item><item><title>Ayende Rahien commented on Document based modeling: Auctions &amp;amp; Bids</title><description>Andres,
Yes, you can do that with an index, </description><link>http://ayende.com/96257/document-based-modeling-auctions-bids#comment12</link><guid>http://ayende.com/96257/document-based-modeling-auctions-bids#comment12</guid><pubDate>Sat, 01 Oct 2011 10:54:44 GMT</pubDate></item><item><title>Ayende Rahien commented on Document based modeling: Auctions &amp;amp; Bids</title><description>Jason,
You split them into a mode that allows very easy paging, and zero work on any part of the system.</description><link>http://ayende.com/96257/document-based-modeling-auctions-bids#comment11</link><guid>http://ayende.com/96257/document-based-modeling-auctions-bids#comment11</guid><pubDate>Sat, 01 Oct 2011 10:54:06 GMT</pubDate></item><item><title>Ayende Rahien commented on Document based modeling: Auctions &amp;amp; Bids</title><description>Chanan,
Yes, we can, but I like to work with the model directly for most things. The main problem is also what would happen if you had 5,000 bids? It would make the Auction document very large</description><link>http://ayende.com/96257/document-based-modeling-auctions-bids#comment10</link><guid>http://ayende.com/96257/document-based-modeling-auctions-bids#comment10</guid><pubDate>Sat, 01 Oct 2011 10:53:28 GMT</pubDate></item><item><title>Ayende Rahien commented on Document based modeling: Auctions &amp;amp; Bids</title><description>Rafal,
There is very little cost of updating two documents in the same transaction vs. just one</description><link>http://ayende.com/96257/document-based-modeling-auctions-bids#comment9</link><guid>http://ayende.com/96257/document-based-modeling-auctions-bids#comment9</guid><pubDate>Sat, 01 Oct 2011 10:52:22 GMT</pubDate></item><item><title>Ayende Rahien commented on Document based modeling: Auctions &amp;amp; Bids</title><description>Phillip,
Auto bidding scenario would be handled by the auction. As part of the transaction that saves the new bid, all auto bids would fire and new bids would be added.
</description><link>http://ayende.com/96257/document-based-modeling-auctions-bids#comment8</link><guid>http://ayende.com/96257/document-based-modeling-auctions-bids#comment8</guid><pubDate>Sat, 01 Oct 2011 10:51:48 GMT</pubDate></item><item><title>Nadav Sofy commented on Document based modeling: Auctions &amp;amp; Bids</title><description>Why would you create a separate document for history bids?
can't you use paging to get only the top X of the bids?</description><link>http://ayende.com/96257/document-based-modeling-auctions-bids#comment7</link><guid>http://ayende.com/96257/document-based-modeling-auctions-bids#comment7</guid><pubDate>Fri, 30 Sep 2011 21:28:10 GMT</pubDate></item><item><title>Matco commented on Document based modeling: Auctions &amp;amp; Bids</title><description>A little off the subject, but not really since we are talking about data modeling, but what ever happened to Matco?

It's been 45 days (8-17-11) since the last Matco post and I was really enjoying the series.

Thanks Ayende</description><link>http://ayende.com/96257/document-based-modeling-auctions-bids#comment6</link><guid>http://ayende.com/96257/document-based-modeling-auctions-bids#comment6</guid><pubDate>Fri, 30 Sep 2011 13:49:33 GMT</pubDate></item><item><title>andres commented on Document based modeling: Auctions &amp;amp; Bids</title><description>I do not like to do it explicitely:
    auction.UpdateStatsFrom(bids);
I mean it is completely related to this:
    bids.AddNewBid(bidder, amount);
Is there a way to update "WinningBidAmount" and "BidsCount" automatically? 
or maybe to use an Auction model that contains only "Quantity", "Product", "StartsAt" and "EndsAt" and to get a compounded model with "WinningBidAmount" and "BidsCount" from an index?</description><link>http://ayende.com/96257/document-based-modeling-auctions-bids#comment5</link><guid>http://ayende.com/96257/document-based-modeling-auctions-bids#comment5</guid><pubDate>Fri, 30 Sep 2011 13:15:13 GMT</pubDate></item><item><title>Jason Meckley commented on Document based modeling: Auctions &amp;amp; Bids</title><description>What about paging bids for high interest auctions. that's basically what bid history is, a page of bids, but what is gained by placing them into a separate historical bids document?</description><link>http://ayende.com/96257/document-based-modeling-auctions-bids#comment4</link><guid>http://ayende.com/96257/document-based-modeling-auctions-bids#comment4</guid><pubDate>Fri, 30 Sep 2011 12:31:27 GMT</pubDate></item><item><title>Chanan Braunstein commented on Document based modeling: Auctions &amp;amp; Bids</title><description>Ayende,

"The problem with such an approach is that we are now forced to load the Bids whenever we want to load the Auction, but the main scenario is that we just need the Auction details, not all of the Bids details."

Can't we use live projections here?</description><link>http://ayende.com/96257/document-based-modeling-auctions-bids#comment3</link><guid>http://ayende.com/96257/document-based-modeling-auctions-bids#comment3</guid><pubDate>Fri, 30 Sep 2011 11:17:20 GMT</pubDate></item><item><title>Rafal commented on Document based modeling: Auctions &amp;amp; Bids</title><description>Regarding the performance choices, I thing all that you save on not including the bids in the auction document is probably lost when you have to use a transaction to update two documents on each bid.
Maybe you could choose a third approach - keep last N most important bids in the auction and all older bids in separate documents? This way you would be updating only the auction document on each bid and every N/2 bids you would throw away the oldest bids into a new 'bids' document. </description><link>http://ayende.com/96257/document-based-modeling-auctions-bids#comment2</link><guid>http://ayende.com/96257/document-based-modeling-auctions-bids#comment2</guid><pubDate>Fri, 30 Sep 2011 10:29:14 GMT</pubDate></item><item><title>Phillip Haydon commented on Document based modeling: Auctions &amp;amp; Bids</title><description>How would you handle a bid that needs feedback sooner than 30 seconds? In the scenario of Auto Bidding where the current bid is say $100, but the user has an Auto Bid to a maximum value of $180.

If the incremented bids are $5 for example, and a new user bids $105, the new user needs immediate feedback that their bid was outbid by an autobid, and the new highest bid is $110.

I don't know about ebay because i rarely use it, since it's crap. But http://www.trademe.co.nz/ has the concept of auto-bidding. 

The traffic would be a fraction of what is on ebay, but regardless, how would you handle such scenario?

I assume it would be the same as your second scenario.</description><link>http://ayende.com/96257/document-based-modeling-auctions-bids#comment1</link><guid>http://ayende.com/96257/document-based-modeling-auctions-bids#comment1</guid><pubDate>Fri, 30 Sep 2011 09:57:44 GMT</pubDate></item></channel></rss>