Every software engineer should learn about the Actor Model, even if they don't work with Erlang, Elixir or Akka. It opens up your mind to a new way of thinking about computation and concurrency. And what better way to learn than to hear from its inventor, Carl Hewitt (R.I.P)? This conversation between Carl, Erik Meijer (of the Rx fame) and Clemens Szyperski is a must-see! An actor is the fundamental unit of computation which embodies the 3 things – processing, storage and communications – that are essential to computation. Actors come in systems, and they have addresses so that one actor can send messages to another actor. Every actor has a mailbox, and when an actor receives a message, it can:
Multiple messages might arrive in the mailbox at the same time, but they are processed one at a time. An arbiter decides the order in which these messages are processed. So, inside the body of an actor, there is no concurrency because messages are processed one at a time. The best way to experience the Actor Model is to spend time with Erlang, Elixir or Akka. F#'s MailboxProcessor also implements a similar idea. Looking beyond code, you can also see the same pattern in AWS Lambda! Where a Lambda execution environment handles only one event at a time, and concurrency is managed at the platform level. |
Join 13K readers and level up you AWS game with just 5 mins a week. Every Monday, I share practical tips, tutorials and best practices for building serverless architectures on AWS.
2024 was the year I got back and amongst the community, and it felt great to be back! Blog I published 33 new blog posts. As a whole, my blog garnered 353k views from 255k visitors. About half of them came through Google search. This is down from 2023... but the decline is offset by more people reading my content through my newsletter nowadays. Most read blog posts: Hit the 6MB Lambda payload limit? Here’s what you can do When to use Step Functions vs. doing it all in a Lambda function How to...
One of my favourite questions from the November cohort of Production-Ready Serverless [1] is, "How do you handle e2e tests involving multiple services across bounded contexts?" In a microservices environment, testing user journeys that span across multiple bounded contexts requires collaboration and a clear delineation of responsibilities. Depending on how your organisation is structured, different teams are responsible for testing parts or the entirety of the user journey. For example... The...
The ability to invalidate a user's session with immediate effect is a common enterprise requirement. For example: If a user's credentials are compromised, we need to immediately revoke the user's access and force the user to change credentials. If an employee is terminated or an external contractor's access is revoked, their session should be invalidated immediately to prevent misuse. Many regulations mandate strict access controls and the ability to prevent unauthorized access in real time....