I`m just creating a Instagram clone app for testing
my data structure is below
--- users (root collection)
|
--- uid (one of documents)
|
--- name: "name"
|
--- email: "[email protected]"
|
--- following (sub collection)
| |
| --- uid (one of documents)
| |
| --- customUserId : "blahblah"
| |
| --- name : "name"
| |
| --- pictureStorageUrl : "https://~~"
|
--- followers (sub collection)
| |
| --- uid (one of documents)
| |
| --- customUserId : "blahblah"
| |
| --- name : "name"
| |
| --- pictureStorageUrl : "https://~~"
|
Assume user A has 1 million followers and then if user A edits a picture or name or customUserId, should the document of each sub collection "following" of 1 million followers users be modified?
Should there be 1 million updates? Are there any more efficient rescue methods? And if there is no other good way, is it appropriate to batch data modification through the database trigger of the cloud function in the case of the above method?