Defining Our E-commerce Application’s Domain
Explore defining core domain models for an e-commerce app using Spring Boot's reactive programming and MongoDB. Understand how to create inventory, cart items, and cart objects aligned with best data modeling practices.
We'll cover the following...
In this lesson, now that we’re embracing a real database, we can actually start modeling our e-commerce site. Let’s start with a new project created using Spring Initializr.
Adding database dependencies
First, we’ll add some new dependencies to our pom.xml build file:
Line 5 has the first dependency, spring-boot-starter-data-mongodb-reactive, which is one of pom.xml.
There are many reactive datastore modules in Spring Boot.
Reactive datastore modules
Module | Description |
| Core Spring Boot module that glues things together |
| Spring Data MongoDB itself, but with the blocking MongoDB drivers excluded |
| MongoDB’s official Reactive Streams driver |
That starter introduces Spring Data MongoDB. Specifically, it introduces the reactive version of that library. A classic spring-boot-starter-data-mongodb start also uses MongoDB’s classic blocking API. Spring Data MongoDB has complete support for Reactive Streams and ...