Are there any design patterns for configuration synchronisation [closed]
Asked Answered
V

2

6

I was wondering if anyone knew of any design patterns, articles or other information for the problem of synchronising settings between multiple devices.

Say a web site, an iPhone app and an iPad app; with future devices coming along later.

Any information would be greatly appreciated. If you need more information, to answer properly, please say so and I can elaborate the problem.

Vernation answered 22/12, 2010 at 14:24 Comment(2)
Do you mean application settings for an application that is available both online and as native application on various devices? If not, what kind of settings are you talking about? If so, what kind of application is it, and do you just want to synchronise 'settings' (presumed to be a small number of simple data objects) or more complex application data?Taphole
Yes application settings like multiple 'likes' and 'dislikes' of various things quite simple objects strings basically. In a consumer app available on various online and offline devices. Bit like MobileMe does or even google sync. Can't guarantee any one device will be online and syncing every day and things will get added and deleted on each deviceVernation
K
2

You can follow this link for the Sync ML standard. This can give a you a template to extend the framework to accommodate more data and settings not already handled This - gives detail on an open source synchronization framework

Kimberleekimberley answered 29/12, 2010 at 6:42 Comment(1)
OpenSync, although designed for a more specific role, is general enough in concept to verify my ideas. Thanks. Not sure I can use the code itself due to complexity and dependencies but it's an ideal thing to be reading up on. Thanks you are the winner :-)Vernation
D
1

Forgive me if the following seems too general, but I tried to keep it high level so that it falls in line with your question. I don't know if what you're looking for would be called a "design pattern" per se. It sounds like you're looking for a synchronization paradigm/system. Note, my assumption in this response is that you need to have both online and offline capability for your application (since you explicitly mentioned synchronization.) If I'm mistaken, please let me know.

In particular, what you're probably looking for is generally implemented using two things: 1) a "distributed" database, (one that works offline on the client applications such as the mobile apps, as well as on any servers) and 2) a synchronization and conflict resolution mechanism.

A very good example of this is the source code management tool Git. Git has both of the aforementioned characteristics. First, it uses a database (e.g. a git project's file system) that is distributable (e.g. the project can be cloned from one developer's workstation to another and worked on independently.) Second, it has a mechanism for synchronization and conflict resolution mechanism. That is to say, if I attempt to synchronize (e.g. pull changes) from a colleague's workstation, differences between her code and my code may be merged (either automatically or by hand.)

Another example, and perhaps more relevant to your application, is Evernote. If I'm not mistaken, Evernote uses the same sort of paradigm (a flat file database) to synchronize documents, and has desktop clients, a web site, and mobile clients.

This is not to say that you need to use a flat file database. You could just as easily use a a relational or other database. Also, depending on what kind of data you're trying to store and synchronize, you might be able to get away with very simple conflict resolution. (For instance, if you're just storing status updates, vote counts, etc, perhaps you just choose the newest entry in the database.)

In a nutshell, the tools I've mentioned seem to follow this kind of workflow:

  1. When starting a session on the client application, synchronize or "update" the client by going online and pulling new data. This is where you identify and resolve conflicts between the data on the client and what is on the server or "cloud".
  2. Edit or create data "offline" on the client, be it the website, mobile app, etc.
  3. Synchronize or "update" the cloud by going online and pushing the data you changed
Depth answered 28/12, 2010 at 22:39 Comment(2)
Exactly right. But I was looking for a design for a system to achieve exactly what you mention; whether it be a 'pattern' or links to articles where people have discussed the various methods of achieving such a system with their related pros and cons. Do u know of anything or anywhere this info could be?Vernation
I should add that I have spent some time on this and have looked round the net and couldnt find anything, but I have a couple of possible solutions to the problem but was hoping someone with a bit more experience in this area and who has already solved the problem may be able to verify what I have learnt or suggest a method I hadn't yet thought ofVernation

© 2022 - 2024 — McMap. All rights reserved.