Forum Games Have trouble in deleting data in BigDB

Discussion relating to game development with Unity

Have trouble in deleting data in BigDB

Postby jyk » March 20th, 2017, 7:55 am

Our game now has too much data in BigDB and everytime when we delete a few objects(about 20) PlayerIO will send us an error which says "Webservice returned unhandled error:GeneralError". Does anyone have similar problem?
jyk
Paid Member
 
Posts: 25
Joined: October 10th, 2016, 7:27 am

Re: Have trouble in deleting data in BigDB

Postby Henrik » March 20th, 2017, 9:03 am

Hey jyk,

That's strange, and you really can't have too much data in BigDB. :-)

Are you getting a reference code with that error?

What happens when you're trying to delete objects through the BigDB control panel?

Which table are you trying to delete objects from? Are you deleting by key or by index?
Henrik
.IO
 
Posts: 1827
Joined: January 4th, 2010, 1:53 pm

Re: Have trouble in deleting data in BigDB

Postby jyk » March 20th, 2017, 9:35 am

1.Reference code:
PlayerIO.BigDB.LoadRange("UserBase", "level", new object[] { 1 }, null, null, 1000, delegate(DatabaseObject[] arr)
{
for (int i = 0; i < arr.Length; i++)
PlayerIO.BigDB.DeleteKeys("PlayerTechAssets", arr[i].Key);
});

2.No problem when deleting objects through the BigDB control panel.
3.All the table is made by mine.By key.
jyk
Paid Member
 
Posts: 25
Joined: October 10th, 2016, 7:27 am

Re: Have trouble in deleting data in BigDB

Postby Henrik » March 20th, 2017, 9:23 pm

Okay, so you are calling DeleteKeys 1000 times in a row, and you're getting errors on all of them? Some of them?

You should be using DeleteRange instead in this case:

https://playerio.com/documentation/refe ... eleteRange
Henrik
.IO
 
Posts: 1827
Joined: January 4th, 2010, 1:53 pm

Re: Have trouble in deleting data in BigDB

Postby jyk » March 21st, 2017, 4:03 am

Thanks, I'll check it out.
jyk
Paid Member
 
Posts: 25
Joined: October 10th, 2016, 7:27 am

Re: Have trouble in deleting data in BigDB

Postby jyk » March 21st, 2017, 12:39 pm

What's more, I'm using PlayerIO's API sampler and find out that there's too much API Traffic Received. Do you know how to reduce that?
jyk
Paid Member
 
Posts: 25
Joined: October 10th, 2016, 7:27 am

Re: Have trouble in deleting data in BigDB

Postby Henrik » March 21st, 2017, 9:15 pm

It's your game and your code that is doing all the Api Requests, so that is something you will have to figure out yourselves.

Using the Api Sampler you can find out which type of requests are most common, which means you can figure out which parts of your code is sending them, and then you can work on reducing the amount of requests you are making.

One very common mistake developers do is to not do proper error handling, and just retry every call that fails. That's not a very good idea, because you can quickly end up with infinite loops that are trying the same call again and again and again, but if you only looked at the error you would know what to do instead.
Henrik
.IO
 
Posts: 1827
Joined: January 4th, 2010, 1:53 pm

Re: Have trouble in deleting data in BigDB

Postby jyk » March 22nd, 2017, 4:12 am

The following picture is what I see from API sampler.You can see Api traffic received is a problem.
Image
Do you mean I can see which type of requests is the major factor of all the Api Requests from API sampler? Would you mind tell me how to do that?
jyk
Paid Member
 
Posts: 25
Joined: October 10th, 2016, 7:27 am

Re: Have trouble in deleting data in BigDB

Postby Henrik » March 22nd, 2017, 5:24 am

That graph is just the PlayerInsight Realtime graph, on the same page there should be a tab called "API Sampler", where you can inspect traffic in realtime using various filters.
Henrik
.IO
 
Posts: 1827
Joined: January 4th, 2010, 1:53 pm

Re: Have trouble in deleting data in BigDB

Postby jyk » March 22nd, 2017, 11:45 am

I've try the API sampler and find it just uses random sample to figure out the problem, which still give me some difficult
in understanding what is the the Api Requests. What's more, I wonder how these parameters related with Api Requests.In my opinion, API sampler is just collect 100 user's certain game data and has nothing to do with the traffic.
Image
jyk
Paid Member
 
Posts: 25
Joined: October 10th, 2016, 7:27 am

Re: Have trouble in deleting data in BigDB

Postby Henrik » March 23rd, 2017, 5:45 am

No, the API sampler shows the next 100 API requests that match the filter settings you input. You can pick a specific API method, or a specific user to try to profile your game to see what it is doing in real time.

But I don't think I really understand what the issue is. In your screenshot from PlayerInsight, you have 900 players online, and your game is doing 150 API Requests/s, that's about one request per user every 6 seconds. That seems perfectly reasonable to me? If you want to do fewer API Requests, you have to change your game and start removing unnecessary requests.
Henrik
.IO
 
Posts: 1827
Joined: January 4th, 2010, 1:53 pm

Re: Have trouble in deleting data in BigDB

Postby jyk » March 23rd, 2017, 7:16 am

The thing you see is just I have seen many times.So, what is the API request? I don't need other answer but ONLY what is the API request. How can I figure out a method to reduce the API request without knowing what it really is?
Is BigDB save and load the main components of API request? Or is interaction of sever and client the main components? Or some others?
jyk
Paid Member
 
Posts: 25
Joined: October 10th, 2016, 7:27 am

Re: Have trouble in deleting data in BigDB

Postby Henrik » March 23rd, 2017, 10:03 am

Every time you call a PlayerIO function in either your game client, or in your serverside code, that counts as one API request, and the amount of data in the request and the response is also counted. Every BigDB load, every PayVault request, every Authentication, everything that sends data from your game to the PlayerIO backend.

In your PlayerInsight screenshot, you've made about 17000 requests total, which has resulted in 39MB of data sent back to your game. That's about 2kB in average per request, which means that the majority of those are probably your game loading objects from BigDB, since those tend to have the largest responses.
Henrik
.IO
 
Posts: 1827
Joined: January 4th, 2010, 1:53 pm

Re: Have trouble in deleting data in BigDB

Postby jyk » March 23rd, 2017, 10:10 am

Thanks a lot! We have find out that Achievement is the key in which too much refresh is called.
jyk
Paid Member
 
Posts: 25
Joined: October 10th, 2016, 7:27 am


Return to Games