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

The Archive Base Latest Questions

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

I have to choose a database for implementing a sharing system. My system will

  • 0

I have to choose a database for implementing a sharing system.

My system will have users and documents. I have to share a document with a few users.


Example:
There are 2 users, and there is one document.

So if I have to share that one document with both the users, I could do these possible solutions:

The current method I’m using is with MySQL (I don’t want to use this):

Relational Databases (MySQL)
    Users Table = user1, user2
    Docs Table = doc1
    Docs-User Relation Table = doc1, user1
                               doc1, user2

And I would like to use something like this:

NoSQL Document Stores (MongoDB)
    Users Documents:
        {
            _id: user1,
            docs_i_have_access_to: {doc1}
        }
        {
            _id: user2,
            docs_i_have_access_to: {doc1}
        }
    Document's Document:
        {
            _id: doc1
            members_of_this_doc: {user1, user2}
        }

And I don’t yet know how I would implement in a key-value store like Redis.

So I just wanted to know, would the MongoDB way I have given above, the best solution?
And is there any other way I could implement this? Maybe with another database solution?
Should I try to implement it with Redis or not?

Which database and which method should I choose and will be the best to share the data and why?

Note: I want something highly scalable and persistent. 😀

Thanks. 😀

  • 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:22:48+00:00Added an answer on June 5, 2026 at 7:22 pm

    Actually, you need to represent a many-to-many relationship. One user can have several documents. One document can be shared among several users.

    See my previous answer to this question: how to have relations many to many in redis

    With Redis, representing relationship with the set datatype is a pretty common pattern. You can expect to get better performance than with MongoDB for this kind of data model. And as a bonus, you can easily and efficiently find which users have a given list of documents in common, or which documents are shared by a given set of users.

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

Sidebar

Related Questions

I have to choose the structure of a database that will store content types
I need to write some data in several database. I choose sqlapi.com I have
I have to open a file dialog. In that I have to choose one
I don't know anything about either library but I have to choose one of
I am implementing a contest system in which the user has to choose the
Is it possible to choose a specific database that will be used with the
I am working on WPF application, and now I have to choose which database
I have a project requirement to choose a light database for the application. It's
I am using System.Data.Sqlite to access SQLite database in C#. I have a query
I have a case where I wanna choose any database entry that have an

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.