Forum BigDB Some suggestions/requests

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

Some suggestions/requests

Postby fox1980 » June 7th, 2010, 11:55 am

1 - The ability to create tables and indexes from code, instead of using the control panel. Example where this could be useful: Dynamic creation of game "zones" where you want each zone to have it's own table.(just a small example, i can think of a lot more cases where this could be useful)
2 - A button to truncate tables in the admin panel. When i'm testing code i often put a lot of junk on tables, when i want to clear it out i have to delete objects one by one. I could also delete the table and recreate it, but then i would have to recreate all the indexes too by hand.
3 - The ability to import data back using the exported data file from the admin panel. (i'm thinking about backups here)
fox1980
 
Posts: 206
Joined: April 1st, 2010, 10:39 pm

Re: Some suggestions/requests

Postby Oliver » June 7th, 2010, 2:55 pm

Hey Fox,

1) Dynamic tables don't fit very well with the underlying software of BigDB. Why not just create an property on the objects "zone" and then have that as the first property in the indexes on the table? Seems to me you'd get exactly the same effect... In MySQL -- for instance -- you wouldn't create a table for each zone but rather a "zones" table.

2) There is a truncate button in there? it's on the main overview page.

3) Good idea, we had it on the drawing board, but scrapped it for v1. Might be in v2.

- Oliver
User avatar
Oliver
.IO
 
Posts: 1159
Joined: January 12th, 2010, 8:29 am

Re: Some suggestions/requests

Postby fox1980 » June 7th, 2010, 3:15 pm

I see the truncate button now, i must have been blind. Don't know how i missed it.

As for n1, in MySQL i would probably use a table for each zone if they were large enough. I'm talking about storing zone objects like trees, sign posts, houses, npc's, their position, size, rotation, condition, unique id, etc...
Even in a 100x100 zone this can add up to thousands of objects, with enough zones it could easily pass 1 million objects. I can create an indexed zone id property, but i'm gonna need more indexes on that table, in MySQL the more indexes you add, the less performant it becomes. I'm guessing in BigDB it's the same thing. I haven't ran into the performance issues yet, just trying to think ahead. I just tought that if there's a way to create tables from the admin panel, it shouldn't be overly complicated to allow table creation from code.
fox1980
 
Posts: 206
Joined: April 1st, 2010, 10:39 pm

Re: Some suggestions/requests

Postby Oliver » June 7th, 2010, 4:04 pm

Even in a 100x100 zone this can add up to thousands of objects, with enough zones it could easily pass 1 million objects.


No biggie.

I can create an indexed zone id property, but i'm gonna need more indexes on that table


What i ment was for each index you'd have, have it have the zone-id property as the first property. (ie, no additional indexes need be created)

...in MySQL the more indexes you add, the less performant it becomes. I'm guessing in BigDB it's the same thing...


Not quite. Indexes are only updated when the indexed-properties of an object are changed. So, you might have 4 indexes on a table, but if you only change non-indexed properties (let's say 'user.inventory' is not indexed) when saving, then that won't touch any index.

You might also change a property (like zone-id) that's a part of all indexes in a save, and then all the indexes will be updated. That is, the update might take a bit longer because it has to do 1x object update + 4x index updated while the other example only has to do 1x object update.

However... Don't worry about it. BigDB Is fast. It's scalable. It's very much on purpose that we're not exposing complex query abilities, because those are always the ones that fail when scaling. What we've exposed with BigDB is what we know will scale!

I just tought that if there's a way to create tables from the admin panel, it shouldn't be overly complicated to allow table creation from code.


Sure, that could be done. But the thing is; the system is scalable on 'objects in table' axis, and not the 'tables' axis. That is you can have as many objects in the tables as you want, but the system would slow down once you started having thousands of tables pr. game, because it was not designed for that.

And, as i mentioned above, you should really model your data into a "ZoneObjects" table, rather than a table for each zone :-)

- Oliver
User avatar
Oliver
.IO
 
Posts: 1159
Joined: January 12th, 2010, 8:29 am

Re: Some suggestions/requests

Postby fox1980 » June 7th, 2010, 4:58 pm

Thanks for clearing that up. It will still take some time for me to fully grasp the dataobjects concept since i'm so used to design relational databases.
fox1980
 
Posts: 206
Joined: April 1st, 2010, 10:39 pm


Return to BigDB



cron