The best approach to building a mobile service that’s also available when the connection drops?

Hopefully this question will be a good suit for P.SE since it is a whiteboard-level ‘how can this be done’ conceptual question.

I’m trying to build a product that needs to be available to someone on the move with a mobile device when their connection may be quite poor (due to travelling between cities where 3G coverage is stronger).

For simplicity, let’s say the application is an address book.

The user must be able to add/remove/edit all contacts in the address regardless of connection state, then those changes iterated to a central server DB whenever the connection next becomes available (and any changes made on the server since the connection dropped also downloaded).

I was originally building the application with PHP/Symfony working with static pages but this new ‘mobile’ requirement has made me re-think my front-end technology.

I’m now looking at using EmberJS for my frontend (download all the necessary frontend templates with the initial request, then only update the dynamic parts seems like it would suit my application better than serving an entire static page (and resources) for every request).

I’ve been implementing Ember-Data with the standard REST Adapter which is working great with my already-existent Symfony2 API, so I’ve greatly reduced the amount of data being sent/received and the responsive ‘feel’ of the app but still need to tackle my ‘no-connection-available’ scenario.

Instinctively, I’m drawn to HTML5’s LocalStorage functionality but can see synchronizing data between the localstorage and central DB server being a gigantic headache.

Let’s say I add “Bob Smith” to the address book from my mobile when the connection is up. The connection drops. I change the name to “Bob Jones” and then change the name to “Fred Smith” using a desktop with a stable connection. When the mobile re-connects, which update takes precedence?

I saw this question regarding using multiple data adapters (REST and LocalStorage) with Ember and it looks like I’m in for a world of hurt. Should I just build a nice-responsive version of the app/service with Ember/REST Adapter, then roll native mobile apps for the on-the-move version? Will handling data persistence be easier to handle as a native app?

1

The “no connection” requirement makes me think that a web-based solution is not the best fit here. You might get it to work if the connection was lost after the initial page is shown, but what if the user turned the device on in an area with no coverage.

The best solution, in my opinion, would be a native app that stores the data locally and tries to synchronize periodically with the central database. If during such a synchronization a conflict is detected, the app should ask the user to resolve the conflict.

It might also be worthwhile to investigate existing native apps that are similar to what you are building and see in how far they already support synchronization with an external server. If you are lucky, you would only need to implement the server side of a standard synchronization protocol and have a perfectly working solution.

2

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật