The backend is a web data management system with C/S architecture. Data added by App users can be seen in the backend. Data deleted by users on the App side can be updated by refreshing the data in the background. But if the user's data is deleted in the background operation, how can it be synchronized to the App? ? ? Is there any good solution for this synchronization mechanism?
漂亮男人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