Stratospheric eBook Cover

Stratospheric

From Zero to Production with Spring Boot and AWS

All you need to know to get a Spring Boot application into production with AWS.

Key facts

What's covered?

Develop a production-ready Spring Boot application and deploy it to AWS while integrating several AWS services.

Infrastructure as Code Logo

Infrastructure as code

Learn how to use the AWS CDK (Cloud Development Kit) to define the entire infrastructure with Java code

AWS Logo

Integrate AWS services

Get familiar with powerful AWS services by implementing features for the sample application

Deployment Logo

Deployment

Automate the CI/CD pipeline to get changes deployed to production in a matter of minutes using GitHub Actions

Operations Logo

Operations

Effectively monitor and operate a Spring Boot application in production

Background Section

Content

What's in the Book?

Have a sneak peek at the table of contents.

Part I: Deploying with AWS

Deploying a "Hello World" version of the Todo app to get familiar with AWS.

Overview and short explanation of the different AWS services that we're going to integrate and use.

Securing the access to both our AWS account and AWS resources with the AWS Identity and Access Management (IAM).

An anecdote about manual deployments to emphasise the need for automation and infrastructure as code.

Getting familiar with the AWS Cloud Development Kit (CDK) to define infrastructure with Java code instead of YAML (CloudFormation).

Design considerations for the CI/CD pipeline for the Todo application and its infrastructure resources.

Building a continuous deployment pipeline to get code changes into production without friction.

Part II: Spring Boot & AWS

Exploring the features we're going to build and creating a first application skeleton.

Creating a convenient local application setup for development.

Implementing a registration and login functionality using Open ID Connect 1.0 and AWS Cognito.

Provisioning a relational database with Amazon RDS to store to persist our user's todos.

Implementing a todo sharing functionality with email invitations.

Real-time feedback for our users whenever a sharing request was accepted.

Understanding the journey of our users by storing events inside Amazon DynamoDB.

Part III: Operations with AWS

Enable structured searching and filtering of logs by adjusting the way we send logs to Amazon CloudWatch.

Continuously monitor the operation of our application by emitting metrics from our Spring Boot application to AWS.

Creating alarms on top of our custom metrics to get notified on failures and outages.

Reducing the likelihood of bad deployments and detecting outages earlier by continuously verifying the main user journey.

Providing a custom domain for our application and enforcing HTTPS communication.

Sample application

What we're going to build

Take a look at the final result.

Stratospheric Technical Architecture Sample Application Overview Page Without Login Registration Page using Amazon Cognito Sample Application Overview Page With a Logged-In User Sample Application Todo Dashboard Page Sample Application Todo Creation Page

Testimonials

What readers are saying

Feedback from our readers.

Quote Left

If you are Spring Boot developer and looking to explore how to deploy your applications onto AWS, then you need to check out this book.

The authors have put together a well thought out and easy to follow book that walks you through the typical use cases you will need.

Perfect for beginners and an invaluable reference guide for those more experienced, they continue to add new content to this book and I cannot say enough great things about it.

Ricardo Sueiras
Ricardo Sueiras

Principal Advocate in Open Source - Amazon Web Services (AWS)

Quote Left

This is an excellent book for every Spring Boot developer who wants to level up their knowledge and move their applications to the AWS cloud. I'm still halfway through the book, and it feels like someone is taking me by my hand into the AWS forest of services.

The writers went just deep enough (and not too much) into each service they tackled and included practical exercises to follow along the way. That's giving confidence and instilling the learning naturally.

AbdulRahman elRawas
AbdulRahman elRawas

Software Developer

Quote Left

One of the most-frequent questions I get from developers is how they can get started with AWS without having to first learn and understand all the details of the hundreds of available services.

In their book, Tom, Philip, and Björn do an excellent job, initially focusing on just a few basic services to quickly get you started.

Once your application is up and running, you gradually add additional capabilities, like continuous integration, monitoring, alerting, and automated incident response.

If you are a Java developer wanting to learn how to build and run your applications in the cloud, Stratospheric is exactly what you need.

Dennis Traub
Dennis Traub

Developer Advocate, Amazon Web Services (AWS)

Quote Left

Great book covering many best practices of modern cloud based infrastructure setup, application development and operations using Spring Boot and AWS.

Regardless of whether you're a novice or seasoned developer, I highly recommend this book.

Espen Westgaard
Espen Westgaard

CTO and CISO at Datek AS, Norway

Quote Left

Björn, Philip, and Tom do a great job on teaching how to build a Java application on AWS.

I highly recommend the book to Java developers. The book uses modern AWS services, that are ready for production workloads, and avoids the bleeding edge. The examples show how to bundle your app into a container image and deploy it with ECS and Fargate, which is my preferred architecture.

I highly appreciate, that the book even covers monitoring and creating a deployment pipeline.

Andreas Wittig
Andreas Wittig

AWS Consultant and Co-Author of Amazon Web Service in Action

Quote Left

I thought that learning how to deploy Spring Boot application to the cloud, would require unbearable long time.

But then came this book, and my worries vanished. On less than 500 pages, I found all I was looking for.

From deployment preparation, through application connecting with required AWS services to deployment realization and application monitoring.

And what is the best, all accompanied by useful code examples and access to related GitHub repository.

Branislav Beňo
Branislav Beňo

Software Developer at Siemens

Quote Left

Not just the theory... Delivers on the implementation.

Great book that easily blends the integration of the Spring Boot framework with Amazon’s AWS services, progressing from overview to deliverables.

Excellent logical organization of the fundamental AWS services that a developer can easily learn and retain in a step by step manner.

Gregory Zak
Gregory Zak

Senior Java Developer

Quote Left

The book is great!

I could just leave the comment like this and it should be enough but let me explain a little deeply why this opinion.

I think there is no other such complete material on the Earth, that takes you out of the just Spring Boot Developer to Spring Boot Developer with AWS working knowledge.

I haven't finish the book yet as there are a lot of material but I am sure that after finishing the book I will be a very confident developer with cloud technologies in my portfolio

Mirek Krenc
Mirek Krenc

Software Developer

Quote Left

Excellent book that covers from theoretical aspects to hands-on examples on how to create a production-grade Spring Boot application deployed using AWS.

I consider it a part of my toolkit already :)

Asiel Leal Celdeiro
Asiel Leal Celdeiro

Software Developer

Quote Left

If you want to know how to deploy your Spring Boot Application to the cloud and seek clarity on the available services (AWS), Stratospheric is an excellent resource for you. I found the explanations lucid and succinct with excellent worked examples.

I would highly recommend this book - it's great value and I look forward to the online course also.

Grr Igd
Grr Igd

Software Developer

Quote Left

This is the book that every Java/AWS developer must read.

Almost a masterpiece.

Eliud Rojas
Eliud Rojas

CTO

Background Section

Author

Björn Wilmsmann

Björn Wilmsmann is an independent IT consultant who helps companies transform their business into a digital business.

A longtime software entrepreneur, he’s interested in web apps and SaaS products. He designs and develops business solutions and enterprise applications for his clients.

Apart from helping companies in matters of software quality and improving the availability of and access to information through APIs, Björn provides hands-on training in technologies such as Angular and Spring Boot.

On his blog he writes about technology, software development, and the software business.

Find out more about Björn on bjoernkw.com.

Picture of Björn Wilmsmann
Background Section

Author

Philip Riecks

Under the slogan, Testing Java Applications Made Simple, Philip provides recipes and tips & tricks to accelerate your testing success and make testing joyful (or at least less painful).

Apart from blogging, he's a course instructor for various Java-related online courses and active on YouTube.

He's an independent IT-Consultant from Berlin and working with Java, Kotlin, Spring Boot, and AWS on a daily basis.

Find out more about Philip on rieckpil.de.

Picture of Philip Riecks
Background Section

Author

Tom Hombergs

Tom is a senior software engineer at Atlassian in Sydney, working with AWS and Spring Boot at scale.

He is running the successful software development blog reflectoring.io, regularly writing about Java, Spring, and AWS with the goal of explaining not only the How, but the Why of things.

Tom is author of Get Your Hands Dirty on Clean Architecture, exploring how to implement a hexagonal architecture with Spring Boot.

Find out more about Tom on reflectoring.io.

Picture of Tom Hombergs

Grab your copy

Where to get the book?

Get the book from the following vendors.

Available Options

Bundles

There's more than just the ebook.

Radiant Reader

$39, including:

  • the Stratospheric ebook
  • free lifetime updates for the ebook
  • Stratospheric community membership

Get 30% off by joining our mailing list.

Buy on Leanpub

Lively Learner

$269, including:

Everything part of the Radiant Reader Bundle plus

  • the Stratospheric online course
  • free lifetime updates for the course
  • 35+ hands-on lessons with more than 5 hours of video content
  • test your knowledge with quizzes after each lesson
  • certificate of completion

The ebook and online course are both hosted on Leanpub. After the checkout, you'll receive the ebook and PDF instructions on how to enroll for the online course.

Buy on Leanpub

Mighty Member

$499, including:

Everything part of the Lively Learner Bundle plus

  • Stratospheric AI prompt:
    Ask questions about the ebook.
  • access to private channel with the authors for direct Q&A and support

The ebook and online course are both hosted on Leanpub. After the checkout, you'll receive the ebook and PDF instructions on how to enroll for the online course.

Buy on Leanpub
Background Section

FAQ

Frequently Asked Questions

Your questions answered.

So far, there hasn't been.

This is a great idea, though, which is why decided to create a Slack community for Stratospheric, where you can discuss the book, ask questions, and work through the book together.

If you'd like to join the Slack community, please drop us a note.

Ultimately, because the three of us know Java very well. We wanted to express the deployment workflow in language we were already familiar with.

Furthermore, the book is about Spring Boot. Hence, it's only natural to use the same language and ecosystem, so as the reader you don't have to switch contexts.

Originally, we were going to use CloudFormation and the JSON or YAML configuration files that come with that. However, that approach turned out to be not particularly readable and maintainable.

AWS CDK has gained quite some traction and is starting to get more mature. Apart from Java, CDK is available for TypeScript and Python, too.

Absolutely.

That was the main idea behind the book and the perspective from which we wrote it.

No, it doesn't.

You probably couldn't write a book covering all of those. Instead, we decided to use and write about the most commonly useful services and use cases for generic web applications, such as SQL databases with RDS, key-value stores with DynamoDB, messaging with SQS and ActiveMQ, Cognito for registration and login, and SES for sending emails.

The general integration workflow is similar for other services, though, and the AWS Java SDK makes it convenient to use other services, too.

A lot of what we covered in the book is applicable to EKS / Kubernetes.

Everything except the Service CDK stack is independent of ECS. Besides, Docker can be used with EKS, too.

Yes, we do.

We're going to publish an online course, which will take segments from the book and present those in bite-sized pieces one can easily follow along.

We'll also continue to publish additional relevant content on our blogs (reflectoring.io, rieckpil.de, bjoernkw.com). So make sure to check those out every now and then, too.

Writing the book together worked very well.

As somewhat stereotypical software engineers, we like to mostly work by ourselves but also want to collaborate and regularly exchange ideas and feedback on our work.

We approached writing the book like a software development project:

  • We had two-week sprints.
  • We met every two weeks on Zoom.
  • The process organically evolved into an agile process.
  • We had a review process with pull requests for each finished chapter.

We also split up the other tasks associated with writing and publishing a book (e.g., marketing) among the three of us.

Self-publishing has been a real boon to us. There was no outside pressure but we had the intrinsic motivation to quickly and regularly provide value to our readers.

Probably too many to mention them all :-)

We expanded our own knowledge regarding developing software with and deploying applications on AWS. There are some pitfalls when working with AWS services in general and the CDK specifically, but overall, the self-service and infrastructure-as-code approach those enable are a huge step forward.

Collaboratively writing and self-publishing an eBook has been a tremendous experience, too. We learned a lot about writing, marketing, and polishing over the course of this process.

The AWS infrastructure spun up during the course of the book costs about 100 to 110 euros per month, depending on what you do and how often you deploy or recreate certain resources (e.g., the ActiveMQ WebSocket relay).

This might be a little too much for a pet project but seems alright for a small startup.

Unfortunately, not that we know of.

You can merely create alerts within the AWS Billing Console, which will ping you once a specified threshold has been reached. Those are just notifications, though. There's no simple service or feature that allows you to shut down resources automatically once costs exceed a certain level.

A possible approach to try out, though, might be an event triggering a Lambda function for executing CDK commands, which then destroy the infrastructure.

Where applicable (e.g., with Amazon RDS or Amazon MQ), we used the smallest possible instance types, because for demonstration purposes those were sufficient.

More generally, we set a monthly budget within the AWS Billing Console alongside an alert that notified use once a specific budget threshold had been reached.

We supply environment and application names for the chapter-specific versions of our sample Todo application, for example.

Where applicable and necessary, we use those to define namespaces. This allows to keep multiple versions of the application separate from each other and manage resources belonging to a specific version.

No, we haven't.

However, you can easily implement social logins with Amazon Cognito.

AWS not only is the largest and most widely used cloud provider, it also was the one we were most familiar with from client work and previous projects.

It only seemed natural to write about something we had already been using to some extent at least and for which we knew there was sizeable demand.

With Java being one of the major deployment targets for AWS and Spring/Spring Boot being well-supported through Spring Cloud, Spring Cloud AWS and the AWS Java SDK, ease-of-use and robust, reliable tooling probably are the major benefits of using Spring Boot in conjunction with AWS.

The book has been written entirely in Markua - Leanpub's Markdown flavor.

The book's layout is generated through Leanpub. For our writing process we made use of feature branches and pull requests reviews on GitHub.

When embarking on this project, we quickly arrived at $39 as an appropriate price point for what we envisioned, i.e., a comprehensive, from-start-to-finish guide for developing and deploying a Spring Boot application with AWS and the value such a book can provide to the reader.

With the initial release and the first few chapters in November 2020, we set the price to $20 and gradually increased the price from there with each subsequent release that contained additional content.

This approach - not unlike crowdfunding but with the added benefit of immediate value provided - allowed readers to support as early on, while it motivated us to publish at regular intervals and at a rapid pace to show we deserve that trust.

Yes, they do.

The combined use of AWS and Spring Boot is well-supported through Spring Cloud, Spring Cloud AWS and the AWS Java SDK.

Yes, absolutely.

We'll continue to write the occasional newsletter and also send updates via Leanpub whenever there's a new version of Stratospheric available.

Honestly, we have no idea :-)

This mostly depends on a specific reader's pace. Clocking in at about 450 pages and roughly 80,000 words, "Stratospheric - From Zero to Production with Spring Boot and AWS" isn't exactly a short book. You can certainly read the book from start to finish. We hope we've provided enough of a storyline and common thread for you to do so and follow along.

However, to a large extent, we designed both the three main parts and the chapters themselves to be modular. This allows you to pick out those sections and subjects that are most relevant to you at any given time.

First and foremost, our own work experience and previous client work has served as inspiration for working with this particular set of technologies.

From this previous experience knew there was significant demand but very little in the way of comprehensive guides or tutorials that not only help you with getting started with AWS and Spring Boot but really guide you all the way to a production-ready application and cloud deployment setup.

As outlined in the book's closing thoughts, the immediate next step is to start using cloud development and deployment options at your workplace or with your current - or next - SaaS side project.

Whether you're making decisions at your place of work or you're working in a larger team, we hope that Stratospheric has provided you with a conversation starter and arguments for adopting cloud development.

The table of contents is available both on this website and the Leanpub page for Stratospheric.

No, it isn't.

We probably could've written more tests but test coverage wasn't our primary focus while writing the book and the companion app.

If you'd like to delve more deeply into this subject you might want to take a look at the resources provided on Philip's website under "Testing Java Applications Made Simple".

Working with Leanpub has been a terrific experience.

Both the self-publishing approach in general and the integration with tools such as GitHub lent themselves to our writing process and the way we wanted to manage and publish our content. The idea of self-publishing in particular was what convinced us to use a service such as Leanpub.

The source code depends on AWS Java SDK v1 since we're currently still using Spring Cloud AWS 2.2.x, which in turn transitively depends on AWS Java SDK 1.x.

Yes, it will.

The book describes in detail how to deploy the resources and the relevant infrastructure used with AWS CDK.

Yes, it is.

The chapter about "Tracing User Actions with Amazon DynamoDB" covers DynamoDB in great detail.

For the user interface we used Thymeleaf. Additionally, we used these libraries and frameworks:

As of today (August 8th, 2021), there isn't, unfortunately.

See this GitHub issue for possible future updates. According to the CDK documentation "it is possible to write AWS CDK applications in JVM-hosted languages other than Java". However, AWS doesn't provide any support for that.

Yes, it is.

The chapters on "The Sample Todo Application", "Building User Registration and Login with Cognito", "Sharing Todos with SQS and SES", and "Metrics with Amazon CloudWatch" specifically make us of Spring Cloud AWS.

Email List

Save some $$$

Join the mailing list to get 30% off!