question

andrea-franco avatar image
andrea-franco asked

Is it possible to handle database in cloud script ?

Hi, i have very few acknolewge in networking and i was wondering if I can access my DBB in the cloud script ? I have read in the doc that you can "make web requests to external HTTP // endpoints, such as a database", do you have an example ? I don't get it. I'm making an async game with Photon and want to get back the room state when the player enter the room, i use playfab as webhook. I don't want to implement a server, just do the logic in client side.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
Marcus Nixon avatar image
Marcus Nixon answered

Hi Andrea,

If your database can be accessed via a Web API, you can use http.request to query it. If not, you may want to consider using Azure table storage, AWS Dynamo, or an mLabs MongoDB, as all of those options do support Web API access.

3 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

andrea-franco avatar image andrea-franco commented ·

Thank you for what you shared, i was wondering if it was the good way to persist datas for an async. game, the point would be to retrieve those data days later. I have did a lot of researches and read about sharedgroupdata, usertitledata but they seem very limited (no more than dozen players at the time and no much datas can be saved...) as i have no idea of how many players there will be for all the games to come.

0 Likes 0 ·
brendan avatar image brendan andrea-franco commented ·

If the goal is to have all players sharing the same data, then yes, you would need to use an external data store right now. We'll be providing more functionality in this space as we continue to roll out the Entity model.

But if all you need to do is share some data between a small number of players, with periodic updates (like the game state for a turn-based async game), you could use Shared Group Data for that.

0 Likes 0 ·
Marcus Nixon avatar image Marcus Nixon commented ·

I am not sure what you mean by "no more than a dozen players at a time." If you are just trying to save data related to the player, I would recommend taking a 2nd look at using the player title data. Yes, it is limited to only key/value pairs, but depending on how much data you need to save, you could easily format the data into a json format and save it as a string. If you need something more robust, then the database is the way to go.

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.