Modern day web applications are increasingly under pressure to provide a richer user experience.
Usually those applications start with the ability to support hundreds of concurrent users with few thousands concurrent requests or calls per day, however that could increase to millions if the venture proved to be successful. In such a case, the architecture must be capable of supporting this kind of growth, otherwise, it’s destined to fail. The Modern web app architecture must be flexible, has the ability to quickly adapt to requirements’ changes and able to support the crucial fast-time-to-market and fast-time-to-value requirements. The modern application architecture must be responsive resilient, elastic and cost-efficient and has the ability to efficiently run in a Cloud-Native environment. Can Java still support this kind of architecture?
The Akka toolkit and the Actor model to the rescue
Java is very much alive in terms of scalability and the ecosystem, however, the issue is developer productivity. Developers are looking to avoid writing boilerplate code or managing unnecessary plumbing code that solves deep technical problems such as self-healing, failure recovery, concurrency and thread synchronization. Akka and the Actor model are solving this kind of problem and easing the developer productivity concerns.
The Actor Model
Have you ever been in a situation where you have to deliver an application or a solution in a very short time? Or over committed to the business stakeholders and you found out that; the amount of work is a lot more than you expected? You have to “REACT” gracefully and deliver. Luckily, you have a lot of friends on your team who can help you and they would “Act” on your behalf, who are called “Actors”, they’re waiting for your tasks or jobs to come and you can delegate your tasks to those actors without worrying about multi-tasking confusion or synchronization bottlenecks, they know what to do, and they can communicate using messaging, they won’t waste your time or your cycles asking silly questions, they’re resilient too, they can sustain failure, and they know how to cooperate to recover -self-healing-, they’re independent individuals with no strings or threads attached. Putting the humor aside, this is how the modern web application architecture operates.
This is how the Actor Model works, the actor model is at the core of modern application architecture and Reactive Architecture.
Akka is the magical toolkit that implements the Actor model on the JVM, that supports both Java and Scala.
You can easily use the toolkit to build highly concurrent, distributed, and resilient message-driven applications in the cloud, utilizing Microservices Architecture and built on top of Reactive Architecture and Cloud-Native Architecture.
Modern Application Architecture and the Reactive Paradigm
Reactive Architecture is not new, it was just forgotten for some time, recently, it resurfaced or resurrected to support the modern application’s requirements.
The Reactive paradigm is supporting the following computing qualities, I’m going to use the “Triple R” notation to make it easier to memorize:
- Reactive (scalable)/Elastic
Has the ability to seamlessly handle an increasing or growing number of requests without negatively impacting the user experience, it’s even better if it supports on-demand computing by scaling up or down the consumption of resources based on the current system demand (Elasticity).
The increasing concurrency and load will not negatively impact the response time.
The ability to recover from unexpected failure without impacting the user experience or causing a complete system downtime or full system recovery, supporting self-healing and embracing failure.
The Reactive model is achieving the above by adopting the message-driven architecture, the Actor model, Cloud-Native, Edge-Computing and many more design patterns, for a complete summary, please refer to our blog here.
Functional Programming and the Reactive Paradigm
While Functional programming is sharing a lot with the Reactive paradigm, however, that doesn’t mean you can only do this in Haskell or just pure functional language.
Reactive Programming in Java
Lightbend have already developed the needed technology stack to build reactive systems in Java & Scala; they created several capabilities in that space to support the Reactive paradigm, now we have the Play Framework and the Akka toolkit to build enterprise solutions and Cloud-Native stateful applications using Reactive Microservices Architecture.
If you need more guidance in that space and looking for the best of breed solution architecture, please reach out to us at Logic Keepers, we provide coaching and workshops dedicated to serve that space.
The LK workshop covers both conceptual and hands-on aspects, a pragmatic approach to teach solutions architects and developers how to quickly design and build Cloud-Native, Microservices based solutions in the Cloud.
Logic Keepers is a Lightbend Consulting Partner