﻿<?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>Marco commented on That No SQL Thing: The relational modeling anti pattern in document databases</title><description>Opss, I didn't know about this kind of DB, shame on me.
  
  
They are exactly what I was looking for.
  
  
If you add this functionality to RavenDB then it will be just brilliant, looking forward to it.
  
  
Thanks a lot
</description><link>http://ayende.com/4465/that-no-sql-thing-the-relational-modeling-anti-pattern-in-document-databases#comment11</link><guid>http://ayende.com/4465/that-no-sql-thing-the-relational-modeling-anti-pattern-in-document-databases#comment11</guid><pubDate>Thu, 29 Apr 2010 13:11:53 GMT</pubDate></item><item><title>Ayende Rahien commented on That No SQL Thing: The relational modeling anti pattern in document databases</title><description>Marco,
  
You are thinking about graph databases.
  
I will probably add some support for Raven to do so, but that is in the future.
</description><link>http://ayende.com/4465/that-no-sql-thing-the-relational-modeling-anti-pattern-in-document-databases#comment10</link><guid>http://ayende.com/4465/that-no-sql-thing-the-relational-modeling-anti-pattern-in-document-databases#comment10</guid><pubDate>Thu, 29 Apr 2010 11:17:11 GMT</pubDate></item><item><title>Marco commented on That No SQL Thing: The relational modeling anti pattern in document databases</title><description>I know that thinking "relational" is not the best approach here, but I'm wondering how can you handle an N to N relation between 2 documents type which are indipendent (they are indipendent entity) but they can be linked, and when they are linked then someone can put one or more comments explaining why they are linked together...is it something that RavenDB can solve or I should stick with the rational DB?
  
  
Maybe a mix of the two could be the best in my opinion, model the documents with RavenDB but handle the relations using a "relation document" used to express the relation and which contain the comments...
  
It sounds like an interesting idea ;)
</description><link>http://ayende.com/4465/that-no-sql-thing-the-relational-modeling-anti-pattern-in-document-databases#comment9</link><guid>http://ayende.com/4465/that-no-sql-thing-the-relational-modeling-anti-pattern-in-document-databases#comment9</guid><pubDate>Thu, 29 Apr 2010 08:35:35 GMT</pubDate></item><item><title>Frank Quednau commented on That No SQL Thing: The relational modeling anti pattern in document databases</title><description>I prefer fembots to shemales, tbh.
  
  
Yes, that looked pretty ugle at times. Let's see what comes next.
</description><link>http://ayende.com/4465/that-no-sql-thing-the-relational-modeling-anti-pattern-in-document-databases#comment8</link><guid>http://ayende.com/4465/that-no-sql-thing-the-relational-modeling-anti-pattern-in-document-databases#comment8</guid><pubDate>Tue, 20 Apr 2010 21:46:19 GMT</pubDate></item><item><title>Ayende Rahien commented on That No SQL Thing: The relational modeling anti pattern in document databases</title><description>Tyler,
  
The right way certainly include no shemales.
</description><link>http://ayende.com/4465/that-no-sql-thing-the-relational-modeling-anti-pattern-in-document-databases#comment7</link><guid>http://ayende.com/4465/that-no-sql-thing-the-relational-modeling-anti-pattern-in-document-databases#comment7</guid><pubDate>Tue, 20 Apr 2010 20:37:03 GMT</pubDate></item><item><title>Tyler Burd commented on That No SQL Thing: The relational modeling anti pattern in document databases</title><description>Ha.  I mistook one sentence for "Oh, we may gain some small benefit by being *shemales*".
  
  
Can't wait to see the "right" way post.
</description><link>http://ayende.com/4465/that-no-sql-thing-the-relational-modeling-anti-pattern-in-document-databases#comment6</link><guid>http://ayende.com/4465/that-no-sql-thing-the-relational-modeling-anti-pattern-in-document-databases#comment6</guid><pubDate>Tue, 20 Apr 2010 20:22:37 GMT</pubDate></item><item><title>Demis Bellot commented on That No SQL Thing: The relational modeling anti pattern in document databases</title><description>@Ayende I see you've articulated it being the 'wrong' way to try to replace a RDBMS solution but my conclusion I've drawn from the wording of your original post is that blog posts do not belong in a NoSQL database but are rather best  left in an RDBMS, not that a more ideal solution was already written and in your future post queue (which I still don't understand how people can blog so much that they have a future post-queue, as once a month takes enough time out of me :).
  
  
&gt;&gt; it is like saying getting punched in the gut it better than being shot, I would rather avoid both
  
I assume by this that you have a more appropriate solution forthcoming, I would still be doing bi-directional referencing in NoSQL databases but am looking forward to your proposed solution as well.
</description><link>http://ayende.com/4465/that-no-sql-thing-the-relational-modeling-anti-pattern-in-document-databases#comment5</link><guid>http://ayende.com/4465/that-no-sql-thing-the-relational-modeling-anti-pattern-in-document-databases#comment5</guid><pubDate>Tue, 20 Apr 2010 15:09:33 GMT</pubDate></item><item><title>Ayende Rahien commented on That No SQL Thing: The relational modeling anti pattern in document databases</title><description>Edin,
  
Of course you can, in fact, look at the future posts queue
</description><link>http://ayende.com/4465/that-no-sql-thing-the-relational-modeling-anti-pattern-in-document-databases#comment4</link><guid>http://ayende.com/4465/that-no-sql-thing-the-relational-modeling-anti-pattern-in-document-databases#comment4</guid><pubDate>Tue, 20 Apr 2010 13:39:56 GMT</pubDate></item><item><title>Ayende Rahien commented on That No SQL Thing: The relational modeling anti pattern in document databases</title><description>Demis,
  
You did notice all the warning about this being the WRONG way about it, right?
  
  
Yes, I am using Raven's querying ability to sort of make it work, but I don't really like the solution.
  
  
There is no need to do a bidirectional association here with tag/posts, by the way, I outline how to do this in tomorrow's post.
  
I talk a lot about setting up the indexes based on your needs then.
  
  
And I don't want to talk about advantages based on this model, it is like saying that getting punched in the gut it better than being shot, I would rather avoid both
</description><link>http://ayende.com/4465/that-no-sql-thing-the-relational-modeling-anti-pattern-in-document-databases#comment3</link><guid>http://ayende.com/4465/that-no-sql-thing-the-relational-modeling-anti-pattern-in-document-databases#comment3</guid><pubDate>Tue, 20 Apr 2010 13:39:31 GMT</pubDate></item><item><title>Edin commented on That No SQL Thing: The relational modeling anti pattern in document databases</title><description>I guess, we can expect another post explaining how to actually do correct design. If a DocDb is used the way you described above, I really don't see any benefit of it. OK, maybe speed. 
  
  
I think that Demis kind of showed some directions by saying that posts could be stored in sorted set and ordered by date. Also, I like the idea of 2-way link between tags and posts. 
</description><link>http://ayende.com/4465/that-no-sql-thing-the-relational-modeling-anti-pattern-in-document-databases#comment2</link><guid>http://ayende.com/4465/that-no-sql-thing-the-relational-modeling-anti-pattern-in-document-databases#comment2</guid><pubDate>Tue, 20 Apr 2010 12:44:11 GMT</pubDate></item><item><title>Demis Bellot commented on That No SQL Thing: The relational modeling anti pattern in document databases</title><description>I think your solution is very much tied to RavenDB because your trying to use querying abilities built into the api.
  
  
In other NoSql db's that support rich data constructs (e.g. Redis, MongoDb etc), the way I'd achieve the same result is by storing posts in a sorted set ordered by date.
  
For anywhere I require a reference, I would create a 2-way link (i.e. bi-directional reference) storing the tag with the post and at the same time a list of posts with each tag the post has. That way you can query both indexes for the tags a particular post has as well as all posts matching a particular tag.
  
  
This just goes back to the general NoSQL mindset you should have where you need to know what querying functionality you require up front so at the time you're storing data you can update the 'query indexes' accordingly.
  
  
Other benefits you've missed is the speed increase which depending on your situation allows you to dispense of any caching logic or real-time/accuracy of the data your displaying.
  
Antirez (the author of Redis) has an interesting post on his VM solution in which he talks about the Redis Virtual Machine implementation where Redis is like a 'Reversed Mysql+Memcached solution'. Where the data you frequently access is kept in memory and the Least Recently Used items are swapped out to disk:
  
[antirez.com/post/redis-virtual-memory-story.html](http://antirez.com/post/redis-virtual-memory-story.html)  
</description><link>http://ayende.com/4465/that-no-sql-thing-the-relational-modeling-anti-pattern-in-document-databases#comment1</link><guid>http://ayende.com/4465/that-no-sql-thing-the-relational-modeling-anti-pattern-in-document-databases#comment1</guid><pubDate>Tue, 20 Apr 2010 11:41:50 GMT</pubDate></item></channel></rss>