noahlz
noahlz

Reputation: 10311

Cassandra as an embedded service and with custom consistency level

I am thinking of building an application that uses Cassandra as its data store, but has low latency requirements. I am aware of EmbeddedCassandraService from this blog post

Is the following implementation possible and what are known pitfalls (defects, functional limitations)?

1) Run Cassandra as an embedded service, persisting data to disk (durable).

2) Java application interacts with local embedded service via one of the following. What are the pros

3) Java application interacts with remote Cassandra service ("backup" nodes) via Thrift (or Avro?).

4) Write must always succeed to the local embedded Cassandra service in order to be successful, and at least one of the remote (non-embedded) Cassandra nodes. Is this possible? Is it possible to define a custom / complex consistency level?

5) Side-question: Cassandra: The Definitive Guide mentions in several places that Thrift will ultimately be replaced with Avro, but seems like that's not the case just yet?

As you might guess, I am new to Cassandra, so any direction to specific documentation pages (not the wiki homepage) or sample projects are appreciated.

Upvotes: 1

Views: 726

Answers (1)

rs_atl
rs_atl

Reputation: 8985

Unless your entire database is sitting on the local machine (i.e. a single node), you gain nothing by this configuration. Cassandra will shard your data across the cluster, so (as mentioned in one of the comments) your writes will frequently be made to another node that owns the data. Presuming you write with a consistency level of at least one, your call will block until that other node acks the write. This negates any benefit of talking to the embedded instance since you have some network latency anyway.

Upvotes: 1

Related Questions