﻿<?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>Steve Py commented on API Design: Sharding Status for failure scenarios</title><description>Not sure I follow, but if this is a "how do I handle multiple ways to skin a cat" then my response would be "pick one". if you can do the same kind of thing with Load as with Query then the design should standardize on using one or the other.

If Load is used for more direct calls to retrieve single specific records by key, then that's a different scenario and if Session decides it needs an offline shard for the record you want, then feed the caller an exception. 

Query results: Here you go, but know that some of the data was not available.
Load a record: Sorry, that data is not available. </description><link>http://ayende.com/155809/api-design-sharding-status-for-failure-scenarios#comment8</link><guid>http://ayende.com/155809/api-design-sharding-status-for-failure-scenarios#comment8</guid><pubDate>Thu, 31 May 2012 07:23:05 GMT</pubDate></item><item><title>Ayende Rahien commented on API Design: Sharding Status for failure scenarios</title><description>Steve,
Now what happens when you do a Load instead of Query?</description><link>http://ayende.com/155809/api-design-sharding-status-for-failure-scenarios#comment7</link><guid>http://ayende.com/155809/api-design-sharding-status-for-failure-scenarios#comment7</guid><pubDate>Wed, 30 May 2012 07:33:07 GMT</pubDate></item><item><title>Steve Py commented on API Design: Sharding Status for failure scenarios</title><description>To throw something out there: I'm assuming that session.Query() returns IEnumerable. Extend IEnumerable into something like IIncompleteEnumerable which includes a Reason and/or Exception. Consumers should use methods to consume the results by either IIncompleteEnumerable or IEnumerable with the former handing off to the later once it takes action with the reason. (prompt the user, fire off an e-mail, what-have-you)

Unfortunately I believe you will always run into the case where such a scenario will either be "in your face" in the sense of blocking the application, or easily ignored by accident. Can you have your cake and eat it too?</description><link>http://ayende.com/155809/api-design-sharding-status-for-failure-scenarios#comment6</link><guid>http://ayende.com/155809/api-design-sharding-status-for-failure-scenarios#comment6</guid><pubDate>Tue, 29 May 2012 22:27:16 GMT</pubDate></item><item><title>Andrew Armstrong commented on API Design: Sharding Status for failure scenarios</title><description>I'd imagine for some results you could do with a missing shard server (eg, no specific order or limit), however I assume you may need to indicate to RavenDB that inconsistent results are permitted.</description><link>http://ayende.com/155809/api-design-sharding-status-for-failure-scenarios#comment5</link><guid>http://ayende.com/155809/api-design-sharding-status-for-failure-scenarios#comment5</guid><pubDate>Tue, 29 May 2012 06:50:58 GMT</pubDate></item><item><title>Christopher Wright commented on API Design: Sharding Status for failure scenarios</title><description>If a third of the data isn't available, you return the top 20 results of what you still have.

In order to implement a query like this with an unknown shard strategy, each server needs to return 20 results. If you try getting clever, you either need to be really clever (and probably lose out in efficiency in the end, unless you precompute appreciably), or you end up returning stuff in the wrong order sometimes.

If you're using a shard strategy which lines up with your query ordering, and have been since the beginning of time with the same number of nodes (or you rebalanced recently), you can actually query ceil(Take / #nodes) from each node. This doesn't come into play here in any case; PublishedAt is not related to insertion order. It also doesn't matter much if you have a small number of not terribly huge documents -- though here, if you have a very popular blog, you might get several hundred comments per post, so it might be worthwhile.</description><link>http://ayende.com/155809/api-design-sharding-status-for-failure-scenarios#comment4</link><guid>http://ayende.com/155809/api-design-sharding-status-for-failure-scenarios#comment4</guid><pubDate>Mon, 28 May 2012 14:44:18 GMT</pubDate></item><item><title>Paul Stovell commented on API Design: Sharding Status for failure scenarios</title><description>@Simon, since RavenDB uses HTTP you can probably achieve that monitoring using any HTTP monitoring solution. </description><link>http://ayende.com/155809/api-design-sharding-status-for-failure-scenarios#comment3</link><guid>http://ayende.com/155809/api-design-sharding-status-for-failure-scenarios#comment3</guid><pubDate>Mon, 28 May 2012 10:38:08 GMT</pubDate></item><item><title>Simon Hughes commented on API Design: Sharding Status for failure scenarios</title><description>This should be configurable IMHO. Either:
* Return what you can for the above select, or
* Return nothing.
There should be some sort of DB and Shard monitor that checks to make sure its online and working ok, and warn admins if its off-line via SMS/Email/etc.</description><link>http://ayende.com/155809/api-design-sharding-status-for-failure-scenarios#comment2</link><guid>http://ayende.com/155809/api-design-sharding-status-for-failure-scenarios#comment2</guid><pubDate>Mon, 28 May 2012 09:26:44 GMT</pubDate></item><item><title>Phillip Haydon commented on API Design: Sharding Status for failure scenarios</title><description>:( Sometimes I wish your blog posts weren't broken up into 15 posts, by the time it get's to the good stuff I've forgotten the rest and/or lost interest.</description><link>http://ayende.com/155809/api-design-sharding-status-for-failure-scenarios#comment1</link><guid>http://ayende.com/155809/api-design-sharding-status-for-failure-scenarios#comment1</guid><pubDate>Mon, 28 May 2012 09:16:16 GMT</pubDate></item></channel></rss>