﻿<?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 RavenDB Sharding&amp;ndash;Data Driven Sharding</title><description>Jack,
In this example, I intentionally picked something that you can relate to. Most of the time, you would do data driven sharding to a set of shards that aren't really pre-selected.
In those cases, yes, you won't have the "shard does not exists" issue, but for our purposes in this blog post, having a European customer means that we need a European data center, so we fail.</description><link>http://ayende.com/155329/ravendb-sharding-data-driven-sharding#comment18</link><guid>http://ayende.com/155329/ravendb-sharding-data-driven-sharding#comment18</guid><pubDate>Fri, 23 Mar 2012 06:47:25 GMT</pubDate></item><item><title>Jack Jones commented on RavenDB Sharding&amp;ndash;Data Driven Sharding</title><description>In the "Europe" case, doesn't the fact that it throws violate the "safe by default" premise?  This means that I can't just run what would be an otherwise normal data creation and save without knowing the sharding strategy.  Shouldn't it just pick a shard and succeed?  I fully recognize that this is a terribly difficult problem if you want to be able the handle changes after the fact, but at face value it seems to go against one of your core beliefs.</description><link>http://ayende.com/155329/ravendb-sharding-data-driven-sharding#comment16</link><guid>http://ayende.com/155329/ravendb-sharding-data-driven-sharding#comment16</guid><pubDate>Fri, 23 Mar 2012 01:29:53 GMT</pubDate></item><item><title>dotnetchris commented on RavenDB Sharding&amp;ndash;Data Driven Sharding</title><description>Reasonable answer, in the scope of this example it would be understandable if you had to pick the region to view companies first.</description><link>http://ayende.com/155329/ravendb-sharding-data-driven-sharding#comment15</link><guid>http://ayende.com/155329/ravendb-sharding-data-driven-sharding#comment15</guid><pubDate>Wed, 21 Mar 2012 15:30:10 GMT</pubDate></item><item><title>Ayende Rahien commented on RavenDB Sharding&amp;ndash;Data Driven Sharding</title><description>dotnetchris,
In that case, we have an extension point for you to plug things in, but in a sharded env, that is decidedly non trivial.
What is more likely is that we will show you a page with lists from each shard, which is much easier and more effective.


Consider the case when you have 10,000 companies, and you want to go to page 5 in the overall list, what is the total cost?
That is why we don't try, because that would be hiding something very important.</description><link>http://ayende.com/155329/ravendb-sharding-data-driven-sharding#comment14</link><guid>http://ayende.com/155329/ravendb-sharding-data-driven-sharding#comment14</guid><pubDate>Wed, 21 Mar 2012 14:34:39 GMT</pubDate></item><item><title>dotnetchris commented on RavenDB Sharding&amp;ndash;Data Driven Sharding</title><description>"We decided that paged sharded queries are something that we are going to leave out of it"

So what would you do if you wanted to provide a list of EVERY Company? Need to call all 3 document stores manually and deal with paging manually that after you reach the end of 1 store, to goto the next store and not support any type of sorting?</description><link>http://ayende.com/155329/ravendb-sharding-data-driven-sharding#comment13</link><guid>http://ayende.com/155329/ravendb-sharding-data-driven-sharding#comment13</guid><pubDate>Wed, 21 Mar 2012 13:40:22 GMT</pubDate></item><item><title>Ayende Rahien commented on RavenDB Sharding&amp;ndash;Data Driven Sharding</title><description>Configurator &amp; Rafal,
Right now, we support the first page natively, including sorting and merging the results.
But we don't support deeper than that, because of this issue. Consider the case when we have 25 results per page, and we want to go to page 3, we would have to query for 225 results, to show just 25, and it gets worse quite fast.
We decided that paged sharded queries are something that we are going to leave out of it, because we don't have a way to provide enough information there to decide, and it is better if the user run into those issues ASAP, rather than run into them at a large data set.

We don't consider this much of a problem, because RavenDB's sharding encourage a strong locality of reference, so most of the time, sharded queries will hit only a single server.</description><link>http://ayende.com/155329/ravendb-sharding-data-driven-sharding#comment12</link><guid>http://ayende.com/155329/ravendb-sharding-data-driven-sharding#comment12</guid><pubDate>Wed, 21 Mar 2012 07:52:15 GMT</pubDate></item><item><title>Ayende Rahien commented on RavenDB Sharding&amp;ndash;Data Driven Sharding</title><description>Simon,
In this case, I am using shard names with a meaning, yes.
You can also decide that you want to shard by region, but the shard names are meaningless, therefor you use a transformation between the region to the shard name as well.</description><link>http://ayende.com/155329/ravendb-sharding-data-driven-sharding#comment11</link><guid>http://ayende.com/155329/ravendb-sharding-data-driven-sharding#comment11</guid><pubDate>Wed, 21 Mar 2012 07:48:11 GMT</pubDate></item><item><title>Rafal commented on RavenDB Sharding&amp;ndash;Data Driven Sharding</title><description>configurator, I was asking the same question yesterday because I'm quite curious how far does RavenDB client go to hide the sharding from the user
BTW, is anyone doing sharding with RavenDB in a real application? </description><link>http://ayende.com/155329/ravendb-sharding-data-driven-sharding#comment10</link><guid>http://ayende.com/155329/ravendb-sharding-data-driven-sharding#comment10</guid><pubDate>Tue, 20 Mar 2012 19:51:52 GMT</pubDate></item><item><title>configurator commented on RavenDB Sharding&amp;ndash;Data Driven Sharding</title><description>What happens if we query for, say, the third page with pageSize = 10?
Clearly the client can't ask each shard for just the third page, as the first item in shard B can be on page three when merging with shard A - naively, we'd have to query for 30 items from each shard and do the paging locally.</description><link>http://ayende.com/155329/ravendb-sharding-data-driven-sharding#comment9</link><guid>http://ayende.com/155329/ravendb-sharding-data-driven-sharding#comment9</guid><pubDate>Tue, 20 Mar 2012 18:25:01 GMT</pubDate></item><item><title>morcs commented on RavenDB Sharding&amp;ndash;Data Driven Sharding</title><description>Got it, thanks</description><link>http://ayende.com/155329/ravendb-sharding-data-driven-sharding#comment8</link><guid>http://ayende.com/155329/ravendb-sharding-data-driven-sharding#comment8</guid><pubDate>Tue, 20 Mar 2012 17:39:29 GMT</pubDate></item><item><title>Matt Warren commented on RavenDB Sharding&amp;ndash;Data Driven Sharding</title><description>@morcs, when using Include(..) in a Query you have to specify the name of the fields that holds the "reference" to another doc, see http://ayende.com/blog/4584/ravendb-includes</description><link>http://ayende.com/155329/ravendb-sharding-data-driven-sharding#comment7</link><guid>http://ayende.com/155329/ravendb-sharding-data-driven-sharding#comment7</guid><pubDate>Tue, 20 Mar 2012 15:41:15 GMT</pubDate></item><item><title>morcs commented on RavenDB Sharding&amp;ndash;Data Driven Sharding</title><description>Ayende, thanks! Is that also how the query "Include" method works? That was bugging me also :)</description><link>http://ayende.com/155329/ravendb-sharding-data-driven-sharding#comment6</link><guid>http://ayende.com/155329/ravendb-sharding-data-driven-sharding#comment6</guid><pubDate>Tue, 20 Mar 2012 14:08:03 GMT</pubDate></item><item><title>Simon commented on RavenDB Sharding&amp;ndash;Data Driven Sharding</title><description>Ayende, I may have missed something, but yesterday the name of the shard didn't seem important.  Does it only become important once you specify the strategy?  And then how does it now the name relates to Company.Region not Invoice.CompanyId?

Or should I wait for the docs to be updated? :-)</description><link>http://ayende.com/155329/ravendb-sharding-data-driven-sharding#comment5</link><guid>http://ayende.com/155329/ravendb-sharding-data-driven-sharding#comment5</guid><pubDate>Tue, 20 Mar 2012 13:39:17 GMT</pubDate></item><item><title>Ayende Rahien commented on RavenDB Sharding&amp;ndash;Data Driven Sharding</title><description>Marco,
That would throw an error, because we don't have a matching shard for this.
You can say that Europe goes to another shard, of course, but that is up to you.</description><link>http://ayende.com/155329/ravendb-sharding-data-driven-sharding#comment4</link><guid>http://ayende.com/155329/ravendb-sharding-data-driven-sharding#comment4</guid><pubDate>Tue, 20 Mar 2012 13:13:43 GMT</pubDate></item><item><title>Ayende Rahien commented on RavenDB Sharding&amp;ndash;Data Driven Sharding</title><description>Morcs,
It does not, that is all the beauty in it :-)
What actually happens is that we use conventions to figure out that this is likely to be a reference, and then we figure out what the relevant shard is for the company.</description><link>http://ayende.com/155329/ravendb-sharding-data-driven-sharding#comment3</link><guid>http://ayende.com/155329/ravendb-sharding-data-driven-sharding#comment3</guid><pubDate>Tue, 20 Mar 2012 13:12:53 GMT</pubDate></item><item><title>morcs commented on RavenDB Sharding&amp;ndash;Data Driven Sharding</title><description>Something I've missed (and I'm sure it's a stupid question!) but how does Raven DB know that Invoice.CompanyId represents a reference to a Company, rather than just any old plain string?</description><link>http://ayende.com/155329/ravendb-sharding-data-driven-sharding#comment2</link><guid>http://ayende.com/155329/ravendb-sharding-data-driven-sharding#comment2</guid><pubDate>Tue, 20 Mar 2012 13:01:53 GMT</pubDate></item><item><title>Marco commented on RavenDB Sharding&amp;ndash;Data Driven Sharding</title><description>Nice! But what will happen if you save a company with the region "Europe"? where is that company saved?</description><link>http://ayende.com/155329/ravendb-sharding-data-driven-sharding#comment1</link><guid>http://ayende.com/155329/ravendb-sharding-data-driven-sharding#comment1</guid><pubDate>Wed, 14 Mar 2012 18:46:16 GMT</pubDate></item></channel></rss>