-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Distributed database: object identification strategy
PostPosted: Sun Sep 19, 2010 8:05 am 
Newbie

Joined: Sun Sep 19, 2010 4:56 am
Posts: 1
Hi, everyone.

I need to develop an application which uses distributed data sources and synchronizes data between then. Each data source is unique identified by an integer number. All data sources contain similar data but data schemes could slightly differ. For example, there are two kinds of data sources: a newly developed application database and legacy database. I'm going to develop some kind of data adapter from legacy database data to new application database format.

Key requirements are:
- each object must be uniquely identified within distributed system via database id and local object id
- objects can migrate from one database to another in a tricky way

My question is related to an implementation of identification strategy.

Let's say we can't use UUIDs for object identification.

Alternative #1: Using composite identifiers
Pros
- a natural and simple solution
- a simple way to implement data source-based analytics (if needed)

Cons
- need to develop identifier generator which actually implemented in Hibernate (enhanced table generator)
- need to manually assign identifier to the object
- I need to consider two-column identifier in queries and mappings

Alternative #2: Using long identifiers. First two bytes of identifier are the database id
Pros
- I can implement identifier generator and tell Hibernate to use it (reuse existing code)
- mappings and queries become simpler, because there's only one key field
- don't need to manually assign identifiers to objects

Cons
- there's an implication in identifier value
- It becomes a bit harder to develop data source-based analytics (if needed)

I would like to know the community opinion about these alternatives. Are there other pros & cons of each? Am I missing something?

For now I've implemented the first alternative and I don't like it much.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.