官术网_书友最值得收藏!

  • Spring 5.0 By Example
  • Claudio Eduardo de Oliveira
  • 370字
  • 2021-06-24 19:17:39

Persistence with Spring Data and Reactive Fashion

In the previous chapter, we created our Content Management System (CMS) application. We also introduced REST (Representational State Transfer) support in Spring, which enabled us to develop a simple web application. Also, we learned how dependency injection works in the Spring Framework, which is probably the most famous feature of the framework.

In this chapter, we will add more features to our application. Systems in the real world need to persist their data on a real database; this is an essential characteristic for a production-ready application. Also, based on our model, we need to choose the correct data structure to achieve performance and avoid the impedance mismatch.

In the first part of this chapter, we will use the traditional SQL database as a store for our application. We will deep dive on the Spring Data JPA (Java Persistence API) to achieve the persistence for our CMS application. We will understand how to enable transactions with this amazing Spring module.

After that, we will change to a more modern type of database called NoSQL technologies. In this field, we will use the famous database document model called MongoDB and then we will create the final solution for our CMS application.

MongoDB offers a fantastic solution for our application because it has support for a document storage model and enables us to store our objects in the form of JSON, which makes our data more readable. Also, MongoDB is schema-less, which is a fantastic feature because one collection can store different documents. It means records can have different fields, content, and sizes. The other important characteristic from MongoDB is the query model. It offers a document-based query that is easy to understand, and, based on JSON notations, our queries will be more readable than any other database can be.

Finally, we will add the most important feature present in Spring 5.0: support for Reactive Streams. Our application will be transformed into a modern web application which has some important requirements.

Here's an overview of what you will learn in this chapter:

  • Implementing the Spring Data JPA
  • Creating repositories with Spring Data Reactive MongoDB
  • Learning the Reactive Spring
  • Understand the Project Reactor
主站蜘蛛池模板: 宜宾县| 尼勒克县| 乌拉特中旗| 延川县| 南平市| 大渡口区| 平果县| 中方县| 公主岭市| 新营市| 塔城市| 拉孜县| 寿宁县| 林口县| 新平| 措勤县| 长春市| 湖口县| 拜城县| 平南县| 岳普湖县| 衡东县| 涟水县| 姚安县| 临江市| 永胜县| 沭阳县| 施甸县| 东港市| 洪湖市| 灵武市| 陈巴尔虎旗| 崇信县| 鹰潭市| 汉寿县| 大理市| 花莲市| 南投市| 木里| 离岛区| 万全县|