I'll start by defining reference data; reference data is the data an application needs to run, excluding any data it collects from the user. For example a stock trading application would have the current stock prices as its reference data, it doesn't collect this from the user - I'd be a millionaire if I could enter the price at which I want to trade my shares - but it is data that is required for the application to function.
Reference data in its own right isn't a problem, however when you want to share the same data with multiple applications it can become a problem to maintain this data. Especially when you start to look into architectures like SOA or other high cohesion / low coupling paradigms where every service or application is a completely self contained unit that isn't dependent on any other systems to run.
The purpose of this article is to collect a number of different approaches to centrally manage this reference data and highlight their benefits / drawbacks. Not one approach is by definition better than others and this article is not aimed to make a recommendation as to which approach should be implemented, rather the purpose of this article is to highlight the merits and drawbacks of each approach so that a suitable approach can be chosen for the requirements at hand. Feedback is greatly appreciated, be it additional patterns or changes to existing patterns.
Problem statement
Often applications are built in isolation to ensure high cohesion and low coupling between applications. The drawback to this approach is that little is shared between applications, including reference data which is often common between multiple applications. You could think of data such as marital statuses, post code (zip code for US readers) lookup data or current stock prices to name but a few.
A typical scenario is shown in the image below. The arrows indicate data flow of reference data (all other data is ignored for this article to keep the images clean).

Two applications live inside their own domain and both have their own datastore. These datastores contains data that could be shared between the two applications. The drawbacks of this approach include:
- Duplication of data
- Duplication of management effort
- No single version of the truth (e.g. if the data is different, which is right?)
Patterns
Replicated reference data
A central datastore contains a maintained version of the reference data. This data is replicated into application specific datastores either periodically or on a user's request. The applications have no knowledge of the central database and only speak to their local database which contains the reference data.

Benefits of this pattern
- Reference data is maintained in a single location
- No dependency between the applications and the central datastore
- No clear single version of the truth, updates can be made in an application specific database and later wiped out by the replication
- Replication causes a tight coupling in schema between source and destination
- The application has no control over refreshing of the data, some applications need more frequent updating of certain reference data than others
Centralised reference data
The reference data only exists in a central datastore. Each application using the data references the datastore directly, having full knowledge of the existence and schema of the reference datastore.

Benefits of this pattern
- Reference data is maintained in a single location
- Single version of the truth
- Applications always have the latest version of the reference data
- Depending on the network topology this can damage performance of the applications
- Tight coupling between central datastore and applications
- Changes to central datastore schema require changes to all dependent applications
- If the central datastore is down or there are network problems between the applications and the central datastore then the applications will experience downtime
- Maintenance on the central datastore is limited to times when the applications can be taken down


Join the conversation! Your thoughts help the community grow.