Chapter 9. Managing Data

This chapter will address some of the concerns of managing data when building a scalable cloud native application. We will review some familiar methods for modeling the data of a domain. We’ll take a look at how Spring Data projects expose repositories for managing data. We will also look at a few examples of microservices that manage exclusive data access to a data source using the Spring Data projects.

Modeling Data

Well-constructed data models help us effectively communicate the desires of a business’s domain in our software applications. Domain models, like the one in Figure 9-1, can be constructed to express the most important aspects of a business’s domain. One of the most successful techniques for domain modeling was first presented by Eric Evans in his seminal book, Domain-Driven Design: Tackling Complexity in the Heart of Software (Addison-Wesley).

Entity-relationship diagram of a domain model
Figure 9-1. A domain model expressing the relationships between domain classes

Evans popularized the concepts of domain-driven design by advancing the idea that both the domain experts in the business and the software engineers in the IT organization should be able to effectively communicate using unambiguous terms that describe objects and modules in a software application.

The problem that domain-driven design purported to solve was complexity. Evans subtitled his book “Tackling Complexity in the ...

Get Cloud Native Java now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.