Results 1 to 9 of 9
  1. #1
    CJC
    CJC is offline Member
    Join Date
    Aug 2011
    Posts
    5
    Rep Power
    0

    Default Style for Local Database storage

    I have to create a local db capable of read/write, modify, delete, comparison, and search.

    I have seen flat text files, serialized arraylist, and local MySql dbs, but I am unsure which construct would best suit my needs or if there are any better techniques out there.

    The db will contain 5,000+ entries, with at a minimum 5 attributes per entry.

    What are some good techniques to accomplish this goal? If more information is needed please let me know.

  2. #2
    Petr's Avatar
    Petr is offline Senior Member
    Join Date
    Jan 2011
    Location
    Russia
    Posts
    618
    Rep Power
    4

    Default Re: Style for Local Database storage

    Hi, It depends from relate with entry. So Can you explain how you imagine with layer?
    Skype: petrarsentev
    http://TrackStudio.com

  3. #3
    Tolls is online now Moderator
    Join Date
    Apr 2009
    Posts
    11,758
    Rep Power
    19

    Default Re: Style for Local Database storage

    Quote Originally Posted by CJC View Post
    I have to create a local db capable of read/write, modify, delete, comparison, and search.
    That essentially desscribes any database.
    It's not really narrowing down your requirements at all.

    Is it going to have multiple users?
    Is there going to be a lot of searching on it?
    Is the searching going to use lots of different criteria?
    Does it matter if you lose some data should the system crash?

  4. #4
    CJC
    CJC is offline Member
    Join Date
    Aug 2011
    Posts
    5
    Rep Power
    0

    Default Re: Style for Local Database storage

    Is it going to have multiple users? No, single user

    Is there going to be a lot of searching on it? No, but should have ability for maintenance/troubleshooting

    Is the searching going to use lots of different criteria? No, only PK and 2 other possible criteria

    Does it matter if you lose some data should the system crash? Yes. Data integrity is paramount.

    The application essentially will be taking users from AD through an LDAP query, storing the users in a new local db, comparing the new local db with old local db for adds/modifies/deletes and then syncing the changes to the destination. The sync runs every hour, 7 days a week. Db needs to be searchable for maintenance related functions.

    Row attributes: PK, SK, User DN, Create Timestamp, Modify Timestamp, Email, First, Last, Title....possibly more

    The current code uses hashtables and then writes to flat text files (csv), however the code is 5+ years old and I am looking for a more efficient method if it exists.
    Last edited by CJC; 09-27-2011 at 04:36 PM.

  5. #5
    Tolls is online now Moderator
    Join Date
    Apr 2009
    Posts
    11,758
    Rep Power
    19

    Default Re: Style for Local Database storage

    Since you do synching anyway, it'll be the LDAP side that needs to be OK. And since that's run every hour then a failure by a client to update due to a crash won't be a problem...it'll just update the following hour.

    MySQL's probably too much for this.
    The multiple search criteria (to me) says database, though, otherwise you'll need multiple maps. Besides, it's simply more flexible.

    This is the sort of thing (offhand) that the likes of an embedded db (Derby, SQLLite, etc) are for, really. You're only dealing with 5000 records or so, so lack of indexes is not a problem. If you timestamp your db updates from LDAP then you should be OK.

  6. #6
    CJC
    CJC is offline Member
    Join Date
    Aug 2011
    Posts
    5
    Rep Power
    0

    Default Re: Style for Local Database storage

    Do embedded dbs have comparison methods i.e. db1.compare(db2), or will I need to create custom methods?

  7. #7
    Tolls is online now Moderator
    Join Date
    Apr 2009
    Posts
    11,758
    Rep Power
    19

    Default Re: Style for Local Database storage

    You treat them like any other db, just that it's launched by your app.
    So you'd need to manually do your comparison.

    Shouldn't be too hard should it?
    Does the LDAP call return everything on the AD? Or just list stuff that has changed?

  8. #8
    CJC
    CJC is offline Member
    Join Date
    Aug 2011
    Posts
    5
    Rep Power
    0

    Default Re: Style for Local Database storage

    The LDAP call returns everything, and then I will manually do the comparisons. It's not going to be hard, I was hopeful that I didn't have build it from scratch.

    Thank you for your help Tolls.

  9. #9
    Tolls is online now Moderator
    Join Date
    Apr 2009
    Posts
    11,758
    Rep Power
    19

    Default Re: Style for Local Database storage

    OK, so you can ignore the last sentence above about a timestamp, since you're comparing everything anyway.

Similar Threads

  1. Replies: 1
    Last Post: 03-05-2011, 05:47 PM
  2. upload file from local system to database
    By harsha.udupa2008 in forum Advanced Java
    Replies: 3
    Last Post: 09-17-2010, 08:58 AM
  3. problem regarding for storage of images in database
    By mudit222 in forum JavaServer Pages (JSP) and JSTL
    Replies: 11
    Last Post: 04-15-2010, 10:37 PM
  4. Accesing database(Access) from a local machine
    By ersachinjain in forum JDBC
    Replies: 0
    Last Post: 08-14-2009, 05:09 PM
  5. Array storage
    By Stev0 in forum New To Java
    Replies: 6
    Last Post: 04-17-2008, 07:18 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •