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 6583635
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T16:26:05+00:00 2026-05-25T16:26:05+00:00

This is my first project using a NoSQL database and I am wondering how

  • 0

This is my first project using a NoSQL database and I am wondering how to structure my data in the most efficient way.

I am making a small service which stores all songs played by a radio station. Users can “like” the songs. So, basically I have the following data:

Song: Id, Artist, Title
Play: SongId, Time (when was the song played)
Like: SongId, UserName, Time (when did the user click the like button)

I need to run various queries on that data. For example: last X songs played + like count, top played songs in the last X days, who liked a specific song etc.

First I was thinking about storing everything in a single document with nested play and like information. But this makes some of the queries quite complicated and requires me to do stuff like sorting on the client side but I would like to keep the amount of data transfered from the database small.

I was also thinking about caching some of the most used queries in memory. Are there any general recommendations when doing something like that?

  • 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-05-25T16:26:06+00:00Added an answer on May 25, 2026 at 4:26 pm

    Since the number of songs, number of plays, number of users are all going to be large, using embedded documents for any of them isn’t going to work so you are forced somewhat to go back to a more relational model and have a collection for each.

    What I would denormalize is to put the song information into the Play document and into the Like document so you can render the playlist and the likes for any user without having to do any ‘joins’ back to the Song collection.

    Song: Id, Artist, Title
    Play: SongId, Time (when was the song played), Artist, Title
    Like: SongId, UserName, Time (when did the user click the like button), Artist, Title, UserId

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

Sidebar

Related Questions

This is my first project that i need to use some database ( using
Newbie to ruby this is my first project I am using the FasterCSV Gem
This is my first serious project using NHibernate and I have setup log4net to
This is the first project by me which is using MongoDB. I have hosted
Okay, so this is my first project using PHP and MySQL and I thought
This is my first project using StructureMap, it is an MVC web app and
This is my first project using PHP and I've been stuck on this for
Progressbar and Caliburn Micro Hello All, This is my first project using Caliburn so
I'm developing a web application using Wicket+Spring+JPA+Hibernate. This is my first project with this
This is my first time doing this sort of project so apologies if the

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.