You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by Robert Wille <rw...@fold3.com> on 2014/10/14 14:39:52 UTC

LOCAL_* consistency levels

I’m wondering if there’s a best practice for an annoyance I’ve come across.

Currently all my environments (dev, staging and live) have a single DC. In the future my live environment will most likely have a second DC. When that happens, I’ll want to use LOCAL_* consistency levels. However, if I write my code with LOCAL_* consistency levels, an exception is thrown. I’ve forgotten the exact verbiage, but its something about having a NetworkTopologyStrategy that doesn’t support local consistency levels. t don’t really want to change all my queries when I have a second DC, nor do I want to check my environment for every query. Is there a nice way to use LOCAL_* consistency levels and have Cassandra do the appropriate thing when there is a single DC?

Thanks in advance

Robert


Re: LOCAL_* consistency levels

Posted by graham sanderson <gr...@vast.com>.
There were some versions of C* that didn’t allow you to use LOCAL_* and a single DC NetworkTopologyStrategy, or with SimpleTopologyStrategy.

https://issues.apache.org/jira/browse/CASSANDRA-6238 I think

You should use a NetworkTopologyStrategy with one DC for now.

On Oct 14, 2014, at 7:39 AM, Robert Wille <rw...@fold3.com> wrote:

> I’m wondering if there’s a best practice for an annoyance I’ve come across.
> 
> Currently all my environments (dev, staging and live) have a single DC. In the future my live environment will most likely have a second DC. When that happens, I’ll want to use LOCAL_* consistency levels. However, if I write my code with LOCAL_* consistency levels, an exception is thrown. I’ve forgotten the exact verbiage, but its something about having a NetworkTopologyStrategy that doesn’t support local consistency levels. t don’t really want to change all my queries when I have a second DC, nor do I want to check my environment for every query. Is there a nice way to use LOCAL_* consistency levels and have Cassandra do the appropriate thing when there is a single DC?
> 
> Thanks in advance
> 
> Robert
>