Database choice for game server

As usual with these things, the best answer usually is ‘It depends’ :slight_smile:

Yeah that always seems to be the case!
I’m probably over confident on how much consistency I can lose before things become too incoherent to run, especially as those errors will add over time, some of the rounds might last a number of months or longer so thinking more about it ACID requirements are moving further up my list of requirements.

document based nosql stuff does look like it might help with accessing stuff without locking whole tables of data from other threads.

Thank you for taking so much time to respond so thoroughly!

1 Like

Interesting to know that mongo can do ACID updates in specific cases I think I will experiment with this and see if I can get the performance I need out of it and if it can scale to 100 or so players

Thank you for taking so much time to respond so thoroughly!

1 Like

You explained what your goal was, you read and considered the answers, and actually took the time to go and read the links we posted/took the time to consider different angles of the answers you got … I wish the people in my company that are in the same spot as you had the same attitude…

1 Like

If you really want to go over the top you could go event based on a Kafka stream and then stream the events hehe

probably not though…

First off, nice thread guys!

I’m not much of an expert, but have had great experiences using Couchbase.

It’s also a schemaless document-based JSON setup, should be plenty fast, and I think might be able to scale way better for You in the future.

Adressing some of Your requirements:

Low latency:

Should be just as fast as any, if not faster in some scenarios. Really depends on Your approach and optimization.
I would always reccomend to try different accesible solutions and benchmark them against each other, then weigh Your options and priorities after the fact.

Able to store objects:

Would agree to previous mentions of only saving the game state as much as possible. I have saved some different data as base64 directly in the DB
but it always ended up being smarter just having references stored in the db rather than the actual data.

Basic crud operations:

Yes, and since You are allready familiar with writing SQL code, You might enjoy N1QL which, as they say, let’s You “Get the familiarity of SQL with the flexibility of JSON”.

Open source:

There are two versions of Couchbase server, which are quite similar in function, and both great options.

The community version which is open source, free of charge for both development and production.

The enterprise version, which is a paid option when You enter production, but free as long as You are not yet released.

A newer option also exists, which is a paid “Database as a service” option called Capella of which I haven’t tried as I like to have it all local (also cheapskate).

Nothing fancy or exotic:

So sorry(jokingly); but some fancy and/or exotic functions aren’t completely eluded :slight_smile:

Examples are; a masterless (master/master) setup, inherently build for easy replication, Memcaching, realtime analytics etc.

I do have one grievance with the community edition which relates to difficulties setting up SSL on the admin login page, but I guess
it can be managed with merely not letting the webpage be accesible from the outside or some clever routings later on.

Of other options becides MongoDB, You might be interested in Redis.

Can't help but throw some puns in there:

"It’s 2022… Can we please break the cycle and get masterless databases for the world instead of taken the beaten path of master/slave setups."

“Take some ACID and get your CRUD on.”
:sunglasses:

Maybe skim trough this article aswell: “Distributed Multi-document ACID Transactions in Couchbase”

Anyways; Good luck with Your endeavours!

Hey just found this. Dank, what did you settle on? I’m leaning towards a proprietary nosql db like DynamoDB for my game but I’m curious which direction your project took?