1

I have written a spring batch solution which currently uses the embedded H2 in-memory database.

The read and write operations uses SOLR Cloud API calls.

Ideally, we dont want to introduce an proper relational database as a job repo database, for the read-write batch operation.

I read that H2 in-memory databases are best used for Dev and Test in spring batch.

Does anyone have experience of using this H2 database in spring batch on a proper live environment dealing with millions of records in the batch processing, but batch job will ran only once a day at most?

If H2 is not stable for prod, I might have to ditch spring batch OMG, or anyother alternatives?

Open to any ideas or references.

Thanks in advance.

Mega
  • 1,304
  • 5
  • 22
  • 37

1 Answers1

2

H2 is a light-weight Java database, as you mentioned yourself, that it is ideal for dev testing !

When considering production, you might be missing on lot of features which a RDBMS , NoSQL databases provide!

For e.g. Replication, memory and performance optimizations etc.

If frequent reads and writes are concerned and you don't want RDBMS, you may choose MongoDB or Couchbase to manipulate records , they are fast too !

So considering Millions of records, I don't think H2 would be a good choice for production databases

A similar article might throw some light & help you decide !

Are there any reasons why h2 database shouldn't be used in production?

Harsh
  • 812
  • 1
  • 10
  • 23
  • Thanks a lot Harsh for the prompt response. I am exploring writing a bespoke batch processing app, that meets our requirement, which will be based on core features of spring batch. – Mega Jul 26 '22 at 08:46