I'm using the Parse framework to create player account functionality in an iOS game so that data is accessible at any device. However, I'm not sure what the best approach to 'sync' this data would be in order to minimise the api request count yet make it appear as everything is always synced. I'm currently refreshing data at startup, coming from background and after each game. However, that is already creating a lot of requests! I was thinking of placing a 'sync' button in the menu so that only then data is synced and normally saved only locally but it's the last resort really.
Game Outline:
What is the best practice for use of Parse in an online GAME with many players?
Edit:
I solved the problem by creating a NSCoding compliant NSObject that I then archive and save to Parse. This means all data is saved and loaded at once and I only need to update it at startup and after important events.
As you wrote best approach will be place an 'sync' button to minimize number of request which will be sent to the Parse, because your game can be interrupted at any by incoming call or something else.
You can reorganize your database for example:
You have two object User and Image
user have a one to many relation to image, when you fetches a User data to retrieve image you need fetch all images related to this user, this will produce a lot of request to Parse, another way is storing in Image an objectId
of the User object and fetch Images for that User by objectId
and not storing any relations to Image in User object, that way will drastically reduce the number of request to Parse