DOI QR코드

DOI QR Code

An Implementation of Real Time Data Synchronization of Multiple Devices by Offline-first Strategy

오프라인 우선 정책에 의한 멀티 디바이스의 실시간 데이터 동기화 구현

  • Received : 2018.07.11
  • Accepted : 2018.10.31
  • Published : 2018.12.31

Abstract

Offline-first strategy is that it allows data to be saved while offline, and when connected online, data is synchronized to ensure that all devices have the same data. Multi-device is a term that shares data through synchronization on various platforms on Android, ios, etc. First, all of the data is stored in the local repository like SQLite and then on the server via HTTP communication. Then, the synchronization is completed by receiving the changed data from the server and storing it in the local repository at the time of the synchronization, and sending the changes to the server from the client. We proposed and implemented a database structure, APIs, and a illustrative application running on PC and Android phone.

Keywords

OBDDBE_2018_v13n6_329_f0001.png 이미지

그림 1. 다양한 기기의 데이터 동기화 기능 지원 (WunderList) Fig. 1 Data synchronization among several devices (WunderList)

OBDDBE_2018_v13n6_329_f0002.png 이미지

그림 2. sync_at 이후의 서버의 변경 사항 반영 Fig. 2 Modification of changes of the server after sync_at service

OBDDBE_2018_v13n6_329_f0003.png 이미지

그림 3. 클라이언트의 변경사항 전송 Fig. 3 Sending changes of client to server

OBDDBE_2018_v13n6_329_f0004.png 이미지

그림4. 데이터베이스 구조 예시 Fig 4. Database structure

OBDDBE_2018_v13n6_329_f0005.png 이미지

그림 5. 서버의 변경사항을 받기위한 API Fig. 5 API for receiving changes of server

OBDDBE_2018_v13n6_329_f0006.png 이미지

그림 6. 로컬 저장소 동기화 과정 블록다이어그램 Fig. 6 Block diagram of synchronization of local repository

OBDDBE_2018_v13n6_329_f0007.png 이미지

그림 7. 클라이언트의 변경사항을 전달하는 API Fig. 7 API to send the changes of clients

OBDDBE_2018_v13n6_329_f0008.png 이미지

그림 8. 서버-클라이언트간의 시간 차이 제거 코드 Fig. 8 Example code to eliminate the time difference between server and client

OBDDBE_2018_v13n6_329_f0009.png 이미지

그림 9. 테스트를 위한 앱 구현 (질문 리스트 화면) Fig. 9 Implementation of a test application

OBDDBE_2018_v13n6_329_f0010.png 이미지

그림 10. 테스트를 위한 앱 구현 (상세 답변 화면) Fig. 10 Implementation of a test application

OBDDBE_2018_v13n6_329_f0011.png 이미지

그림 11. 소스 코드의 공개 Fig. 11 Release version of source Code

OBDDBE_2018_v13n6_329_f0012.png 이미지

그림 12. 테스트 환경 구성도 Fig. 12 Configuration of test scenario

References

  1. Avaliable on : https://www.wunderlist.com/ko/
  2. Avaliable on : https://ko.todoist.com/
  3. Avaliable on : https://calendar.google.com/
  4. D.J. Jang, K.H. Park, H.T. Ju, "Development of Data Synchronization Client Based on SyncML," Jounal of KIISE Trans. Computing Practices, Vol. 11, No. 4, pp. 257-367, 2005.(in Korean)
  5. Darin C. Glatt, Beaverton, "System and Method of Data Synchronization Between Devices," United States Patent. No. 7,962,575, 2011.
  6. Avaliable on : https://developers.google.com/calendar/v3/sync
  7. Avaliable on : http://havrl.blogspot.com/2013/08/synchronization-algorithm-for.html
  8. Nurzhan Nurseitov, Michale Paulson, Randall Reynolds, Clemente Izurieta, "Comparison of JSON and XML Data Interchange Formats: a Case Study," Proceedings of CAINE, No. 9, pp. 157-162, 2009.
  9. Avaliable on : https://github.com/moka-a/Offline-first-multi-device-real-time-data-synchronize
  10. Avaliable on : https://realm.io/kr/products/realm-database
  11. Avaliable on : http://square.github.io/retrofit/
  12. Stefan Tilkov, Steve Vinoski, "Node.js: Using Javascript to Build High-performance Network Programs," Proceedings of IEEE internet computing, Vol. 14, No. 6, pp. 80-83, 2010. https://doi.org/10.1109/MIC.2010.145