Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8091125
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T19:57:48+00:00 2026-06-05T19:57:48+00:00

In CassandraDB, using an ordered column family. I know you can get slices, but

  • 0

In CassandraDB, using an ordered column family. I know you can get slices, but can you get the position. For example, in this datamodel I save scores like this:

"Scores":
{
   "1000": "bob, lucas",
   "900": "tim"
   "800": "mario"
}

Is it possible, knowing that the user has a score of “900” and his nick is “tim”, to know that he is at position 2 of the ordered column family?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T19:57:49+00:00Added an answer on June 5, 2026 at 7:57 pm

    Cassandra does not provide this functionality out of the box, but you could implement this yourself using three separate CFs. Consider this scenario:

    "Scores":
    {
       "1000": "bob, lucas"
       "900": "tim"
       "800": "mario"
    }
    
    "PlayerScores":
    {
       "bob": "1000"
       "lucas": "1000"
       "tim": "900"
       "mario": "800"
    }
    
    "ScoreTotals":
    {
       "1000": 
       {
          "1000":2
       }
       "900": 
       {
          "900":1
       }
       "800": 
       {
          "800":1
       }
    }
    

    The ScoreTotals CF would be used with counter columns to increment/decrement the value each time a user achieves that score. If you have additional granularity in your scores (like 910 vs an even 900) you can consider the keys as buckets with column names as specific scores. PlayerScores obviously exists so you can query a score for a player.

    You can then determine ranking by simply summing the totals of all scores greater than that of the player. Since scores are stored in column names, you can use a standard slice query to get your range without needing to use an order-preserving partitioner (which has some negative side effects).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How can i get the keys of the column having sex = male. Using
I need to get a maximal key of a column family an cassandra database
I want to create copy of Column Family with another name in Cassandra using
I would like to start using Cassandra with a node.js deployment, but I can't
I am aware of Twissandra which is an example twitter clone using Cassandra but
Using two databases to illustrate this example: CouchDB and Cassandra . CouchDB CouchDB uses
I've been using cassandra-cli and have been trying to create a column family with
I have a problem of using Cassandra, I can start it with bin/cassandra, but
i am using cassandra-jdbc to perform the operation on data in cassandra but when
I'm going to write the web portal using Cassandra databases. Can you advise me

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.