php - App与后台同步数据问题
淡淡烟草味
淡淡烟草味 2017-05-16 12:02:13
0
6
802

后台是一个web数据管理系统,C/S架构,App端用户添加的数据可在后台看到。App端用户自己删除的数据,后台刷新数据就能更新。但是后台操作删除用户的数据,如何同步到App端???这种同步机制有没有好的解决方案?

淡淡烟草味
淡淡烟草味

reply all(6)
漂亮男人

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:

  1. APP keeps making requests to the server (sounds low, ha)

  2. The APP maintains a long connection with the server. When the server data is updated, it will immediately send a message to the APP

给我你的怀抱

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.

曾经蜡笔没有小新

Then create a scheduled refresh and decide the frequency according to needs.

刘奇

swoole, workman, openfire, third-party push, timer, of course these need to be adjusted according to your business requirements and specific scenarios

大家讲道理

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

阿神

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

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!