Win a copy of Java Persistence with Spring Data and Hibernate this week in the Spring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Tim Cooke
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Jeanne Boyarsky
Saloon Keepers:
  • Stephan van Hulst
  • Carey Brown
  • Tim Holloway
  • Piet Souris
Bartenders:

Help me to find cache-like solution to store data permanently.

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, guys.

I need to store a list of objects in outside file(s) and load all of them when server restarts. I googled the solution but I didn't find anything. Does anyone know the solution which makes it easy to do such operations?

The list will be updated sometimes: some objects are updated and some objects are added. Removal will be rare operation. Total count of objects will be no more than 200 000 . All of objects must be available for application. I wish all of them must be in memory.

I think that I shouldn't use any database because it make application more complex and I don't want to have one more server.

I've found that JSC or Ehcache can be used for this purpose. But JSC saves its data only on dispose or close. Ehcache is designed to work as cache but not as permanent storage.

That's all that I could find. Please, give me an advice if you know the answer.

Thank you in advance.
 
Rancher
Posts: 4803
7
Mac OS X VI Editor Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Why not store the data in a normal operating system file, and read them in on startup.

Or do you really need the write-back characteristics of a cache?

I do not understand your comment about "another server". There are lots of RDBMS packages that can run with your application. I run MySql on all of the computers in my house, including the laptop that I am typing this on right now.

There are very good reasons to use an RDBMS package. I don't understand your reason not to.
 
dmitry dvoinov
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Pat Farrell, thank you for the reply.

When I said "another server" I ment that I don't want to run other application except my application. It got confused you, sorry.

The reason not to use any RDBMS package is that I think that my task isn't too complex. Using it like breaking a butterfly on the wheel. It might be implemented in other, easier way.

I don't want to write and read file manually because I've thought that if I use third party library it will be easier to use, faster and there will be lesser bugs. So, I'm still choosing a solution.

 
They worship nothing. They say it's because nothing lasts forever. Like this tiny ad:
The Low Tech Laboratory Movie Kickstarter is LIVE NOW!
https://www.kickstarter.com/projects/paulwheaton/low-tech
reply
    Bookmark Topic Watch Topic
  • New Topic