Back

Too much data returned when creating / updating documents

  • 0
  • Databases
  • Web
  • Cloud
SidSahani
2 Oct, 2024, 14:11

I work with appwrite relations (3 levels deep) Whenever I create / update documents (via createDocument and updateDocument), appwrite returns a big object with relations and fields like ($id, $collectionId, ....) Is there any way to pass in a flag or a work around so that less data is returned ?

On comparision, getting a single document with proper Query.select returns a object less than 100 bytes while updating returns 300 bytes object and creating returns 800 bytes object

I have read the documentation and searched through some of the related github issues to no avail On side note, why does creating / updating documents return an object (wasn't able to think a proper reason)

TLDR: need a way to reduce the size of the object returned while creating / updating documents

TL;DR
Developers are looking to reduce the data size returned when creating/updating documents due to relationship attributes causing inefficiency. Instead of using relationships, store foreign keys and pull related documents when needed. This can help decrease the large object returned, with sizes around 800 bytes for create and 300 bytes for update.
Kenny
2 Oct, 2024, 14:14

Currently relationships are in beta, and do not allow for queries or anything like that. They're also pretty inefficient at this time, I would recommend instead of using the relationship attribute storing the foreign keys and pulling related documents where necessary.

SidSahani
2 Oct, 2024, 14:18

I see Firstly, thank you for the fast response This may seem rude, but when will the relationships be 'production-ready' ?

Kenny
2 Oct, 2024, 14:25

Not rude, I know relationships are important, but looking at the current roadmap for the next two versions of appwrite (https://github.com/appwrite/appwrite/projects?query=is%3Aopen) I'm not seeing anything related to relationships. I also believe they are planning quite a large overhaul of relationships so I'm not sure how long that will take and what will change. :(

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