32,39 €
Keep up with the fast-paced tech landscape with Software Architecture with Spring, your practical guide to making strategic architectural decisions that align seamlessly with your business objectives.
Drawing from Wanderson's decades of experience, you'll journey through the complete software development lifecycle—from initial requirements gathering, through development and testing, to production deployment. You'll get hands-on with the evolution of an auction system, exploring its transformation through multiple architectural styles. You’ll discover how you can effectively transform a monolithic system into microservices using proven patterns and practices.
As you progress, you’ll master advanced architectural paradigms such as Event-Driven Architecture, Filter-and-Pipeline Architecture, and Serverless Architecture.
Das E-Book können Sie in Legimi-Apps oder einer beliebigen App lesen, die das folgende Format unterstützen:
Seitenzahl: 596
Veröffentlichungsjahr: 2025
Software Architecture with Spring
Design scalable and high-performance Java applications with Spring
Wanderson Xesquevixos
Copyright © 2025 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
The author acknowledges the use of cutting-edge AI, such as ChatGPT, with the sole aim of enhancing the language and clarity within the book, thereby ensuring a smooth reading experience for readers. It’s important to note that the content itself has been crafted by the author and edited by a professional publishing team.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author nor Packt Publishing or its dealers and distributors, will be held liable for any damages caused or alleged to have been caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
Portfolio Director: Ashwin Nair
Relationship Lead: Aaron Lazar
Project Manager: Ruvika Rao
Content Engineer: Kinnari Chohan
Technical Editor: Sweety Pagaria
Copy Editor: Safis Editing
Proofreader: Kinnari Chohan
Indexer: Tejal Soni
Production Designer: Shankar Kalbhor
Growth Lead: Anamika Singh
First published: June 2025
Production reference: 2170625
Published by Packt Publishing Ltd.
Grosvenor House
11 St Paul’s Square
Birmingham
B3 1RB, UK.
ISBN 978-1-83588-060-9
www.packtpub.com
To my wife, Caroline Xesquevixos, for being my loving partner throughout our joint life journey; this book would not have been possible without you. To my mother, Maria Xesquevixos (in memory), and my father, Aroldo Siqueira, for their sacrifices and examples of determination and kindness; you are my examples. To my son, Alexander, and my daughter, Stephany, you are my reason for moving forward and setting an example.
- Wanderson Xesquevixos
Wanderson Xesquevixos is a seasoned software engineer and architect with over twenty-five years of experience. He has dedicated his career to developing and designing complex systems for many global companies in the banking, telecom, tourism, retail, and e-commerce industries. He earned his computer science degree from UNIVAP in 2005. He holds an MBA in data science and analytics and is pursuing another MBA in software engineering from the prestigious Universidade de São Paulo (USP). He holds certifications as a Java Programmer, Web Component Developer, JEE Business Component Developer, and AWS Certified Solutions Architect. Originally from Jacareí, SP, Wanderson resides in São Francisco do Sul, SC, with his wife Caroline and son Alexander.
This book was made possible by the invaluable support of many. My deepest thanks to my family for their love and encouragement and my colleagues for their insights and collaboration; you don’t know how much I’ve learned from you. To the readers, I hope this work inspires you. Special thanks to the Packt team for their professionalism in bringing this book to life. You are superb!
Madhavi Yeduguri Sandinti, MBA, MS, is a seasoned systems lead developer, senior IT technical lead, and technical architect with over 20 years of expertise in Java application design, web development, and IT management. Skilled in Agile methodologies, she excels in gathering requirements, software analysis, UI development, and cross-functional team leadership. Madhavi is adept at migrations, implementations, testing, and deployment while optimizing performance for continuous improvement. Known for thriving in fast-paced, high-pressure environments, she combines technical acumen with strong organizational and interpersonal skills.
Maciej Walkowiak is an independent Java consultant specializing in the Spring Boot ecosystem and AWS. He helps companies design and build complex, business-critical systems with a focus on quality, maintainability, and clear architecture. He advocates for Domain-Driven Design, values clean and easy-to-understand code, and promotes pragmatic, reliable testing strategies. Maciej is the project lead of Spring Cloud AWS, a conference speaker, and an active open source contributor. He also shares practical knowledge with the developer community through his blog and YouTube channel aimed at helping developers build reliable, production-grade Java applications.
Enderson Siqueira has nearly two decades of experience in IT, with a strong background in the banking industry and payment solutions. He holds a postgraduate degree in Information Architecture from Faculdade Impacta in São Paulo. For the last eight years, Enderson has focused on developing microservices with Java, applying Agile methodologies, and working with cloud platforms such as AWS and Azure. His expertise includes SQL, NoSQL databases, and implementing observability in distributed systems, always aiming for robust, scalable, and reliable solutions.
Software architecture is the cornerstone of software systems, shaping their scalability, performance, and maintainability. As software demands evolve, so does the need for flexible, efficient, and secure architectures. Spring Framework 6, with its comprehensive ecosystem and advanced features, serves as an excellent foundation for building scalable and resilient applications.
This book embarks on a journey through software architecture, starting with the fundamentals, introducing decision-making processes in software architecture, and exploring the importance of understanding the system context.
Using an online auction application as a case study, we evolve it through various architectural styles to reflect real-world software needs, addressing both functional and non-functional requirements. This approach ensures each concept is explained theoretically and brought to life through practical examples. You’ll witness the application’s transformation from a monolithic structure to distributed microservices and beyond, showcasing the progression of architectural decisions in modern software projects.
The book also delves into vital areas such as security, observability, testing, performance optimization, microservices orchestration, and CI/CD pipelines, providing a comprehensive toolkit for building enterprise-ready applications.
This book is perfect for experienced Java software engineers aiming to become software architects or current architects looking to deepen their knowledge of software architecture styles using Spring 6.0.
Chapter 1, Diving into Software Architecture, explores the fundamentals of software architecture, distinguishing it from design. It introduces architectural principles, styles such as monolithic and microservices, and the CAP theorem, offering guidance on aligning technical requirements with business goals and choosing databases to support different architectural needs.
Chapter 2, Decision-Making Processes in Software Architecture, highlights the importance of architectural decisions. It covers key choices, trade-offs, and systematic methods such as ATAM. The chapter emphasizes aligning decisions with business goals, documenting them with ADRs, and using case studies to demonstrate the impact of thoughtful, collaborative decision-making.
Chapter 3, Understanding the System Context, explores the distinction between system context and architecture, emphasizing their integration into design. It covers stakeholder engagement, functional and non-functional requirements, and agile methodologies for dynamic management. It also introduces the C4 model for clear, hierarchical documentation, enhancing communication, and architectural visualization.
Chapter 4, Monolithic Architecture, explores monolithic architecture, detailing its definition, pros and cons, and patterns such as N-Layer and MVC. It explains stateful and stateless operations and demonstrates implementing a monolithic application with Spring Boot, Spring Web MVC, Thymeleaf, and Spring Security, using an online auction system as a case study. It also emphasizes automated testing.
Chapter 5, Client-Server Architecture, explores client-server architecture and its components. It covers RESTful API design and token-based authentication using JWT. A case study transitions the monolithic auction application to a client-server architecture, demonstrating API documentation using OpenAPI, security, and testing practices such as code coverage testing with JaCoCo.
Chapter 6, Microservices Architecture, highlights microservices’ autonomy and specialization, along with their benefits and challenges. It focuses on transitioning the online auction application to microservices. It explores domain-driven design (DDD), CAP theorem-driven database strategies, clean architecture, monitoring with Spring Boot Actuator, and containerizing microservices using Docker and Docker Compose.
Chapter 7, Microservices Patterns with Spring Cloud, explores patterns such as service discovery, load balancing, centralized configuration, gateways, and resilience with Spring Cloud tools.
Chapter 8, Event-Driven Architecture, examines event-driven systems and their asynchronous nature. It covers essential components, event types, and patterns. The chapter concludes with an implementation using Apache Kafka for message handling in an online auction application.
Chapter 9, Pipe-and-Filter and Serverless Architecture, examines modular workflows with pipe-and-filter patterns and implements them using Spring Batch. It also explores serverless architecture with FaaS solutions, using Spring Cloud Functions to run and deploy the application locally and in AWS Lambda.
Chapter 10, Security, emphasizes integrating security from the start, covering encryption, authentication, authorization, and safeguarding data at rest and in transit. It addresses threats such as DoS, input injection, CSRF, and XSS alongside defense mechanisms. It introduces frameworks such as Zero Trust Architecture, threat modeling, and OWASP and provides an in-depth discussion of OAuth2 and OpenID Connect with practical steps for implementing authentication and authorization.
Chapter 11, Observability, introduces logs, metrics, and traces for system reliability and explores and presents tools such as APM, ELK, OpenTelemetry, and Zipkin for distributed tracing, centralized logging, and metric collection in modern architectures.
Chapter 12, Testing, emphasizes quality assurance, showcasing how automated testing ensures faster, more reliable releases. It explores the testing pyramid, covering unit, integration, and UI tests, and tools such as Testcontainers for stable, dependency-free tests. The chapter also highlights performance testing and delves into TDD and BDD, demonstrating their role in improving code quality and aligning tests with business requirements.
Chapter 13, Performance and Optimizations, discusses enhancing application efficiency and scalability through JVM architecture and Garbage Collector tuning. It offers strategies for heap size configuration to reduce latency and improve throughput and caching techniques to boost performance and reduce server load. The chapter also introduces reactive programming with Spring WebFlux.
Chapter 14, Orchestration with Kubernetes, introduces Kubernetes for containerized application management. It covers cluster components, deployment manifests, and practical guidance for deploying services in a scalable, self-healing environment.
Chapter 15, Continuous Integration and Continuous Deployment, explores the concepts of CI/CD and guides the construction of Jenkins pipelines for automated integration, testing, and deployment. Practical steps include Docker containerization, GitHub integration, and application deployment to a Kubernetes environment using Minikube.
To get the most out of this book, you should be familiar with Git and Maven, have basic knowledge of databases, Docker, and Docker Compose, be proficient in Java development with an object-oriented programming background, and have a solid understanding of the Spring Framework.
Software/hardware covered in the book
Operating system requirements
Java 21
Windows, macOS, or Linux
Maven 3.9.9
Windows, macOS, or Linux
Docker 27.4.0
Windows, macOS, or Linux
Docker Compose 2.32.2
Windows, macOS, or Linux
Git 2.39.5
Windows, macOS, or Linux
If you are using the digital version of this book, we advise you to type the code yourself or access the code from the book’s GitHub repository (a link is available in the next section). Doing so will help you avoid any potential errors related to the copying and pasting of code.
You can download the example code files for this book from GitHub at https://github.com/PacktPublishing/Software-Architecture-with-Spring. If there’s an update to the code, it will be updated in the GitHub repository.
There are a number of text conventions used throughout this book.
Code in text: Indicates code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles. Here is an example: “Mount the downloaded WebStorm-10*.dmg disk image file as another disk in your system.”
A block of code is set as follows:
public interface Payment { void processPayment(double amount); }When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:
public Book implements ValidateIsbn, Publication{ void displayInfo(){ ... } void validateIsbn(String isbn){ ... } } Voicemail(s0)Any command-line input or output is written as follows:
keytool -genkeypair -alias myappkey -keyalg RSA -keysize 2048 -keystore mykeystore.jks -validity 365Bold: Indicates a new term, an important word, or words that you see onscreen. For instance, words in menus or dialog boxes appear in bold. Here is an example: “Select System info from the Administration panel.”
Tips or important notes
Appear like this.
Feedback from our readers is always welcome.
General feedback: If you have questions about any aspect of this book, email us at [email protected] and mention the book title in the subject of your message.
Errata: Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you have found a mistake in this book, we would be grateful if you would report this to us. Please visit www.packtpub.com/support/errata and fill in the form.
Piracy: If you come across any illegal copies of our works in any form on the internet, we would be grateful if you would provide us with the location address or website name. Please contact us at [email protected] with a link to the material.
If you are interested in becoming an author: If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, please visit authors.packtpub.com.
Once you’ve read Software Architecture with Spring, we’d love to hear your thoughts! Please click here to go straight to the Amazon review page for this book and share your feedback.
Your review is important to us and the tech community and will help us make sure we’re delivering excellent quality content.
Thanks for purchasing this book!
Do you like to read on the go but are unable to carry your print books everywhere?
Is your eBook purchase not compatible with the device of your choice?
Don’t worry, now with every Packt book you get a DRM-free PDF version of that book at no cost.
Read anywhere, any place, on any device. Search, copy, and paste code from your favorite technical books directly into your application.
The perks don’t stop there, you can get exclusive access to discounts, newsletters, and great free content in your inbox daily
Follow these simple steps to get the benefits:
Scan the QR code or visit the link belowhttps://packt.link/free-ebook/9781835880609
Submit your proof of purchaseThat’s it! We’ll send your free PDF and other benefits to your email directlyIn this part, you will create a solid foundation in software architecture by exploring its core principles and the critical elements that guide successful system design. You will explore the fundamental concepts of software architecture, gain insights into effective decision-making processes, and understand how to evaluate the system context to align architecture with business and technical requirements. These chapters provide the groundwork for understanding, designing, and implementing robust and scalable software systems.
This part has the following chapters:
Chapter 1, Diving into Software ArchitectureChapter 2, Decision-Making Processes in Software ArchitectureChapter 3, Understanding the System Context