Saving data through httpservice?

Hi there! I’m tired of saving data with datastore! I’ve never actually had a complete game with datastore but I’ve tried it a few times and it is a pain in the ***.

One day I had the brilliant idea to save data through the http service or something along those lines. I’ve never used http service, so I’m just curious if this is even possible. And if so, how would I execute it?

3 Likes

More than likely to be possible. Datastores should work though, and using HttpService would likely result in the same amount of work. (barring anything the external service does)

1 Like

You could probably save the player data to discord using http service and get the player data back using http service

Discord is unreliable in that regard, unless there is something I’m missing. I haven’t worked with their API practically at all.

1 Like

It’s pretty simple to send messages to discord through roblox but I don’t really know how to retrieve the data back :confused:

You’d likely need a bot, not a webhook. At that point, why not go use some service that’s accustomed for data storage? I believe Google holds some form of it.

1 Like

I could use google sheets? I don’t know about that, but it should work

If only we had bots to fill out the sheet :laughing:

I would recommend creating an external API using JavaScript or Python and using the database called MongoDB, I use it for the data saving of Discord bots and such.

I would DEFINITELY recommend that you don’t use Discord as a database, it simply isn’t meant to be. Their API is meant for making Discord bots and making any Discord server or the entire Discord experience better. Their API has a rate-limit of how much requests you can call in a second. And it’s very likely that if your game blows up, the rate-limit will be exceeded very quickly.

PS: You could use Glitch to host your API. But you would have to buy a subscription if you don’t want the API to shut off after a few days.

1 Like

Have you tried using playfab. Using it in my game and it’s great. Someone made an api for it and u can use it straight from Roblox without needing external servers.

1 Like

PlayFab is used for Analytics, not storing data.

If complexity is your main concern, data stores with a wrapper like profileservice or datastore2 are the way to go. If you want to use httpservice, you’ll still have to set up the same amount of code in your game, plus an external server or service to accept and store your data.

It’s not really the complexity. It’s more the reliability. Cause when I’ve used datastore it’s been weird and stuff haven’t worked. But I guess that’s only me and my code. The limit too. I feel like 6 seconds between every request is too long. 500 a minute is more like what I’d want.

The built-in Roblox data stores are known to be unreliable at times, but DataStore2 by Kampfkarren is amazing. Never lost any data with it, super easy to use, very fast and capable of handling a lot of requests. Although 500 a minute may be too much, but this is your problem, not the data store’s. Try redesigning your code, I’m sure it’s not necessary to have 500 saves each minute. Using HttpService for this is just extra work.

2 Likes

It’s definitely possible, the creator of Ultimate Driving Simulator uses it, see How do you make DataStores carry over to different games, like Ultimate Driving does? - #19 by TwentyTwoPilots

1 Like

It’s very possible.
The simplest solution would be to use reliable database, i.e MongoDB as suggested above. It would save you the hassle of having to handle authentication tokens and securing your data.
Another way would be to make the database yourself. It shouldn’t be that hard depending on how much experience you have with servers. All you really need is to make something to authenticate your calls to get/set, alongside how to store your data (json is a common format for this use). The bad part about this is that it’s all in your hands to handle the data, and if anything goes wrong, it’s your fault.

If this sounds too hard for you, then you can still keep it to Roblox. I’d definitely suggest going with this suggestion:

It’s very easy to use DataStore2, and it shouldn’t take more than 30 minutes to replace your DataStore code with it. Definitely go with DataStore2 if you want a simple and reliable way to store data.

3 Likes

What exactly is your use case? If you want to update data for some player often, both profileservice and datastore2 do that already. They store the latest data in a table which then gets stored automatically after a certain amount of time has elapsed. I’ve also yet to see any data lost in games that use them. Even in my freakish test places, the data hasn’t corrupted once after bending the modules in ways you weren’t supposed to. If you want cross server communication, messagingservice was designed with that in mind.

As you probably already know, httpservice is limited to 500 requests a minute. Unless you want additional control over the stored data, there is practically no reason not to use datastores. All their lack of reliability is due to lack of features which these modules implement in Lua.

1 Like

I would suggest using Google Firebase to achieve this. They have two great database tools that I use for web development. There’s a REST API for it, meaning that you can just use GET and POST requests to their api links and it will work.

3 Likes

Roblox have collabed with playfab however you can use the full services of playfab if you use the http service. It is very useful as there are many features.

1 Like