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

  • SEARCH
  • Home
  • 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 9312525
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 19, 20262026-06-19T01:39:05+00:00 2026-06-19T01:39:05+00:00

I am trying to model the following data model in Cassandra: Business – primary

  • 0

I am trying to model the following data model in Cassandra:

Business – primary key : BusinessId

Has Many Reviews - primary key : ReviewId
   - Review 1
        - Body
        - Rating
   - Review 2
        - Body
        - Rating 
   and so on
Has an Address
  - State
  - City
  - Zip
Has Business Hours
  - Monday Hours
  - Tuesday Hours
  and so on
Has Offers
  - Offer1
  - Offer2
  and so on

I want to be able to extract all this information using one query, i.e. I want to store this in one business row. How can I do this? Essentially, I have many child entities that I want to store along with the parent business entity. From what I understand about composite keys, you can only have one composite key (ex) businessId:ReviewId to model reviews), but how do I store all these entities in one single row to efficiently retrieve all the business details in one query.

My second question is regarding updates. Suppose only one of these entities (Reviews) gets updated frequently. The other entities mostly remain static. Is it advisable to separate the reviews from this giant business row, or can I update reviews without getting the entire business row in memory?

  • 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-19T01:39:07+00:00Added an answer on June 19, 2026 at 1:39 am

    You can accomplish what you’re trying to do using a traditional schema-less Thrift-based query model. Your data model could look like this:

    Key: ReviewID {
      Review:1:Body = ""
      Review:1:Rating = 1
      Review:2:Body = ""
      Review:2:Rating = 1
      Address:1:City = ""
      Address:1:State = ""
      Address:1:Zip = ""
      Hours:1:Monday = ""
      Hours:1:Tuesday = ""
      Offer:1:[fieldName] = ""
      Offer:2:[fieldName] = ""
    }
    

    The schema for this would be Composite(Utf8Type, IntegerType, Utf8Type) with whatever key type matches your ReviewID and whatever value type matches your values (can be bytes if you have disparate types).

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

Sidebar

Related Questions

Hi I'm trying to create a follower-following model (like Twitter) in Core Data. Maybe
I am trying to load json data into the following model using findAll: App.Territory
I am trying to model this relationship following this link http://www.javaworld.com/javaworld/jw-01-2008/images/datamodel.gif Its the usual
I am trying to create a mapping file for the following Model using Fluent
I am trying to design model associations in rails that consist of the following
I'm trying to create a Django model that handles the following: An Item can
I'm trying to do something like the following: @special_attributes = Model.new.methods.select # a special
I'm trying to model a class that has a method with a variable argument
I am trying to load simple data from a model using Core Data and
I'm trying to get django to serve CSV data from a Model to generate

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.