Back

Is it efficient to create multiple databases?

  • 0
  • Databases
  • Flutter
Chandan Gowda
5 Jul, 2023, 08:04

I am developing a an audio conferencing app and would be using appwrite to manage room actions, participant list etc. Will it be efficient if I create a separate database for each room ?

TL;DR
The user is asking if it is efficient to create multiple databases for a clubhouse-like app. The general consensus in the thread is that creating multiple databases is not efficient. Instead, it is suggested to organize the data within a single database using collections and arrays. It is also recommended to use the teams API to group users and manage permissions. No specific solution is provided, but the user is advised against creating separate databases for each room.
_lk_7t2_
5 Jul, 2023, 10:12

I don't think it's necessary to create a database for each room

_lk_7t2_
5 Jul, 2023, 10:17

I don't know what is your entities but let suppose you have a room , and each rooms have ( obviously ) participant list

You can just have a room collection and inside the room attributes you will have an array to store each users who have access to this specific room

_lk_7t2_
5 Jul, 2023, 10:23

You can also group users of a room by using teams API

And with this if there are documents which only this team should have access to you just add the corresponding permission to the document when creating

_lk_7t2_
5 Jul, 2023, 10:26

It's just some ideas on how to organize , it may be not 100% fit on what you're trying to do ( since I don't have a precise idea on the complete project )

But generally if your dB design ends up by creating new databases or collections at run-time , you're probably doing something wrong or looking in the wrong direction

D5
5 Jul, 2023, 13:36

Simple answer, it's not efficient

Chandan Gowda
6 Jul, 2023, 03:01

Thanks @lk_7t2 @D5 It would be helpful if you could guide me on how I can design my database.

Chandan Gowda
6 Jul, 2023, 03:03

My use case is as follows Its a clubhouse clone. There will be public as well as private audio rooms. People can join and leave on demand. The communication part is implemented separately. For room management, i.e if the user is admin or if the user’s mic is on or user’s hand is raised, we are using appwrite realtime on database channel.

Chandan Gowda
7 Jul, 2023, 12:05

Thanks @Steven

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