Termin realizacji zamówienia: ok. 20 dni roboczych.
Darmowa dostawa!
Beginning-Intermediate user level
Use the popular Spring Data project for data access and persistence using various Java-based APIs such as JDBC, JPA, MongoDB, and more.
This book shows how to easily incorporate data persistence and accessibility into your microservices, cloud-native applications, and monolithic enterprise applications. It also teaches you how to perform unit and performance testing of a component that accesses a database. And it walks you through an example of each type of SQL and NoSQL database covered.
After reading this book, you’ll be able to create an application that interacts with one or multiple types of databases, and conduct unit and performance testing to analyze possible problems. Source code is available on GitHub.
What You’ll Learn
Become familiar with the Spring Data project and its modules for data access and persistence
Explore various SQL and NoSQL persistence types
Uncover the persistence and domain models, and handle transaction management for SQL
Migrate database changes and versioning for SQL
Dive into NoSQL persistence with Redis, MongoDB, Neo4j, and Cassandra
Handle reactive database programming and access with R2DBC and MongoDB
Conduct unit, integration, and performance testing, and more
Who This Book Is For
Experienced Java software application developers; programmers with experience using the Spring framework or the Spring Boot micro framework
Chapter 6: Versioning or Migrate the Changes of the Database
Part III - NO-SQL Persistence
Chapter 7: Redis key/value Database
Chapter 8: MongoDB Document Database
Chapter 9: Neo4j Graph Database
Chapter 10: Cassandra wide-column Database
Chapter 11: Reactive access w/R2DBC and MongoDB
Chapter 12: Unit/Integration Testing
Chapter 13: Performance Testing
Chapter 14: Best Practices
Part I - Introduction
This part or section contains all the introduction about the basics of the Spring and the architecture of the
application to use the persistence.
Chapter 1: Architecture of the applications
Chapter Goal: In this chapter, the readers will see the different ways of structuring one application and the
best practices to organize all the things related to persistence like the use of DAO (repositories on Spring).
• Small history of the methods of persistence (Plain query using the class of Java, ORM)
• Different types of architectures
o Layers
o Hexagonal or onion
• Persistence design patters
o DAO (Repositories in Spring)
o Data Transfer Object (DTO)
Chapter 2: Spring basics and beyond
Chapter Goal: In this chapter, the readers will see the different ways of structuring one application and the
best practices to organize all the things related to persistence like the use of DAO (repositories on Spring).
• Spring’s Architecture
• Dependency Injection and Inversion of Control
• Basic Application Setup
Chapter 3: Spring Data and different types of persistence
Chapter Goal: This chapter will provide a full explanation about Spring Data, how it works and what this library
does behind the scenes.
• How the Spring Data works
• How the Repositories works
o Using interfaces
o Defining a custom implementation
Part II - SQL persistence
This part or section contains the information about different aspects of the persistence of databases which
have a rigid schema. Also, the readers will see different strategies of deploying the changes on the schemas.
Chapter 4: Persistence and domain model
Chapter Goal: In this chapter, the readers will learn the basics about persistence and how it works behind the
scenes. Also, the readers will see how to create validations in the schema like the size of the column and the
different types of relationship between entities.
• JPA configuration using annotations
o Entity, Id
o Types of relationships
o Pre-update, pre-persist
• Ways to define the queries
o Using specifications
o Define SQL
• How validate the schema
• Types of Inherence
Chapter 5: Transaction management
Chapter Goal: In this chapter, the readers will learn the basics of the transactions and some concepts of ACID.
• Definition of ACID
• Isolation Levels
• Transactional levels
Chapter 6: Versioning or migrate the changes of the database
Chapter Goal: In this chapter the readers will see different tools or strategies to include the changes of the
databases, e.g use Liquibase/Flyway, running the scripts manually, or using the auto-update of the Spring.
Also, this chapter will include some mechanism to move the data from one column to another using feature
flags.
• Mechanism to migrate the changes
• Tools to versioning the changes
o Liquibase
o Flyway
• Using Feature Flags to new features
o What is a Feature flag?
o Benefits of use this approach
o Common libraries
Part III - NO-SQL persistence
In this section the idea is to cover one example of each type of the databases NO-SQL like key/value,
document, graph, and wide-column database. The idea is not to cover all more than one example of a type of
database because most of them have certain operations similar.
Chapter 7: Redis key/value database
Chapter Goal: In this chapter, the readers will see how to run a database and save the information using a
specific key. Also, this chapter will show the readers to create a serializer to persist data that is complex and
some best practices like persist the information in async mode.
The last point is how to configure the TTL in the information that the readers persist in the database.
• What is Redis and which are the benefits?
• Connecting with multiples Redis
• Persist synchronous or asynchronous
• Object Mapping and Conversion
Chapter 8: MongoDB Document database
Chapter Goal: In this chapter, the readers will see how to run a mongo database and how to persist the
information with the definition of the entities using the different operations that are permitted on MongoDB.
• What is a document store?
• Setting up a Mongo
• Access using repositories
• Manage transactions in a programmatic way
Chapter 9: Neo4j Graph database
Chapter Goal: In this chapter, the readers will see how to run a database and how to create different types of
queries. Also the reader will see the different aspects of the persistence of the information and the use of
reactive approach.
• Modeling the problem as a Graph
o Cases of user
o Benefits
• Persisting the domain
• Manage transactions
Chapter 10: Cassandra wide-column database
Chapter Goal: In this chapter, the readers will see how to configure the database on Spring and the
declaration of the entities that need to be used to persist the information. Also, the different ways to
persist or modify the information on Cassandra.
The last point is how to configure the TTL in the information that the readers persist in the database.
• What is Cassandra and how works?
• Configuration for Cassandra
• Access using repositories
• Defining a TTL
Part IV – Advanced, testing and best practices
This part covers some aspects of any type of database to create different types of tests and validate the
performance of the queries. Also, this section covers some best practices to reduce the possible problems or
mistakes in the applications that access a database.
Chapter 11: Reactive access
Chapter Goal: This chapter needs to cover how you can access and obtain the information in a reactive way.
• What is reactive access?
• Modifying queries to be reactive
o R2DBC
o MongoDB
Chapter 12: Unit/Integration testing
Chapter Goal: This chapter needs to cover more in detail how you can write unit tests without using an
existent database but using the same motor of the database, to do this the reader will use Test Cointainers
with Junit 5 which is the standard to write unit tests.
• Unit Testing with Mocks
• Integration Testing with a Database
o What is Test containers?
o Test Containers vs embedded
o How you can use it?
o Possible problems in the pipeline
Chapter 13: Performance testing
Chapter Goal: In this chapter the reader will use some tools like Gatling or QuickPerform to see how to
create a performance test and analyze if the queries have some issue related with the use of
CPU/memory.
• How check or analyze the performance of the queries?
• Analyzing the complexity of queries
• Performance test of an endpoint that access to a DB
Chapter 14: Best practices
Chapter Goal: In this chapter the reader will know some strategies to improve the performance of the
database including some mechanism of cache to reduce the number of times that anyone accesses to
obtain information.
• Access to the information
◦ Master-slave
• Using cache to reduce the accessed to DB
• Compress the information
• Lazy Loading Issues
• Pagination and ways to reduce the response
Andres Sacco is a Technical Lead at Prisma. He has experience using languages such as Java, PHP, and NodeJs. He also has experience using Spring. In his previous job, Andres helped find alternative ways to optimize the transference of data between microservices, which reduced the cost of infrastructure by 55%. He also has written internal courses about new technologies and articles on Medium. Andres shares his knowledge of using different types of databases, depending on the situation. He has experience with various types of testing, to search for problems in queries or repositories that access the database.
Use the popular Spring Data project for data access and persistence using various Java-based APIs such as JDBC, JPA, MongoDB, and more.
This book shows how to easily incorporate data persistence and accessibility into your microservices, cloud-native applications, and monolithic enterprise applications. It also teaches you how to perform unit and performance testing of a component that accesses a database. And it walks you through an example of each type of SQL and NoSQL database covered.
After reading this book, you’ll be able to create an application that interacts with one or multiple types of databases, and conduct unit and performance testing to analyze possible problems. Source code is available on GitHub.
You will:
Become familiar with the Spring Data project and its modules for data access and persistence
Explore various SQL and NoSQL persistence types
Uncover the persistence and domain models, and handle transaction management for SQL
Migrate database changes and versioning for SQL
Dive into NoSQL persistence with Redis, MongoDB, Neo4j, and Cassandra
Handle reactive database programming and access with R2DBC and MongoDB
Conduct unit, integration, and performance testing, and more