Just a quick question regarding how relations in tables operate. Are they equivalent to an index in that the ‘parent’ also requires updating each time the ‘child’ is altered? I’m optimizing the schema design in favour of reads so I might have to limit relationship use if it means additional writes. Thanks.
Relations can impact your “read” query speed in two cases:
- You use column from relation in your “where clause”. In this case Backendless will make additional join operation with parent table.
- You are loading “child” objects while retrieving main objects. This scenario can be useful to save total query time if you always need those “child” objects in your code right after retrieving “parent” object.
In general, relations have no impact on “write” queries since during these operations relations are not updated and you need to use separate requests to Relations API to manage relations.
The only places where data and relations might be updated in the same request are “Deep save” and “Transaction” APIs. But again, when you use these APIs you are saving execution time since you execute one request instead of several separate requests.
Regards, Andriy
1 Like
Great, thank you!
1 Like