Logo 
Search:

Java Answers

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds
  Question Asked By: Arland Smith   on Mar 14 In Java Category.

  
Question Answered By: Ora Hanson   on Mar 14


First, my source of confusion is why would you insert duplicate  data
into your database. You may need to check your object in the UI, if
applicable, and then insert  it into database.

Anyway, I wouldn't go for Hashing. The point is that you will have to
check your database  quite a few times to find the right id. The world
would be a better place if we could define a hash function that maps
our objects to unique  ids.

You could alternatively rely on your database auto numbering, but you
will need to put it in a stored procedure to check whether not the
record is already in database. Your database is indexed and a String
search is fast anyway. On top of that, putting this logic in the
database will give  you scalability at a minor cost. You always have
the option  to add another machine to the cluster if the performance
sucks.

Share: 

 

This Question has 6 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on RDB design, Avoiding Duplicate Records Or get search suggestion and latest updates.


Tagged: