Software Architecture with Spring 5.0

Book description

Discover how different software architectural models can help you solve problems, and learn best practices for the software development cycle

Key Features

  • Learn concepts related to software architecture and embrace them using the latest features of Spring 5
  • Discover architectural models and learn when to apply them
  • Gain knowledge of architectural principles and how they can be used to provide accountability and rationale for architectural decisions

Book Description

Spring 5 and its ecosystem can be used to build robust architectures effectively. Software architecture is the underlying piece that helps us accomplish our business goals whilst supporting the features that a product demands. This book explains in detail how to choose the right architecture and apply best practices during your software development cycle to avoid technical debt and support every business requirement. Choosing the right architecture model to support your business requirements is one of the key decisions you need to take when a new product is being created from scratch or is being refactored to support new business demands. This book gives you insights into the most common architectural models and guides you when and where they can be used. During this journey, you'll see cutting-edge technologies surrounding the Spring products, and understand how to use agile techniques such as DevOps and continuous delivery to take your software to production effectively. By the end of this book, you'll not only know the ins and outs of Spring, but also be able to make critical design decisions that surpass your clients' expectations.

What you will learn

  • Understand the key principles of software architecture
  • Uncover the most common architectural models available
  • Analyze scenarios where an architecture model should be used
  • Implement agile techniques to take your software to production
  • Secure the products you are working on
  • Master tricks that will help you build high-performant applications
  • Use cutting-edge technologies to build products

Who this book is for

If you're an experienced Spring developer aspiring to become an architect of enterprise-grade applications, this book is for you. It's also ideal for software architects who want to leverage Spring to create effective application blueprints.

Table of contents

  1. Title Page
  2. Copyright and Credits
    1. Software Architecture with Spring 5.0
  3. Packt Upsell
    1. Why subscribe?
    2. PacktPub.com
  4. Contributors
    1. About the authors
    2. About the reviewer
    3. Packt is searching for authors like you
  5. Preface
    1. Who this book is for
    2. What this book covers
    3. To get the most out of this book
      1. Download the example code files
      2. Download the color images
      3. Conventions used
    4. Get in touch
      1. Reviews
  6. Software Architecture Today
    1. Defining software architecture
      1. I know my land
      2. I want to stay ahead
      3. Predicting the future
    2. Architecture and architects
    3. Software architecture principles
      1. Components
      2. Low coupling
      3. High cohesion
    4. SOLID principles
      1. The single responsibility principle (SRP)
      2. The Open–Closed Principle (OCP)
      3. The Liskov substitution principle 
      4. The interface segregation principle (ISP)
      5. The dependency inversion (DI) principle
    5. Conway's law
    6. Choosing the right technology for you
    7. New trends 
    8. Summary
  7. Software Architecture Dimensions
    1. Dimensions
      1. The business dimension
        1. Managing user requirements
        2. Identifying and tracking business metrics
      2. The data dimension
      3. The technical dimension
      4. The operations dimension
        1. How to deploy an application
        2. How interaction occurs among your components
        3. Dealing with infrastructure
          1. Understanding the infrastructure
          2. Versioning
          3. Testing
        4. Cloud versus on-premise
        5. Deploying your application
    2. The C4 model
      1. Context diagram
      2. Container diagram
      3. Components diagram
      4. Class diagram
    3. Summary
  8. Spring Projects
    1. Why Spring appeared
    2. Spring projects
      1. Spring Initializr
      2. Spring Boot in a Nutshell
        1. Servlet container integration
        2. Autoconfiguration
        3. Dependency management
          1. mvnw and mvnw.cmd
          2. pom.xml
          3. DemoApplication.java
          4. The application.properties file
          5. DemoApplicationTests.java
      3. Avoiding redeployment with developer tools
      4. Spring Data
      5. Supporting EIPs with Spring Integration
      6. Spring Batch
        1. The read step
        2. The process step
        3. The write step
      7. Securing applications with Spring Security
      8. Embracing (Spring) HATEOAS
      9. Spring Cloud and the microservices world
        1. Configuration server
        2. Service registry
        3. Edge services
          1. Microproxy
          2. API gateway
          3. Circuit breaker
      10. Reactive and Spring
        1. Publisher
        2. Subscriber
        3. Subscription
        4. Processor
      11. Project reactor
        1. Mono
        2. Flux
        3. Back pressure
      12. Reactive Spring Data
      13. Reactive REST services
    3. Summary
  9. Client-Server Architectures
    1. Understanding client-server architectures
      1. Server
        1. Scaling 
      2. Request
      3. Client
      4. Network
    2. Where to apply client-server architectures
    3. Implementing client-server architectures with Spring
      1. The server
        1. SOAP web services
        2. RESTful web services
        3. CORBA
        4. Sockets
        5. AMQP
      2. Implementing the server
        1. Banking-domain
        2. Banking-api
          1. Boundaries
          2. Domain
          3. Persistence
          4. Service
        3. Monitoring the server
        4. Testing
        5. Banking-client
          1. Authentication endpoint client
          2. Account balance endpoint client
      3. The clients
        1. JavaFX client
        2. Android client
        3. Thin client
    4. Summary
  10. Model-View-Controller Architectures
    1. MVC
      1. The Model (M)
      2. The View (V)
      3. The Controller (C)
      4. Benefits of using MVC 
      5. Common pitfalls
    2. Implementing applications using MVC
      1. Spring MVC
      2. Testing
        1. Test coverage
      3. UI frameworks
        1. Thymeleaf
      4. Securing an MVC application
        1. Basic authentication
        2. Implementing basic authentication
    3. Summary
  11. Event-Driven Architectures
    1. Underlying concepts and key aspects
      1. Command
      2. Event
    2. Patterns of event-driven architectures
      1. Event notification
      2. Event-carried state transfer
        1. Improving application performance
        2. Reducing the load on the source application
        3. Increasing the availability of the system
      3. Event sourcing
      4. CQRS
        1. Complex domain models
        2. Distinct paths to query and persist information
        3. Independent scaling
    3. Summary
  12. Pipe-and-Filter Architectures
    1. Introducing Pipe-and-Filter concepts
      1. Filters
      2. Pipes
    2. Boarding Pipe-and-Filter architectures
    3. Use cases for Pipe-and-Filter architecture
    4. Spring Batch
    5. Implementing pipes with Spring Batch
    6. Summary
  13. Microservices
    1. Principles of microservices
      1. Size
      2. Autonomous
      3. Working well together
      4. Advantages
        1. Alignment to the single responsibility principle
        2. Continuous releases
        3. Independent scalability
        4. Increased adoption of new technologies
      5. Drawbacks
        1. Too many options
        2. Slow at the beginning
        3. Monitoring
        4. Transactions and eventual consistency
    2. Modeling microservices
    3. Speeding up
      1. Accelerating the development process
      2. Embracing tests
      3. Going to production
    4. Implementing microservices
      1. Dynamic configuration
        1. Implementing a configuration server
        2. Implementing a configuration client
      2. Service discovery and registration
        1. Introducing Eureka
        2. Implementing a Netflix Eureka service registry
        3. Implementing a service registry client
        4. Netflix Ribbon
      3. Edge services
        1. Introducing Zuul
      4. CAP theorem
        1. Consistency
        2. High availability
        3. Partition tolerance
      5. Circuit breaker
        1. Hystrix
    5. Summary
  14. Serverless Architectures
    1. An introduction to serverless architecture
      1. Infrastructure and file storage
      2. Benefits and pitfalls
      3. Backend as a service
      4. Function as a service
      5. Concerns about serverless architectures
        1. Vendor lock-in
        2. Security
        3. Framework support
        4. Troubleshooting
      6. Examples and common use cases
        1. Adopting serverless architectures for SPA 
    2. Implementing FaaS with Spring Cloud Functions
      1. Functions with Spring
        1. Coding the example
      2. Adapters
      3. AWS Lambda adapter
      4. Azure adapter
    3. Summary
  15. Containerizing Your Applications
    1. Containers
      1. Basic concepts
        1. Containers and images
      2. Basic commands
        1. Running containers
        2. Working with containers
        3. Working with images
      3. Building your own images
        1. FROM command
        2. MAINTAINER command
        3. RUN command
        4. ENV command
        5. EXPOSE command
        6. CMD command
    2. Containerizing applications
      1. Docker Gradle plugin
    3. Registries
      1. Publishing images
    4. Provisioning multiple-container environments
      1. Docker Compose
        1. Linking containers
          1. links
          2. depends_on
    5. Container orchestration with Kubernetes
      1. Pod
      2. Labels
      3. Replication controllers
      4. Services
    6. Summary
  16. DevOps and Release Management
    1. Silos
      1. How to break silos
    2. DevOps culture
      1. Motivations
      2. DevOps adoption
    3. Embracing automation
    4. Infrastructure as code
      1. Spring application and DevOps practices
        1. Supporting different environments
        2. Selecting profiles
      2. Vagrant
        1. Working with Vagrant
    5. Release management
      1. pipelines
        1. Continuous integration
        2. Continuous delivery and continuous deployment
        3. Automating pipelines
        4. Jenkins
    6. Summary
  17. Monitoring
    1. Monitoring
      1. Monitoring Spring applications
    2. Application Performance Management (APM) tools
      1. New Relic
    3. Summary
  18. Security
    1. Why security is important as a part of an application's architecture
      1. Key security recommendations
        1. Authentication and authorization
        2. Cryptography
        3. Data input validation
        4. Sensitive data
        5. Social engineering
        6. OWASP Top 10
        7. Penetration testing
    2. Authentication and authorization as a service
    3. Summary
  19. High Performance
    1. Why performance matters
      1. Scalability
        1. Horizontal scalability
        2. Vertical scalability
      2. High availability
      3. Performance
    2. The key recommendation to avoid performance issues
      1. Identifying bottlenecks
      2. Profiling applications 
        1. Visual VM
      3. SQL query optimizations
      4. A load test example
    3. Summary
  20. Other Books You May Enjoy
    1. Leave a review - let other readers know what you think

Product information

  • Title: Software Architecture with Spring 5.0
  • Author(s): Rene Enriquez, Alberto Salazar
  • Release date: August 2018
  • Publisher(s): Packt Publishing
  • ISBN: 9781788992992