简体   繁体   English

iCloud-同时访问数据

[英]iCloud - access data at the same time

For an iOS game we're currently exploring the use of iCloud to store user inventory. 对于iOS游戏,我们目前正在探索使用iCloud来存储用户清单。 We want to be able to transfer such inventory assets between multiple apps, or better, make them available for usage within multiple apps. 我们希望能够在多个应用程序之间转移此类库存资产,或者更好地使它们可在多个应用程序中使用。

this Sharing iCloud data between two apps thread states that it's possible to access the same iCloud storage from multiple apps. 此“ 在两个应用程序之间共享iCloud数据”线程状态表明可以从多个应用程序访问相同的iCloud存储。

But in such a case, questions of concurrency arise. 但是在这种情况下,会出现并发问题。 How can one manage the case that a user uses two devices at the same time for example to sell the same inventory item? 如何管理用户同时使用两个设备(例如出售同一个库存商品)的情况? Can locks somehow be put in place? 可以将锁以某种方式放置到位吗? Or is iCloud the wrong technology choice for sharing inventory among apps? 还是iCloud是在应用程序之间共享清单的错误技术选择?

I think you would need to make the transaction on the server-side and push the change to all clients to make this reliable (and without exploits). 我认为您将需要在服务器端进行事务并将更改推送给所有客户端,以使其可靠(并且没有漏洞)。

iCloud has two failings in this regard: you have no control over the server and it's not "real time" -- sometimes it "batches" changes, and you have no say over when this happens. iCloud在这方面有两个缺点:您无法控制服务器,并且它不是“实时的”-有时它“分批”更改,并且您无法确定何时发生。

I think this means you need a technology other than iCloud. 我认为这意味着您需要除iCloud之外的其他技术。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM