The advantages of right-sized services

The Akka Serverless architecture encourages design of a series of small services that don’t share code and can be deployed independently. This offers these benefits to your serverless functions:

  • They are faster and less complex to write and debug because they focus on a small set of operations, usually around a single data Entity.

  • They simplify operational concerns and provide scalability because they can be deployed, stopped and started independently of the rest of the system, further simplifying operational concerns.

  • They handle variations in load gracefully. If properly designed, multiple instances of the service can be started up when necessary to support more load: For example, if your system runs on Black Friday and the shopping cart service gets super busy, you can spin up more shopping carts to handle that load without also having to start up more copies of the catalog service. When the load decreases, these extra instances can be removed again, minimizing resource usage.

  • They are message driven, interacting asynchronously with the rest of the world through messages and commands), and for Event Sourced Entities, (events--all of which decouple a system’s components. If one instance, or even a whole service, fails, it is possible for the rest of the system to keep going with reduced capabilities, rather than creating a cascading failure that takes down the entire system.

  • A team can focus on features of a single service at a time, without worrying about what other services or teams are doing, or when they are releasing, allowing more parallel teams to focus on other services, allowing your development efforts to scale as needed.

  • You can upgrade services in a "rolling" fashion, where new instances are started before older instances are removed, allowing new versions to be deployed with no downtime or interruption.