
Originally Posted by
Dave Syer
Thanks for the link. NoSql is definitely a future direction for Spring and Spring Batch, but we aren't sure yet how to organize the code since there are so many options out there. Mongo is a nice product but it isn't the only one.
People are going to want to use noSql for their business data, so we want to try and accommodate that, but it's not clear yet that JobRepository is a good fit for noSql, and there is also the JobExplorer and JobService (from Spring Batch Admin) to consider. The JobRepository in particular will probably get a major overhaul in Spring Batch 3.0, so there is a good opportunity to feed in requirements from noSql there.
Not all noSql products can support all the use cases from Spring Batch and Spring Batch Admin. Mongo is pretty good in this regard: it probably permits implementation of the Searchable*Dao interfaces from Admin. Some other products would be tougher.
Transactions are the big sticking point. Spring Batch users basically have to give up some restartability guarantees when using non-transactional databases. The Map implementation we have is transaction synchronized, but not really 100% reliable since there is no transactional resource. I recommend not to use it in production, but that doesn't stop some people. NoSql repositories might follow the same pattern, and maybe if we see some traction we can be more explicit about what the tradeoffs are.
Does your implementation pass all the tests in the project (including samples)?