Forum BigDB BigDB Load Does Exactly What?

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

BigDB Load Does Exactly What?

Postby Yukichu » February 16th, 2014, 10:19 pm

So I am loading and saving DataObjects. Awesome.

When I load a dataobject, is every single bucket within the dataobject being loaded into that variable?

For example, I had an entry in "PlayerObjects" database called "Person" and he has buckets X, Y, and Z.

When I load "Person" (BigDB.Load("PlayerObjects", "Person", delegate(DatabaseObject obj) { })

and within the delegate, I get values X and Y...

someObj.X = obj.GetInt("X")
someObj.Y = obj.GetInt("Y")

has Z been loaded as well?

I am wondering about the feasibility of having an account with a ton of info in it, and then having DatabaseObject buckets which are the player files. There obviously is no reason for loading 20 different player files from the account when you call the account object... just the one you want to select.

So... yeah, the question: when loading an object, is it loading --everything-- from PlayerIO BigDB, or is it dynamically requesting the buckets as needed within the delegate method?

For now I have the playerfiles and all future not-so-necessary-to-load-immediately-or-makes-sense-to-do-it objects as different entries in a database, but having them as buckets from the top-level object would be awesome if it doesn't load them unless asked to.

Insight would be appreciated.
Yukichu
 
Posts: 6
Joined: January 12th, 2014, 5:26 pm

Re: BigDB Load Does Exactly What?

Postby Henrik » February 20th, 2014, 6:19 am

Load() gives you the entire object, but Save() is able to only send the changes over.

If you use most of the data in the object, it might be acceptable to load it once, and then keep the same object in memory and just keep updating and saving it.

If you don't use most of it, your approach is probably the best, yes.
Henrik
.IO
 
Posts: 1880
Joined: January 4th, 2010, 1:53 pm

Re: BigDB Load Does Exactly What?

Postby Yukichu » February 21st, 2014, 2:34 am

Excellent response! Exactly what I was looking for (information!)

Thank you!

This helps greatly in planning and knowing how to load / save objects.

The tutorials are bit vague at times... well, they are very good in a lot of ways, but very lacking in the 'bigger picture' of how to put it all together. Maybe it's just me, but it's all starting to click. I was loading an object every single time I needed it, saving it every time, etc. Very... traditional database methods of thinking I had to open a connection each time.

Very slick how some of this works.

Thank you again! Exactly what I needed to know!
Yukichu
 
Posts: 6
Joined: January 12th, 2014, 5:26 pm


Return to BigDB