Sometimes multiple DataStore keys depend on eachother directly or indirectly (e.g. my game, where multiple keys form a single save slot since the 65k characters limit isn’t always enough – and having a central key storing information referring to these keys, which ones exist etc.).
Updating multiple keys at once is sometimes just unavoidable, but ensuring they all happen atomically is pretty important. Sometimes DataStore just dies out in the middle of writing to multiple keys for a short while, which results in only part of the keys to be updated are actually being updated (and a bunch of sad people).
I’d love to see a built-in mechanism to atomically update multiple keys.
I generally cache my data and then save data when possible. I then inform clients that data may not be saved permanently, and to wait a little while before saving again.
The problem is data partially saving, thus corrupting the data.
Although the game catches that error and asks to try again later at the moment, the player can also just leave and come back with an unloadable savegame. Doing hacky stuff like “trying it again later” really isn’t a proper solution, since the server can also just shut down and leave the database in an corrupted state permanently.
I’m most likely going to store revisions (which works in my case), but that does not take way that having the ability to atomically update multiple keys like a transaction is valuable.