MinoMino/minqlbot

Possible switch to a client-server NoSQL database

MinoMino opened this issue · 2 comments

Just thought I'd put this as a sort of warning, if you will. It's very likely I'll switch to a client-server NoSQL database when the Steam exclusive update hits. Why? Primarily for the following reasons:

  • Being able to run multiple servers using the same database. Obviously that would work with any client-server SQL database too, but see below.
  • Dynamic schemas. It's just so much nicer to be able to change schemas on the fly. This is why I'm leaning towards NoSQL and not just MySQL or something like that.
  • The data in the current SQLite databases will be useless due nicknames not being unique identifiers, making this the perfect opportunity to make this change.
  • NoSQL tends to fall short when it comes to complex queries. The bot uses extremely simple queries, so that's not an issue either.
  • I've been looking into ways to reduce both CPU and GPU load of QL to make it more viable to run multiple clients without having it hog resources unneccesarily on bot users who don't use it to play on, and I've had some success doing so, so that's even more reason to have a client-server database.

At the time of writing, I'm leaning towards MongoDB, as I've worked with it before, has a first-party Python driver and has good documentation.

"The data in the current SQLite databases will be useless due nicknames not being unique identifiers, making this the perfect opportunity to make this change."

Why do you think so? I guess nicknames might not be 'main' unique identifier but I think they will be unique even after migration to steam exclusive. Also do you really think that current nicknames will be abandoned? Imo they will be migrated. It would be enough for current database to add new column with id.

Imho, saying current databases will be useless is far-fetched.

I guess nicknames might not be 'main' unique identifier but I think they will be unique even after migration to steam exclusive. Also do you really think that current nicknames will be abandoned?

Yes, I do think so. That's standard practice for well-integrated Steam games. The nickname will likely be whatever nickname you use on Steam. Not to mention, the little teaser sponge gave the other day:

Steam nicknames support unicode (and as opposed to the current system, whitespaces can be used freely), so that's likely the motivation for implementing that.

Imho, saying current databases will be useless is far-fetched.

Personally, I'd say thinking otherwise is far-fetched when it's clear they're looking to integrate the game with Steam and move away from their shitty infrastructure as much as possible.