#[SOLVED] Need help in understanding Appwrite DB structures for making ERD

39 messages · Page 1 of 1 (latest)

strange laurel
#

I need help in understanding each and every part of Appwrite cloud services and their databases, collections, schema, storage, etc in order to make the Entity Relationship Diagram (ERD) for my web application.

I'm using this tool to make the ERD: https://dbdiagram.io/d

Quick and simple free tool to help you draw your database relationship diagrams and flow quickly using just keyboard

#

Services I have used:

  • Authentication
  • Databases (6 Collections)
  • Functions
  • Storage
strange laurel
#

Let me check

strange laurel
strange laurel
#

It would be better if someone gets on a call or provides me something here to help me in getting things properly

open dock
#

appwrite is just like some other sql database. But you'd just have to write your queries with its Queries API. So for the purpose of ERD diagram, make it as simple as you would make it for MySQL/MariaDB

sharp fog
#

I think the best way to discover It is connecting manually to the appwrite's database and seeing what's there

sharp fog
# strange laurel Services I have used: - Authentication - Databases (6 Collections) - Functions...

Not sure, since didn't have investigated it but it's something like this:

Authentication:

  • Auth users table: contains rows with users, having all the data related: unique ID, name, email, password, preferences

  • Teams table: all teams with all their corresponding data

Databases:

  • Database list: table containing all databases you have

  • Each collection you create is a table. Every document/row has a field to associate the corresponding database and every document apart from their ID, it has all the attributes/columns you defined

Functions:

  • List of all your functions and probably details associated

  • Executions (not sure if that's MariaDB, influx or Redis)

Storage:

  • Probably a table for each bucket or a relationship that contains documents/rows with each document ID, URL associated, etc

If I'm not grong there are additional tables to associate the user, the project and organizations from dashboard to all elements the app contains

strange laurel
#

I'll try an attempt and then get back here

sharp fog
#

Confirmed, seems there are more tables than the others mentioned before. Don't understand how does this affects your project

feral musk
open dock
#

Exactly, and ERD is really abstract to what database you're using. So yeah just jot down down how you wanna structure your database.

feral musk
sharp fog
#

Yes, that's what I'm saying

#

What's true is that in some cases, Appwrite internal collections/tables ends being a duplication of your collections. For example, users collection (from Auth service): you can't expose it so if you make a blog-like app, you will need to create a separate collection with the database service in order to show the name of the post creator.
Same with teams API, but just the opposite: some cases you don't want to expose the email to all users in a team, so to prevent that, you need to use teams only for permissions and then creating another different table/collection to associate teams

strange laurel
#

Am I right?

#

P. S. First time going to make an ERD

strange laurel
#

Am I right?

#

P.S. Making ERD for the first time

strange laurel
#

If you don't mind checking it after it's done, it would be a great help!

open dock
open dock
open dock
strange laurel
#

Hey @open dock Check it out

open dock
strange laurel
#

Shall I take ss and paste it here?

strange laurel
#

Hey @shy bay Need to know about the use case of key and fulltext indexes and also their differences

strange laurel