﻿<?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>pete w commented on Fun with a non relational databases</title><description>There is a big company well-entrenched in this kind of approach to databases. They have derived answers to many of the questions raised in this discussion, and developed a very mature product. This company is named FileMaker.
  
  
I have worked a few engagements in which company needs for BI has surpassed the abilities of FileMaker, prompting us to build "replication" bridges to data warehouse.
  
  
the "replication" approach is a viable answer to the problems with aggregation and general reporting, however if your primary goal was "NOSQL" well then you have only halfway succeeded.
</description><link>http://ayende.com/4410/fun-with-a-non-relational-databases#comment17</link><guid>http://ayende.com/4410/fun-with-a-non-relational-databases#comment17</guid><pubDate>Sun, 28 Feb 2010 17:57:26 GMT</pubDate></item><item><title>Ayende Rahien commented on Fun with a non relational databases</title><description>iLude,
  
Agreed, in any such scenario that i am aware of, this is the job of background tasks
</description><link>http://ayende.com/4410/fun-with-a-non-relational-databases#comment16</link><guid>http://ayende.com/4410/fun-with-a-non-relational-databases#comment16</guid><pubDate>Fri, 26 Feb 2010 21:07:47 GMT</pubDate></item><item><title>iLude commented on Fun with a non relational databases</title><description>@Oren,
  
  
I was referring to the time it takes to compute the average not the time that it takes for the index to be updated after you have the the new data ready for writing to the data store. 
  
  
Computing the average of all ratings on a book is straight forward and shouldn't take a lot of time regardless of the size of your dataset.  But if you want to find users who share similar taste in books to the current user and show their average rating for the currently viewed book, the answers going to take a bit more time to figure out. 
  
  
My point was that figuring out the answers to these questions is not the job of the data store. Sure SQL can be used to figure out these answers. But it only scales so far. 
  
  
</description><link>http://ayende.com/4410/fun-with-a-non-relational-databases#comment15</link><guid>http://ayende.com/4410/fun-with-a-non-relational-databases#comment15</guid><pubDate>Fri, 26 Feb 2010 21:04:58 GMT</pubDate></item><item><title>Ayende Rahien commented on Fun with a non relational databases</title><description>iLude,
  
The question is, how do you define instantly.
  
My current testing shows latency of ~25 - 50 ms between update &amp; index sync. That is with zero perf work and on tough conditions.
  
</description><link>http://ayende.com/4410/fun-with-a-non-relational-databases#comment14</link><guid>http://ayende.com/4410/fun-with-a-non-relational-databases#comment14</guid><pubDate>Fri, 26 Feb 2010 18:56:24 GMT</pubDate></item><item><title>Ayende Rahien commented on Fun with a non relational databases</title><description>  
Josh,
  
At that point, you include the average user rating inside the document, and index that. From there, it is a very simple issue
</description><link>http://ayende.com/4410/fun-with-a-non-relational-databases#comment13</link><guid>http://ayende.com/4410/fun-with-a-non-relational-databases#comment13</guid><pubDate>Fri, 26 Feb 2010 18:54:53 GMT</pubDate></item><item><title>Ayende Rahien commented on Fun with a non relational databases</title><description>Jordan,
  
I would like to use it where I would use Couch / Mongo, yes. I think that this is very feasible.
</description><link>http://ayende.com/4410/fun-with-a-non-relational-databases#comment12</link><guid>http://ayende.com/4410/fun-with-a-non-relational-databases#comment12</guid><pubDate>Fri, 26 Feb 2010 18:53:57 GMT</pubDate></item><item><title>Ayende Rahien commented on Fun with a non relational databases</title><description>Vadim,
  
The issue isn't with deletion, the issue is with references to deleted documents.
  
The DB won't handle that automatically for you
</description><link>http://ayende.com/4410/fun-with-a-non-relational-databases#comment11</link><guid>http://ayende.com/4410/fun-with-a-non-relational-databases#comment11</guid><pubDate>Fri, 26 Feb 2010 18:53:22 GMT</pubDate></item><item><title>Rafal commented on Fun with a non relational databases</title><description>@Jordan
  
Small to mid-size applications only? Why not large databases? I think large databases is where nosql shows its superiority over rdbms.
</description><link>http://ayende.com/4410/fun-with-a-non-relational-databases#comment10</link><guid>http://ayende.com/4410/fun-with-a-non-relational-databases#comment10</guid><pubDate>Fri, 26 Feb 2010 18:25:13 GMT</pubDate></item><item><title>iLude commented on Fun with a non relational databases</title><description>@Josh,
  
  
As Oren said Aggregation isn't supported nor is it a problem that I believe he's trying to solve. In the case of the average user rating, I think you would fire off an event/message/command to the system when a user provided a rating on a book. The interface responds saying thanks for you feedback. Meanwhile the system queues the event and processes it computing the new average based on the new data. This new aggregate value is stored in a data structure for queries that need that use that average. That value may be stored in the doc db with the book and as such it can be queried using lucene. Or it might be stored in a sql table that has book ids and averages, it doesn't really matter.
  
  
The main problem people usually have is that the users feedback is not instantly available in the view. And to paraphrase Udi "So What?". it will be soon enough and the user who provided the feedback isn't waiting on the interface while this new aggregate is calculated. 
  
  
Some will say that computing the average should not take long. True, but what if I would rather compute the average review of this book by users who like the same books as me? This is a much more interesting question and can not be calculated in a few milliseconds.
  
  
</description><link>http://ayende.com/4410/fun-with-a-non-relational-databases#comment9</link><guid>http://ayende.com/4410/fun-with-a-non-relational-databases#comment9</guid><pubDate>Fri, 26 Feb 2010 17:41:13 GMT</pubDate></item><item><title>guy commented on Fun with a non relational databases</title><description>I think anonymous types might be a bit more nice to look at  as far as the query API.
</description><link>http://ayende.com/4410/fun-with-a-non-relational-databases#comment8</link><guid>http://ayende.com/4410/fun-with-a-non-relational-databases#comment8</guid><pubDate>Fri, 26 Feb 2010 17:08:50 GMT</pubDate></item><item><title>josh commented on Fun with a non relational databases</title><description>Hi Ayende,
  
  
  The first thing that popped in my head was: What if you only want to show a list of books with the average user rating?  Let's say you have a fairly large number of books, and some books with a lot of reviews/ratings.  To show a listing you wouldn't necessarily want to fetch all those books with all of their reviews.  That's a lot of overhead and data you wouldn't use in that view.
  
  
The second thing I thought was: Cool, even uses Lucene.  Very nice.
  
  
-josh
  
</description><link>http://ayende.com/4410/fun-with-a-non-relational-databases#comment7</link><guid>http://ayende.com/4410/fun-with-a-non-relational-databases#comment7</guid><pubDate>Fri, 26 Feb 2010 15:54:41 GMT</pubDate></item><item><title>Jordan commented on Fun with a non relational databases</title><description>I must admit, I would really like to see this project work out to be a good, in-process document database for small to mid-size applications.
  
  
However, my question is this: Is your end goal to "compete" in the same space as CouchDB or MongoDB? Or is this more an experiment that might yield a useful tool?
</description><link>http://ayende.com/4410/fun-with-a-non-relational-databases#comment6</link><guid>http://ayende.com/4410/fun-with-a-non-relational-databases#comment6</guid><pubDate>Fri, 26 Feb 2010 15:49:09 GMT</pubDate></item><item><title>Vadim Kantorov commented on Fun with a non relational databases</title><description>Ok, you don't delete but you mark objects with 'bad' or 'not actual anymore' marks. Anyway, you have to fix the indexes...
</description><link>http://ayende.com/4410/fun-with-a-non-relational-databases#comment5</link><guid>http://ayende.com/4410/fun-with-a-non-relational-databases#comment5</guid><pubDate>Fri, 26 Feb 2010 15:47:51 GMT</pubDate></item><item><title>Nick Meldrum commented on Fun with a non relational databases</title><description>I read Udi's article and agree with his example, however does that really extend to never delete *anything*?
  
  
Surely it means never delete anything that is not really deleted, but merely changed state (as in Udi's examples.) Sometimes Delete really does make sense. A poor example I have now is, "What if I add an item to be persisted that I realise later shouldn't exist." A pretty poor example I admit... I will try to think of a better one...
  
  
I am quite excited at the prospect of using a .Net based object graph database, and this project seems the closest so far to my needs. I would definitely vote in favour of implementing delete!
  
</description><link>http://ayende.com/4410/fun-with-a-non-relational-databases#comment4</link><guid>http://ayende.com/4410/fun-with-a-non-relational-databases#comment4</guid><pubDate>Fri, 26 Feb 2010 14:43:23 GMT</pubDate></item><item><title>Ayende Rahien commented on Fun with a non relational databases</title><description>Bunter,
  
Paging is implemented in overload for Query.
  
Query(“booksByAuthor”, “author:weber”, N, M);
  
  
Ordering for paging is something that I need to think about, probably something like:
  
  
Query(“booksByAuthor”, “author:weber”, N, M, function(x,y) {
  
    return x.name.CompareTo(y.name);
  
});
  
  
Aggregation isn't supported, because it isn't something that you can do in a doc db. Well, you can, but it provides interesting challenges and stops working when you try to think about distributed db.
  
Since you can't really do aggregation in a distributed fashion easily, I might not do it.
  
I actually have a couple of interesting ideas about how to implement this, though.
  
  
Why Json? Because I am thinking about very low level API, not user facing ones.
  
  
&gt; Getting N top rated products under categories that are direct or indirect child of category X?
  
  
There are two options, the easy one is to include the entire category hierarchy in the book. 
  
The idea is that it means that I can pull the entire list in a single request, vs. having to do hierarchical stuff.
  
  
In that is the case, you would need a view like:
  
  
var booksByCategory = from doc in docs
  
                                   where doc.type == "book"
  
                                   from cat in doc.categories
  
                                   select new { cat.name };
  
  
Query("booksByCategory", "name:foo");
  
  
Another approach, which I am not overly fond of, is to support hierarchy in the view generation, something like (highly tentative):
  
  
var booksByCategory = from doc in docs.include_matching(d=&gt;d.category &amp;&amp; d.type == "book")
  
                                   where doc.type == "book"
  
                                   from cat in doc.categories
  
                                   select new { cat.name };
  
  
Which would build the same index, but without requiring the book to carry all the hierarchy, but since you generally need the entire hierarchy anyway, it doesn't really make sense not to have it.
  
  
Final option is to generate the categories key as:
  
  
1. Books
  
1.2 Books &gt; Sci Fi
  
1.2.3 Books &gt; Sci Fi &gt; Military
  
  
And in this case you can do this sort of queries very easily because of the nature of the queries.
</description><link>http://ayende.com/4410/fun-with-a-non-relational-databases#comment3</link><guid>http://ayende.com/4410/fun-with-a-non-relational-databases#comment3</guid><pubDate>Fri, 26 Feb 2010 12:17:52 GMT</pubDate></item><item><title>Javi commented on Fun with a non relational databases</title><description>Hi Ayende,
  
  
I see that the read operations use a JsonDoc entity... 
  
What about serializing/deserializing the json docs into .NET entities?
  
Are you leaving this out because of performance concerns?
  
  
Javi
</description><link>http://ayende.com/4410/fun-with-a-non-relational-databases#comment2</link><guid>http://ayende.com/4410/fun-with-a-non-relational-databases#comment2</guid><pubDate>Fri, 26 Feb 2010 11:25:27 GMT</pubDate></item><item><title>Bunter commented on Fun with a non relational databases</title><description>How does the query interface handles paging, ordering and aggregation?  
  
  
Getting N - M books matching a query?
  
  
Getting N top rated products under categories that are direct or indirect child of category X?
  
  
Getting books with more than 1 author?
</description><link>http://ayende.com/4410/fun-with-a-non-relational-databases#comment1</link><guid>http://ayende.com/4410/fun-with-a-non-relational-databases#comment1</guid><pubDate>Fri, 26 Feb 2010 11:17:27 GMT</pubDate></item></channel></rss>