Can a streaming collection be implemented in Java?

I needed to implement a utility server that monitors several custom variables that will be sent from any other server. To track variables, you must use a collection of key values, either the JDK or user-defined.

Here are a few considerations -

  • Storing all variables in server memory is intense all the time.
  • This server should be a very lightweight server, and I do not need heavy database operations.

Is there a specific stream collection that can serialize data after threshold memory and retrieve it based on need?

I hope I clearly define the problem statement.

Please suggest if any other approach is better.

+4
source share
3 answers

this thing looks very promising, but is under development ...

Jdbm3

Change Current version of files supported by files: MapDB .

+2
source

Database

What you described sounds exactly like you should use a database (i.e. an indexed key / value store is too large for memory, but if possible, it is advisable to take advantage of in-memory caching).

I would recommend a lightweight built-in database like H2 - it is small, fast and should fit your goals very well.

+1
source

Do you think you are using a nosql queue value store on a shelf? Redis for example?

If you want to use java only you have the opportunity to use lib, for example ehcache , it will have the necessary functions.

0
source

Source: https://habr.com/ru/post/1415271/


All Articles