后台是一个web数据管理系统,C/S架构,App端用户添加的数据可在后台看到。App端用户自己删除的数据,后台刷新数据就能更新。但是后台操作删除用户的数据,如何同步到App端???这种同步机制有没有好的解决方案?
漂亮男人2017-05-16 12:04:13
Push, there are many mature APP push solutions now. Needless to say, for iOS, third-party services such as Aurora Push are also good for Android.
If you don’t want to use third-party services, you can also solve it yourself:
APP keeps making requests to the server (sounds low, ha)
The APP maintains a long connection with the server. When the server data is updated, it will immediately send a message to the APP
给我你的怀抱2017-05-16 12:04:13
This depends on your needs. If you require real-time display, then use the push service.
If you do not require real-time display, then query it every time you open the app.
曾经蜡笔没有小新2017-05-16 12:04:13
Then create a scheduled refresh and decide the frequency according to needs.
怪我咯2017-05-16 12:04:13
swoole, workman, openfire, third-party push, timer, of course these need to be adjusted according to your business requirements and specific scenarios
大家讲道理2017-05-16 12:04:13
If the data is deleted in the background, there is no need to synchronize it. You can just re-enter the page and request the data. If you want to stay on this page, just set a timer and refresh the data as mentioned above
阿神2017-05-16 12:04:13
If you have high requirements for real-time data, push can be said to be essential. Then you can have a timer to request data regularly. Of course, the response to this request must be processed well, so that the push and the timer agree with each other to achieve the effect you want. cache