search

Home  >  Q&A  >  body text

php - Data synchronization problem between App and background

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?

淡淡烟草味淡淡烟草味2789 days ago877

reply all(6)I'll reply

  • 漂亮男人

    漂亮男人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:

    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

    reply
    0
  • 给我你的怀抱

    给我你的怀抱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.

    reply
    0
  • 曾经蜡笔没有小新

    曾经蜡笔没有小新2017-05-16 12:04:13

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

    reply
    0
  • 怪我咯

    怪我咯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

    reply
    0
  • 大家讲道理

    大家讲道理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

    reply
    0
  • 阿神

    阿神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

    reply
    0
  • Cancelreply