What do you want to achieve? Keep it simple and clear!
I want to replace the data store using the sql API.
What is the issue? Include screenshots / videos if possible!
API server was created, and there is still work left to transfer user data to DB. How can I retrieve user data?
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
We could not find a case of storing user data in sql DB in devforum.
–korean
What do you want to achieve? Keep it simple and clear!
저는 sql API를 사용하여 datastore를 대신하고 싶습니다.
What is the issue? Include screenshots / videos if possible!
API 서버는 만들었고, 사용자 데이터를 DB에 옮기는 작업이 남았습니다. 어떻게 하면 사용자 데이터들을 불러올 수 있나요?
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
devforum에서 sql DB에 사용자 데이터를 저장하는 사례를 찾을 수 없었습니다.
Query all your data (ListKeysAsync on relevant DataStores, use ListDataStoresAsync if you need to find all existing DataStores in your experience). Go through each key with GetAsync so that you can have both the key and the data, then send it to your database server. Make sure you have “Allow HTTP Requests” on to perform the last bit (Game Settings → Security).
As a flow:
Get your DataStore name → ListKeysAsync to get all data → GetAsync on each key that this function gives back (make sure to give time between each request or batch of requests to avoid running into limits) → Write both the key and the returned value to your database as you please
I don’t know Korean so I don’t have a native translation available, sorry.
Dynamic migration does sound like a better idea — only thing I’d add there is caching for the current session and changing the saving method instead of migrating as the player joins — but it depends on the extent of migration you’re actually seeking in this case and whether it’s important to do a full migration on the spot anyway or whether it’s fine to just move it as players go.
The assumption I approached this thread with was a full migration. Also, throttling only occurs when you don’t respect limitations, so if you work with that in mind it’s no problem.