Chapter 12. Working with NoSQL databases
This chapter covers
- Writing repositories backed by MongoDB and Neo4j
- Persisting data across multiple data stores
- Working with Spring and Redis
In his autobiography, Henry Ford is famous for having written “Any customer can have a car painted any color that he wants so long as it is black.”[1] Some say this statement was arrogant and bull-headed. Others may think he was showing a bit of humor. The reality, however, may be found in the fact that at the time his biography was published, he was cutting costs by using a quick-drying paint that was only available in black.
1 Henry Ford and Samuel Crowther, My Life and Work (Garden City, New York: Garden City Publishing Company, 1922).
Paraphrasing Ford’s famous quote and applying it to database choice, we’ve been told for years that we can have any database we want, as long as it’s a relational database. Relational databases have had a near-monopolistic hold on application development for a very long time.
But that hold is weakening now that some serious contenders have entered the database space. The so-called “NoSQL” databases are making inroads into production applications everywhere as we recognize that there’s no one-size-fits-all database. We now have a greater choice and can choose the best database for the problem we’re trying to solve.