Finally got it working with parameterizable database size and data size