Back

How do I reference an Appwrite account in a collection fastest?

  • 0
  • Databases
Cale McCollough
18 Sep, 2024, 19:06

For Live Coding Alliance's website I would like to create multiple live coding profiles to switch between for each Appwrite account; clearly I can't make a relation from one database to another. How am I supposed to reference accounts in collections? Do I just create a table in my database called account I reference by the account id and create my relations from there?

I could look up by id but it's a 10-byte/80-bit UID, which causes problems because with inode based databases like SQL/MariaDB it's fastest to search for 64-bit indexes. In my experience with distributed databases we use a 128-bit UID (preferably with a library like linearid that doesn't generate random numbers at runtime) and then pack them up contiguous 64-bit signed integers every x time units. Am I supposed to search through the database for a string? This is very slow with large databases.

TL;DR
To reference Appwrite accounts in collections for Live Coding Alliance, create a table in the database to store account information and then reference the accounts by their unique IDs. Use a 64-bit index for faster searches in SQL or MariaDB. Consider using a 128-bit UID and packing them into contiguous 64-bit integers for better performance in distributed databases. Avoid searching for strings directly in the database for faster query results.
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