We are exploring what’s the best way to store data in the database. Our use case is a realtime city builder where players can spawn instances of things on the same space. Each player can add from 50-100 to 1500-2000 instances that need to be recorded in the DB.
Recording happens in the server runtime and involves storing a set of numbers (position, rotation, scale) and a single string (instance name).
We created an RPC that is called after each instance is being spawned and adds the data to the collection using a unique key that is derived from the position coordinates (e.g. x_y_z). That works well but we are worried it may not scale. When a new player will visit the game he will request all these instances using a storageList method.
That method will fetch all instances built by the players and return them but seeing how much metadata each instance holds (permissions, userId, version, key etc) that seems like a lot of data.
We thought another scenario to put everything under a single key and on each write have the server read the current entries on that key (e.g. that would be a big sequential array) and append at the end the new instance data. Though that seems like a lot of work for the server.
Any ideas on what approach works best for us?