Back

Simulate Relational Using NoSQL

  • 1
  • Self Hosted
  • Databases
  • Web
შონია
28 Jul, 2024, 11:20

Please, can you provide a way to somehow simulate relational db?

TL;DR
Developers want to simulate relational database using NoSQL for a carpooling app. They are using Next.js, Flutter, and Appwrite. Users can be drivers or passengers, have trips, reviews, and cars. They want to maintain privacy levels for user data. For a solution: - Keep public, semi-public, and private data distinctions. - Separate sensitive information like phone numbers and emails from main user collection. - Define relationships between collections (e.g. one user can have multiple cars).
შონია
28 Jul, 2024, 11:20

@Joshi

შონია
28 Jul, 2024, 11:21

@Misho

Misho
28 Jul, 2024, 11:21
Misho
28 Jul, 2024, 11:22
Joshi
28 Jul, 2024, 11:22

Can you post collections and how they are related to each other like one user can have many cary etc. I'll respond later. Going to eat now

შონია
28 Jul, 2024, 11:22

Yes, we will drop it here, thanks!

Misho
28 Jul, 2024, 11:22
Misho
28 Jul, 2024, 11:22
Misho
28 Jul, 2024, 11:23

Cars

Joshi
28 Jul, 2024, 11:24
  • tell me who is allowed to access what data
Misho
28 Jul, 2024, 11:24
Misho
28 Jul, 2024, 11:24
Misho
28 Jul, 2024, 11:25

Ride

Joshi
28 Jul, 2024, 11:30

Just to give you a brief overview for now how I model one of my projects user depending on the requirements. Public = Any user in the project is allowed to access it Semi-Public = Any user who is granted access by the user who created it will have access to it Private = Only the user who it belongs to can access it

This is also the reason why I split up phone and email instead of attaching it to the user collection. Because other users can access it and in some cases the user does not want to reveal his/her phone number or email address to everyone. Same for profile image. The user can make it private so only he can see it, open to friends or public.

Joshi
28 Jul, 2024, 11:30

I'll go eat now and respond later

შონია
28 Jul, 2024, 11:30

So, we are creating a carpooling app using Next.js + Flutter + Appwrite. There is a user which can get permission to post a ride (after they send the DriverVerificationRequest). A user can be Passenger or Driver. Passengers will have their Trips (rides list as a passenger) or rides (rides where he/she was a driver). Each user can give review to another so we have reviews who was written by others and reviews that was written by this to other people. Driver can have Multiple cars, one car can be belonged to only one driver. There are also rules like "smoking allowed", "pets allowed..." etc. We have some cardinalities like 1:1 , N:M, 1:N and thought it would be much easier to use Relational Mechanism instead of NoSQL, please if you can somehow, we would appreciate it! ❤️ ❤️

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more