Forum: Building VoltDB Applications

Post: Memory Allocation for Empty Tables.

Memory Allocation for Empty Tables.
tarun
May 14, 2012
Hi,

We are planning have a common development platform which will allow us to create multiple Gaming Apps and plan is to create a persistence layer using VoltDB and having a Generic Schema for each set of entities.

At this point of time we are not sure how many different entities will be there. And we also do not want to bring down the DB cluster in order to push the schema changes to add new entities. I think our options are either we create a Generic schema and store the different types of entities in the common set of tables leading us to use composite keys everywhere and degrading the overall performance, Or we can create new tables on the fly when we are adding new entities. As I understand this is not the 'normal' way in which VoltDB works because we will not be able to use Stored procedures etc.

So the "middle-ground" option that I am thinking of is to have a set of pre-created empty tables in the platform schema. And the question that I am pondering about this approach is whether there are any overheads in terms of some pre-allocated memory to the empty tables.

Please let me know your thoughts and comments on this issue.

Thanks.
TG.
There isn't much overhead
jhugg
May 31, 2012
Sorry for the delay in answering your question.

There isn't much overhead per table when tables are empty (small numbers of KB). As soon as you add a single row, the table and its indexes will allocate chunks of memory, on the order of 2mb per table and per index.

I don't know whether empty tables or generic schema makes more sense for your application. I guess it would depend on what kind of things you're tying to do with VoltDB.

Thanks.