I'm curious about the performance and scaling implications of having many databases as opposed to having many collections with fewer databases or finally the fewest database and collections with documents isolated by an id attribute.
Which complicates horizontal scaling more? Having thousands of databases or thousands of collections inside a single database or finally the fewest databases and collections with a very large number of documents isolated by an id attribute?
The isolated groups of data will have very few dependencies between each other in my project and I want to make heavy use of the real time API.
Summary
The user is asking about how Appwrite differentiates between collections in different databases. They are also curious about how the Appwrite database is isolated in MariaDB. The team suggests building the database around real-time functionality. Each collection in Appwrite translates to a table in MariaDB. The user is asking about the performance and scaling implications of having many databases versus many collections within a single database, or having fewer databases and collections with documents isolated by an ID attribute. They mention that the isolated groups of data in their project have very few dependencies and they want to make heavy use of the real-time API. No solution is provided in the thread.
Bouahaza
Rank 4: Virtual Machine
May 5, 2023, 15:17
A database on appwrite isn't a database on mariaDB
jSnake🐍🕊
Rank 2: Process
May 6, 2023, 03:13
hmm interesting, how does that translate to mariaDB?
Drake
Admin
May 6, 2023, 03:29
Only one mariadb database and each collection is a table
Bouahaza
Rank 4: Virtual Machine
May 6, 2023, 15:11
If you want to use realtime, build your database around it
Bouahaza
Rank 4: Virtual Machine
May 6, 2023, 15:12
The appwrite realtime is one of the most efficient I've tested, especially because there is only one websocket channel. The team did a great job 🙂
jSnake🐍🕊
Rank 2: Process
May 7, 2023, 00:11
Awesome, could you explain a bit more what you mean by building the database around it?
Nevus
Rank 4: Virtual Machine
May 7, 2023, 02:03
How is appwrite database isolated in mariadb side?
Drake
Admin
May 7, 2023, 04:15
What more are you asking about?
Nevus
Rank 4: Virtual Machine
May 7, 2023, 04:49
If its a single database in MariaDB side how does appwrite differentiate between collections in different appwrite databases?
Drake
Admin
May 7, 2023, 04:51
We prefix the table name with an internal project id and database id. Feel free to spin up a local instance of Appwrite and connect to the mariadb database to see