My idea for optimizing datastore

From experience, I learned the hard way that you should call as least datastore functions as possible, (looking at you getasync) so i had an idea to cache the datastore calls, in some table, whenever i call setasync that cache changes, whenever i call getasync i cache it, updateasync cached too, etc. AND that i would make a messagingservice subscription that would return the cached result or nil so that we dont need to call datastore even in another server, is this a good idea?

1 Like

yes, that sounds good assuming you’re careful of concurrency issues like one server being out of sync from another server, all of the servers deciding to save to the datastore at the same time, reading and writing data at the same time on different servers, etc

1 Like

this is why ill be using messaging service too