apache / apache/cassandra-gocql-driver

Token ring awareness API

Open
#356 20 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Go
Stars
2.7k
Forks
658
PR merge metrics
No merged PRs in 30d

Description

Some CQL drivers are token aware and make the token ring available, for example so that we could ask it "what endpoints have this partition/token?" (like nodetool getendpoints).

Examples:
- Python: http://datastax.github.io/python-driver/api/cassandra/metadata.html#tokens-and-ring-topology
- Java: http://www.datastax.com/drivers/java/2.1/com/datastax/driver/core/Metadata.html

My particular use case: Go and Cassandra go together great with the help for gocql, and I would like to use gocql to do some batch-like processing over cassandra data. Spark et al are great for these but don't provide Go interfaces. Moreover my usecase actually doesn't take much advantage of the Spark/MapReduce paradigm, I really only want the data gravity aspect of it (moving compute close to data).

What would work well for me is to be able to run services (written in go) out on the cassandra nodes that have the capability of taking a given token and asking gocql "which hosts own this token"?, so that I can read locally for that token if this node has it and ignore that token if it doesn't. Then I can use my own orchestration mechanism to run these services on all Cassandra nodes and greatly cut down on on network congestion and latency.

A simple call like "which hosts/IPs own token X" or "does host Y own token X" would do the trick here and make is easy for gocql users to move computation close to their data.

Contributor guide

Open the contributing guide

Research direction

Start by reviewing gocql's existing metadata and token-ring handling, using the Python and Java driver references in the issue as API comparisons. Done means callers can ask which hosts own a token, or whether a specific host owns it, with behavior that supports local computation on Cassandra nodes.

Written by the indexing model from the issue text.

Assessment

Tech stack
cassandra, go
Domain
backend-api-design, databases
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.