Book Image

Persistence Best Practices for Java Applications

By : Otavio Santana, Karina Varela
Book Image

Persistence Best Practices for Java Applications

By: Otavio Santana, Karina Varela

Overview of this book

Having a solid software architecture breathes life into tech solutions. In the early stages of an application’s development, critical decisions need to be made, such as whether to go for microservices, a monolithic architecture, the event-driven approach, or containerization. In Java contexts, frameworks and runtimes also need to be defi ned. But one aspect is often overlooked – the persistence layer – which plays a vital role similar to that of data stores in modern cloud-native solutions. To optimize applications and data stores, a holistic understanding of best practices, technologies, and existing approaches is crucial. This book presents well-established patterns and standards that can be used in Java solutions, with valuable insights into the pros and cons of trending technologies and frameworks used in cloud-native microservices, alongside good Java coding practices. As you progress, you’ll confront the challenges of cloud adoption head-on, particularly those tied to the growing need for cost reduction through stack modernization. Within these pages, you’ll discover application modernization strategies and learn how enterprise data integration patterns and event-driven architectures enable smooth modernization processes with low-to-zero impact on the existing legacy stack.
Table of Contents (18 chapters)
1
Part 1: Persistence in Cloud Computing – Storing and Managing Data in Modern Software Architecture
6
Part 2: Jakarta EE, MicroProfile, Modern Persistence Technologies, and Their Trade-Offs
9
Chapter 7: The Missing Guide for jOOQ Adoption
11
Part 3: Architectural Perspective over Persistence

What this book covers

Chapter 1, Storing Data: from the Caves to the Clouds, is where you will acquire the foundation knowledge you’ll need for what’s coming next in the book, so buckle up. You will learn about the challenges of storing data, which gave birth to the first data storage solutions. As technology advanced, databases evolved into robust and reliable solutions. The Java ecosystem responded well and grew along with the data ecosystem, providing users with frameworks, application servers, and so on to allow for a simpler developer experience yet deliver performant database integration.

Chapter 2, Distilling the Multiple Database Flavors, discusses how a polyglot persistence strategy naturally materializes with the growth and individual needs of decoupled and independent services. You will explore different ways to store data, market data management systems (e.g., relational, NoSQL, and NewSQL), their respective languages, and, most importantly, the use case scenarios for each of them. Overengineering is the villain in system design, so this chapter will prepare you with the knowledge to keep it far from your persistence layer.

Chapter 3, Exploring Architectural Strategies and Cloud Usage, will get you familiar with and help you recall concepts around the multiple ways to architect solutions. You will learn about the relationship between monoliths, microservices, and event-driven solutions, and how these approaches push the increasing adoption of different cloud service offerings. You will learn how to identify the benefits and disadvantages of using a mix of on-premises and cloud solutions, a mix that results in organizations’ solutions being built on top of hybrid and/or multi-cloud models.

Chapter 4, Getting the Most out of Design Patterns for Data Management in Cloud-Native Applications, dives into the realm of data management in cloud-native applications and explores how to leverage design patterns effectively. With the increasing adoption of cloud technologies, it has become crucial for developers to optimize data management strategies to maximize the benefits of cloud-native architectures.

Chapter 5, Jakarta EE and JPA: State of Affairs, provides a comprehensive overview of persistence within the Jakarta EE and MicroProfile ecosystems. Persistence is a fundamental aspect of enterprise application development, and understanding how it is handled in these frameworks is essential for developers.

Chapter 6, NoSQL in Java Demystified: One API to Rule Them All, talks about how NoSQL databases open the doors to various capabilities in enterprise applications and systems. Nowadays, even more-conservative markets such as finance are starting to consider non-relational database solutions. It’s time to get familiar with NoSQL databases and their types, how to integrate them with Java services, and the use cases where they may be a good fit for data storage.

Chapter 7, The Missing Guide for jOOQ Adoption, discusses object-oriented querying, commonly known as jOOQ, which is a light database-mapping software library in Java that implements the Active Record pattern. Its purpose is to be relational and object-oriented by providing a domain-specific language (DSL) to construct queries from classes automatically generated based on a database schema.

Chapter 8, Ultra-Fast In-Memory Persistence with Eclipse Store, explores Eclipse Store, which delivers ultra-fast in-memory data processing with pure Java. It provides microsecond query time, low-latency data access, gigantic data throughput, and workloads. Thus, it saves lots of CPU power, CO2 emissions, and costs in the data center.

Chapter 9, Persistence Practices: Exploring Polyglot Persistence, delves into the concept of polyglot persistence within the Jakarta Data ecosystem. Polyglot persistence refers to the practice of using multiple data storage technologies within an application to optimize for different data requirements.

Chapter 10, Architecting Distributed Systems: Challenges and Anti-Patterns, explores the intricacies of architecting distributed systems and examines the challenges and anti-patterns that can arise in the process. Distributed systems are becoming increasingly prevalent in modern software architecture, but they come with their own set of complexities.

Chapter 11, Modernization Strategies and Data Integration, explores modernization strategies and data integration techniques to help organizations adapt their existing systems to meet the demands of modern technology landscapes. As technology evolves rapidly, it becomes crucial for businesses to modernize their legacy systems and integrate them seamlessly with new technologies.

Chapter 12, Final Considerations on Persistence in Modern Java Solutions, is the final chapter, and we provide important considerations and insights regarding persistence in modern Java solutions. As the landscape of Java development evolves, it is crucial to stay up to date with best practices and emerging trends in persistence.