Udhayan Nair
Udhayan Nair

Reputation: 472

Is it possible to apply a relational table approach to Kinvey?

Im trying to do an app which requires regional permission and locks, for that i would need to apply a region ID on a lot of things, and thus was wondering if Kinvey could allow me to fetch that _id from the region collection to other collections?

Upvotes: 0

Views: 47

Answers (2)

George
George

Reputation: 430

I went through something similar when I moved to kinvey from SQL. I ended up taking the denormalized option in their documentation with a bit of a twist. All the referenced data lives on the object it is needed on, but I update those references in the post save business logic of the referenced item. I end up having several copies of the referenced object on various objects throughout the system but they update on save of the referenced object. This moved all the processing burden of the foreign key handling to the save and gave me relational data without all the extra processing of joins/resolves.

Upvotes: 0

remotesynth
remotesynth

Reputation: 271

There is a data modeling section in the docs that discusses how to model relationships via embedding or references. https://devcenter.kinvey.com/nativescript/guides/data-modeling#to-embed-or-to-refer

Upvotes: 1

Related Questions