Caching reads is a good idea, but I would tend to make writes immediate, rather than waiting for the player to leave and then overwriting all their settings. This means that:
- If the plugin/server crashes, no data is lost
- If no settings are changed (the most likely case), no writes are performed
When changing a setting, just write to the database and the cache at the same time, then discard the cache when the player leaves.
__________________