Foreword

If you want to know Ratpack, you have come to the right place. This book is the best and most comprehensive learning resource out there, and Dan is an integral part of the team and community behind Ratpack. I am thrilled that this book is now available.

There are many tools for writing web applications on the JVM, of which Ratpack is one. I set out to make Ratpack excel at scaling in all relevant ways. While performance and efficiency are crucial, the ability to start simple for greenfield tasks yet scale toward solving more challenging problems is equally important. You should feel as empowered by your tools after two years as you did after two days. This is Ratpack’s mission, which Dan eloquently conveys.

We are now building, testing, and deploying web infrastructure differently than we were just a few years ago. Developers and users are, rightfully, more demanding than ever. Applications must integrate with and exist within an ever-shifting landscape of tools, practices, and platforms. Ratpack takes this to heart in several ways: it is a pure runtime in that it does not impose a proprietary mechanism for build automation, nor does it require proprietary plugins for IDE integration; it treats deep testability as a first-class concern; and it favors integration over abstraction, allowing more direct use of complementary technologies such as persistence, marshalling, and templating. This is a conscious trade-off of out-of-the-box magic for long term flexibility and control. Developer freedom is a key tenet of Ratpack. Admittedly, this may not be the most pressing concern for new (and simple, which all new projects inherently are) projects, but it’s important when things get real later in an application’s life. And of course, there is performance.

The term performance can mean many things when it comes to web applications, and the most relevant meanings for the term are also shifting over time. We are now asking backend web applications to deal with more HTTP connections than ever, and to do it faster than ever. Moreover, as we deploy more and more of our applications to platforms where you pay for what you use, making efficient and predictable use of computing resources is becoming a primary concern for more teams. Ratpack uses event-driven I/O and asynchronous programming for this reason. More efficient and predictable use of computing resources means lower costs and reduced risk of emergency rearchitecting due to scaling limits.

Asynchronous programming brings its own set of challenges—a key feature of Ratpack is the way in which it makes asynchronous programming more palatable. For many new to the paradigm, this is an area where guidance when getting started is particularly useful. This book does a great job in demystifying the what and the why of this, which is reason alone to read it.

As the creator of Ratpack, I want other developers to enjoy the same level of satisfaction I do when using it. More specifically, I want other developers to feel empowered but not constrained by it. This requires an understanding of what Ratpack can do for you, why and how it works, and what it leaves up to you.

Get Learning Ratpack now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.