Hey guys, I'm in the process of making a big game, and need help with an idea. I want to make a cross server shop, but I'm afraid that won't be so easy, as DataStore has a limit on how many times it can be updated, and it has to be updated every time someone buys/sells something there. I'm not sure how to use HTTP Services. So can anyone help point me in the right directions?
Apparently guts are really good. I'm a dragon I would know.
You can use DataStores. Just make sure that you leave yourself enough room for any other requests you need and you'll be good to go. When people do stuff, add it to a queue on the server, and then make sure that you only update the list every 5 seconds or so. 5 seconds is plenty fast enough, and given the 60+10*playerCount
limit for servers, it is sure not to go over the limit.
Don't worry about it. Make sure you throttle your requests appropriately, and engineer your request/response structure properly - DataStores are incredibly robust, and suitable, but not magic.
Your data is simple enough. You won't be surpassing any storage limits, hopefully. Make sure you keep an array or dictionary of the items for sale, and the amount. Where possible, make sure that you can infer the cost or other data from within the game without having to load it in from DataStores. This will keep the data size and request costs down.
Your requests are simple. Queue them up so that they're all ready to go when needed - When you add something, tell the server, but don't send it yet. See if anything else needs adding, and in a few seconds update the DataStore with all of the buy/sell requests.
When you update stuff, you have a great advantage - You only need 1 request. You're getting the new data, and you're setting the new data. This has the greatly useful advantage of you being able to infer your new data without making excessive requests, and allows you to update all the new listings when you make the requests.