question

MoonHeonYoung avatar image
MoonHeonYoung asked

DataUpdateRateExceeded question

I am servicing an RPG game.

so PlayerData is updated frequently (ex. every time an item is enhanced or boss killed).

(In other words, the user can save more than 10 times within the current limit of 15 seconds.)

I've encountered a problem recently.

No data was saved after the user enhanced the item.

(DataUpdateRateExceeded occurs)

1. In a rpg game, there are points that must be saved, such as item enhancements.

Also, when enchanting multiple times, it must also be saved multiple times.

What can I do to avoid DataUpdateRateExceeded in this case?

2.When DataUpdateRateExceeded occurs, what ErrorsCode should be captured, and what is the proper error handling behaviour? (When an error occurs, should I call it again? This will also fail.)

(i.e. Is there an error code such as AccountNotAuthenticated?)

3. Does the current limit apply to all player data keys?

(i.e When I update two keys a total of 10 times in 15 seconds, is this limited to the limit?)

Or is it a limit for a single key? (I.e. only for updates to one key)

4. If so above, Is it possible to solve the problem by dividing the same save data key into two keys? (On the client, through the toggling save method that alternately save the data into each key .

And when the data is loaded, the latest data is used by comparing the lastUpdated property value.)

Is this method valid?

Thanks in advance for the answer.

This, like me, is an important issue in RPG development.

We look forward to your detailed answer.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
brendan avatar image
brendan answered

So, to summarize, the issue you're encountering is that data is not saved when you get a DataUpdateRateExceeded error, which is correct. To be clear, we have data rate limiting in place to prevent any performance issues for titles. You can only hit that error if you're trying to update the same key/value pair (KVP) in a single user's data more often than is allowed (which you can find in your title's Settings->Limits tab). To answer your questions:

1. How could you avoid the error?

You could break the data into separate key/value pairs, so that no one is updated at too high of a rate. But that really isn't aligned with the best practices on how to use a backend service. Each time you update a KVP, you are spinning the Profile Write meter by max(1, size of value in bytes / 1000) per key written. So if you're updating a single KVP ten times every fifteen seconds, and you have a session time of one hour (since RPGs tend to have longer session times), that's at least 2,400 "ticks" of the meter. More, if you're writing to more than one KVP, or it's more than 1 KB of data. Bear in mind that your usage directly translates to your costs.

What games normally do is one of two things:

a) Aggregate the data over time on the client, and only periodically update the service. You would use a Cloud Script to check the validity of the data from the client (which you should be doing in any case, if you're concerned about cheating). Having data from a longer period of time is actually very useful in this case, since it allows you to do the analysis without needing much else from the service. If you're analyzing only a second or two of data, you have to pull previous data to check things like total frequency, for example.

b) Use a hosted game server that manages the session. That way, the server is the authority (making it harder to cheat) and you can have the client update it at any rate you like. The server would either update the long-term backend data at the end of the session, or periodically throughout.

2. When DataUpdateRateExceeded occurs, what ErrorsCode should be captured, and what is the proper error handling behaviour?

That is the error code. You mentioned AccountNotAuthenticated, but that's an error that occurs if the client isn't signed in. In terms of handling, retrying after a delay (all retries of all calls, regardless, should use exponential backoff - increasing the amount of time before the next retry, until you hit a max of something like a minute).

3. Does the current limit apply to all player data keys?

Yes.

4. If so above, Is it possible to solve the problem by dividing the same save data key into two keys?

See above. It's technically possible, but it's not a good idea.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.