Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🚀 Feature: Simplified Management of Document Relationships #5925

Closed
2 tasks done
vlohar08 opened this issue Aug 1, 2023 · 2 comments
Closed
2 tasks done

🚀 Feature: Simplified Management of Document Relationships #5925

vlohar08 opened this issue Aug 1, 2023 · 2 comments
Labels
product / databases Fixes and upgrades for the Appwrite Database.

Comments

@vlohar08
Copy link

vlohar08 commented Aug 1, 2023

🔖 Feature description

Appwrite should add a few separate methods for Managing Relationships.
We should not be forced to send all the previous documents again to add new relationship documents to the database collection.
Example -

databases.createRelationship(...parameters) databases.deleteRelationship(...parameters) databases.updateRelationship(...parameters)

OR

Appwrite can add a way similar to how we set document permissions. We can just add a new function parameter that can handle relationships.

I won't comment more on how this can be done. You guys know better!

🎤 Pitch

If we look at database relationship management now then it is not suitable for high-scaling apps.
I will explain this with the doc example.

await databases.updateDocument(
    'marvel',
    'movies',
    'spiderman',
    {
        title: 'Spiderman',
        year: 2002,
        reviews: [
            'review4',
            'review5'
        ]
    }
);

Now, in the above example, If I want to add more reviews to the movie Spiderman then the only way is to pass both old and new reviews in the update document function.

This is OK if you have 10-20 reviews.
But Imagine if you have 1000 movie reviews. And if you pass all the 1000 reviews in the reviews array inside the updateDocument function then it will increase the payload size a lot.

Even big issue is first fetching all the old reviews from the server and making another request to update the relationships.

There should be an easy and more optimized way to Create, Update, and Delete Appwrite Database Relationships.

👀 Have you spent some time to check if this issue has been raised before?

  • I checked and didn't find similar issue

🏢 Have you read the Code of Conduct?

@Haimantika
Copy link
Contributor

Hi @vlohar08 thanks for the feature request! Tagging @gewenyu99 to look into this.

@Haimantika Haimantika self-assigned this Aug 1, 2023
@stnguyen90 stnguyen90 added the product / databases Fixes and upgrades for the Appwrite Database. label Aug 1, 2023
@stnguyen90
Copy link
Contributor

Closing this as a duplicate of #2531.

@stnguyen90 stnguyen90 closed this as not planned Won't fix, can't repro, duplicate, stale Aug 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
product / databases Fixes and upgrades for the Appwrite Database.
Projects
None yet
Development

No branches or pull requests

3 participants