Forum BigDB LoadRange OR requests, BigDB traffic billing & measuring?

Discussion and help relating to the PlayerIO database solution, BigDB.

LoadRange OR requests, BigDB traffic billing & measuring?

Postby deadbug » May 13th, 2012, 7:58 pm

Hello

I might be overlooking something obvious here, but how is it possible to check for a value in one of 2 properties?

Lets say you store chat histories between two users with userid1 and userid2 and do so in a table whichs element contains these assigned to properties id1 and id2, how can I list all objects in the database where either id1 = userid1 OR id2 = userid1 to optimize the data?

I ask because it otherwise seems to be pretty complex to request both in a performant and low latency form (loadrange request within a loadrange request and then combining the processed results)

Additionally it seems that even server side bigdb causes webservice traffic and that generates about 80 times the amount of data we do on the client communication (20kb vs 1.6mb and that for basically nothing but a few messages in history being sent around - all listed under multiplayer which puzzles me anyway as clients can not request anything from bigdb), so I logically want to limit the data sent to the data I actually want, not a big blob of irrelevant data that I need to LINQ filter afterwards on the server, thats double-unfavorable for the player.io backend

EDIT: Edited the subject to be more appropriate
Last edited by deadbug on May 15th, 2012, 9:59 am, edited 1 time in total.
deadbug
 
Posts: 35
Joined: November 1st, 2011, 1:35 am

Re: How to perform an OR selection in LoadRange

Postby deadbug » May 15th, 2012, 9:47 am

Is there a chance that someone from the staff could at least confirm that its simply not possible to do proper on database filtering with non-keyed requests?

Also can an official please confirm that or that not the resulting server <-> webservice traffic generated and measured is applied against the traffic measurement for the pricing? The billing plan implies it does not (its no game traffic nor sitebox traffic), the resource usage page on the other hand lists it in the multiplayer section (we do not do any BigDB requests from client, its all game server driven), so I'm not sure which page is now correct.

Are there plans to allow more sophisticated request loadrange requests to lower the work on db,server,client and reduce the traffic resulting from these unoptimized requests?


We use Player.IO for our currently in-development MMO which heavily relies on BigDB and it will be of major importance to know these informations as it has a major impact on how I need to design the data storage, caching and fetching to balance out traffic & db object usage but also limits reasonably to achieve an optimal performance and cost efficiency


best
Marc 'Dreamora' Schärer
deadbug
 
Posts: 35
Joined: November 1st, 2011, 1:35 am

Re: LoadRange OR requests, BigDB traffic billing & measuring

Postby Henrik » May 17th, 2012, 12:11 pm

deadbug wrote:Lets say you store chat histories between two users with userid1 and userid2 and do so in a table whichs element contains these assigned to properties id1 and id2, how can I list all objects in the database where either id1 = userid1 OR id2 = userid1 to optimize the data?

Not in a single call, you need to make two calls to LoadRange, one for each user, and then combine the results in your client.

deadbug wrote:I ask because it otherwise seems to be pretty complex to request both in a performant and low latency form (loadrange request within a loadrange request and then combining the processed results)

You can make both calls at the same time, and do a simple check so that the one that finishes last gets to combine the results of both and return. I mean, you get two lists of chat messages, combine them and sort by date. Done! :-)

deadbug wrote:Additionally it seems that even server side bigdb causes webservice traffic and that generates about 80 times the amount of data we do on the client communication (20kb vs 1.6mb and that for basically nothing but a few messages in history being sent around - all listed under multiplayer which puzzles me anyway as clients can not request anything from bigdb), so I logically want to limit the data sent to the data I actually want, not a big blob of irrelevant data that I need to LINQ filter afterwards on the server, thats double-unfavorable for the player.io backend

Check your Resource Usage page in the Admin Panel for your game. On that page you get a breakdown of what your game has been using, and where data has been sent. If you don't access BigDB from your client, then that traffic should be listed under multiplayer webservice, so that's as it should be, right?

On the same page you can also see the number of BigDB requests you've made, which might help you figure out why the bandwidth used is higher than you think it should be.
Henrik
.IO
 
Posts: 1880
Joined: January 4th, 2010, 1:53 pm

Re: How to perform an OR selection in LoadRange

Postby Henrik » May 17th, 2012, 12:22 pm

deadbug wrote:Also can an official please confirm that or that not the resulting server <-> webservice traffic generated and measured is applied against the traffic measurement for the pricing? The billing plan implies it does not (its no game traffic nor sitebox traffic), the resource usage page on the other hand lists it in the multiplayer section (we do not do any BigDB requests from client, its all game server driven), so I'm not sure which page is now correct.

Yes, it counts as game traffic. I can see that the text on the pricing page isn't completely clear, but all traffic you see on the Resource Usage page - except GameFS traffic - counts towards your bandwidth bill.

deadbug wrote:Are there plans to allow more sophisticated request loadrange requests to lower the work on db,server,client and reduce the traffic resulting from these unoptimized requests?

Sorry, no. Remember that BigDB is much more scalable than an SQL database, but as a consequence of that it's also more limited.
Henrik
.IO
 
Posts: 1880
Joined: January 4th, 2010, 1:53 pm

Re: How to perform an OR selection in LoadRange

Postby deadbug » May 18th, 2012, 7:05 am

Thanks for the clarifications. Thats sad to hear as even MongoDB offers $or to reduce the load on bandwidth, client and db
deadbug
 
Posts: 35
Joined: November 1st, 2011, 1:35 am

Re: LoadRange OR requests, BigDB traffic billing & measuring

Postby carsonmorton » May 18th, 2012, 5:39 pm

I'm also trying to search for ranges on multiple properties. how does one go about combining the results?
carsonmorton
 
Posts: 39
Joined: April 24th, 2012, 3:12 am

Re: LoadRange OR requests, BigDB traffic billing & measuring

Postby Henrik » May 19th, 2012, 9:53 am

carsonmorton wrote:I'm also trying to search for ranges on multiple properties. how does one go about combining the results?

Make a List<DatabaseObject>, call AddRange() on that with all your separate results, and finally call Sort() to sort them in the order you want. For example, if you want to sort by a DateTime property called "created", it would look like this:

Code: Select all
var result = new List<DatabaseObject>();
result.AddRange(...);
result.AddRange(...);
...
result.Sort((a, b) => a.GetDateTime("created").CompareTo(b.GetDateTime("created")));
Henrik
.IO
 
Posts: 1880
Joined: January 4th, 2010, 1:53 pm


Return to BigDB