<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Patterns on Manuel Bernhardt</title><link>https://manuel.bernhardt.io/tags/patterns/</link><description>Recent content in Patterns on Manuel Bernhardt</description><generator>Hugo</generator><language>en</language><lastBuildDate>Sat, 18 Feb 2023 20:54:16 +0100</lastBuildDate><atom:link href="https://manuel.bernhardt.io/tags/patterns/index.xml" rel="self" type="application/rss+xml"/><item><title>Tour of Akka Typed: Cluster Singleton and Routers</title><link>https://manuel.bernhardt.io/2019/12/03/tour-of-akka-typed-cluster-singleton-and-routers/</link><pubDate>Tue, 03 Dec 2019 14:59:48 +0100</pubDate><guid>https://manuel.bernhardt.io/2019/12/03/tour-of-akka-typed-cluster-singleton-and-routers/</guid><description>&lt;p>In &lt;a href="https://manuel.bernhardt.io/2019/11/09/tour-of-akka-typed-cluster-sharding/">part 5 of this series&lt;/a>, we started to scale the application from a local one to a clustered one by introducing Cluster Sharding. In this article, we will continue our effort to scale the payment processor out and make it resilient through the use of Cluster Singletons and Cluster-Aware Routers.&lt;/p>
&lt;p>Before we get started, here’s a quick reminder of what we’ve seen so far: in the &lt;a href="https://manuel.bernhardt.io/2019/07/11/tour-of-akka-typed-protocols-and-behaviors/">first part&lt;/a> we had a look at the the raison d’être of Akka Typed and what advantages it has over the classic, untyped API. In the &lt;a href="https://manuel.bernhardt.io/2019/08/07/tour-of-akka-typed-message-adapters-ask-pattern-and-actor-discovery/">second part&lt;/a> we introduced the concepts of message adapters, the ask pattern and actor discovery. In the third part, we covered one of the core concepts of Actor systems: &lt;a href="https://manuel.bernhardt.io/2016/08/09/akka-anti-patterns-flat-actor-hierarchies-or-mixing-business-logic-and-failure-handling/">supervision and failure recovery&lt;/a>. In the fourth part, we covered one of the most popular use-cases for Akka: &lt;a href="https://manuel.bernhardt.io/2019/10/07/tour-of-akka-typed-event-sourcing/">event sourcing&lt;/a>. Finally, as mentioned before, in the &lt;a href="https://manuel.bernhardt.io/2019/11/09/tour-of-akka-typed-cluster-sharding/">fifth part&lt;/a> we started scaling out by making use of cluster sharding.&lt;/p></description></item><item><title>Tour of Akka Typed: Cluster Sharding</title><link>https://manuel.bernhardt.io/2019/11/09/tour-of-akka-typed-cluster-sharding/</link><pubDate>Sat, 09 Nov 2019 20:14:10 +0100</pubDate><guid>https://manuel.bernhardt.io/2019/11/09/tour-of-akka-typed-cluster-sharding/</guid><description>&lt;p>&lt;em>Update 21/11/2019: Fixed comment about &lt;code>shardId&lt;/code> extraction in relation to &lt;code>ShardingEnvelope&lt;/code>&lt;/em>&lt;/p>
&lt;p>Welcome to the fifth part of the Akka Typed series! In this part, we&amp;rsquo;ll leave the safe harbor of a single JVM and sail into the seas of distributed systems by exploring a key features of Akka Cluster with the typed API: Cluster Sharding. If you want to get a more in-depth introduction to Akka Cluster, I invite you to check out &lt;a href="https://manuel.bernhardt.io/2018/08/03/tour-akka-cluster/">the article series on this topic&lt;/a>.&lt;/p></description></item><item><title>Tour of Akka Typed: Event Sourcing</title><link>https://manuel.bernhardt.io/2019/10/07/tour-of-akka-typed-event-sourcing/</link><pubDate>Mon, 07 Oct 2019 13:42:32 +0200</pubDate><guid>https://manuel.bernhardt.io/2019/10/07/tour-of-akka-typed-event-sourcing/</guid><description>&lt;p>Welcome to the fourth part of the Akka Typed series. In the &lt;a href="https://manuel.bernhardt.io/2019/07/11/tour-of-akka-typed-protocols-and-behaviors/">first part&lt;/a> we had a look at the the raison d’être of Akka Typed and what advantages it has over the classic, untyped API. In the &lt;a href="https://manuel.bernhardt.io/2019/08/07/tour-of-akka-typed-message-adapters-ask-pattern-and-actor-discovery/">second part&lt;/a> we introduced the concepts of message adapters, the ask pattern and actor discovery. In the third part, we covered one of the core concepts of Actor systems: &lt;a href="https://manuel.bernhardt.io/2016/08/09/akka-anti-patterns-flat-actor-hierarchies-or-mixing-business-logic-and-failure-handling/">supervision and failure recovery&lt;/a>. In this part of the series we&amp;rsquo;ll explore one of the most popular use-cases for Akka: event sourcing. We&amp;rsquo;ll assume that you are already familiar with the concept of event sourcing - if not, first &lt;a href="https://hackernoon.com/events-as-first-class-citizens-8633e8479493">read about it&lt;/a> to get some context.&lt;/p></description></item><item><title>Tour of Akka Typed: supervision and signals</title><link>https://manuel.bernhardt.io/2019/09/05/tour-of-akka-typed-supervision-and-signals/</link><pubDate>Thu, 05 Sep 2019 10:10:10 +0200</pubDate><guid>https://manuel.bernhardt.io/2019/09/05/tour-of-akka-typed-supervision-and-signals/</guid><description>&lt;p>&lt;em>Update 18.10.2019: fixed wrong syntax for handling multiple exceptions, clarifying a few points&lt;/em>&lt;/p>
&lt;p>Welcome to the third part of the Akka Typed series. In the &lt;a href="https://manuel.bernhardt.io/2019/07/11/tour-of-akka-typed-protocols-and-behaviors/">first part&lt;/a> we had a look at the the raison d&amp;rsquo;être of Akka Typed and what advantages it has over the classic, untyped API. In the &lt;a href="https://manuel.bernhardt.io/2019/08/07/tour-of-akka-typed-message-adapters-ask-pattern-and-actor-discovery/">second part&lt;/a> we introduced the concepts of message adapters, the ask pattern and actor discovery. In this part of the series, we&amp;rsquo;ll have a look at one of the core concepts of actor systems: &lt;a href="https://manuel.bernhardt.io/2016/08/09/akka-anti-patterns-flat-actor-hierarchies-or-mixing-business-logic-and-failure-handling/">supervision and failure recovery&lt;/a>.&lt;/p></description></item><item><title>Tour of Akka Typed: Message Adapters, Ask Pattern and Actor Discovery</title><link>https://manuel.bernhardt.io/2019/08/07/tour-of-akka-typed-message-adapters-ask-pattern-and-actor-discovery/</link><pubDate>Wed, 07 Aug 2019 08:13:01 +0200</pubDate><guid>https://manuel.bernhardt.io/2019/08/07/tour-of-akka-typed-message-adapters-ask-pattern-and-actor-discovery/</guid><description>&lt;p>In the &lt;a href="https://manuel.bernhardt.io/2019/07/11/tour-of-akka-typed-protocols-and-behaviors/">previous article&lt;/a> of this series we&amp;rsquo;ve explored the basics of the Akka Typed API: why it was created and what are its benefits in comparison to the classic Actor API, how to build typed actor systems via protocols and behaviors and how to create typed actors. In this series we&amp;rsquo;re going to go further down the route of building typed actor systems by looking at fundamental concepts necessary for the interaction between actors.&lt;/p></description></item><item><title>Tour of Akka Typed: Protocols and Behaviors</title><link>https://manuel.bernhardt.io/2019/07/11/tour-of-akka-typed-protocols-and-behaviors/</link><pubDate>Thu, 11 Jul 2019 08:05:53 +0200</pubDate><guid>https://manuel.bernhardt.io/2019/07/11/tour-of-akka-typed-protocols-and-behaviors/</guid><description>&lt;p>&lt;em>Update 18.08.2019: corrected actor hierarchy and default supervision strategy&lt;/em>&lt;/p>
&lt;p>&lt;a rel="noreferrer noopener" aria-label="Ukrainian translation (opens in a new tab)" href="https://uk.codegalaxy.io/theory/scala/papers/90eb098342b4434499ae9029a166922a/akka_typed___protocols_and_behaviors" target="_blank">Ukrainian translation&lt;/a> / &lt;a rel="noreferrer noopener" aria-label="Chinese translation (opens in a new tab)" href="https://my.oschina.net/enyo/blog/3133185" target="_blank">Chinese translation&lt;/a>&lt;/p>
&lt;p>In this series we are going to explore &lt;a href="https://doc.akka.io/docs/akka/2.6/typed/index.html">Akka Typed&lt;/a>, the new Akka Actor API that brings significant advantage over the classic one. Akka Typed is &lt;a href="https://akka.io/blog/news/2019/04/10/akka-tyoed-prod-ready">ready for production since April&lt;/a> and although the API is still marked as &lt;a href="https://doc.akka.io/docs/akka/current/common/may-change.html">may change&lt;/a> I think it is a good time to look into it and to learn what&amp;rsquo;s new.&lt;/p></description></item><item><title>Tour of Akka Cluster</title><link>https://manuel.bernhardt.io/2018/08/03/tour-akka-cluster/</link><pubDate>Fri, 03 Aug 2018 09:25:34 +0200</pubDate><guid>https://manuel.bernhardt.io/2018/08/03/tour-akka-cluster/</guid><description>&lt;p>Here&amp;rsquo;s an overview of the Tour of Akka Cluster article series:&lt;/p>
&lt;ul>
&lt;li>&lt;a href="https://manuel.bernhardt.io/2018/01/03/tour-akka-cluster-akka-distributed-data/">Tour of Akka Cluster - Akka Distributed Data&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://manuel.bernhardt.io/2018/01/31/tour-akka-cluster-eventual-consistency-persistent-actors-message-delivery-semantics/">Tour of Akka Cluster - Eventual consistency, persistent actors, message delivery semantics&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://manuel.bernhardt.io/2018/02/26/tour-akka-cluster-cluster-sharding/">Tour of Akka Cluster - Cluster Sharding&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://manuel.bernhardt.io/2018/03/23/tour-akka-cluster-testing-multi-node-testkit-handful-raspberry-pis/">Tour of Akka Cluster - Testing with the multi-node-testkit and a handful Raspberry PIs&lt;/a>&lt;/li>
&lt;/ul></description></item><item><title>Tour of Akka Cluster – Testing with the multi-node-testkit and a handful Raspberry PIs</title><link>https://manuel.bernhardt.io/2018/03/23/tour-akka-cluster-testing-multi-node-testkit-handful-raspberry-pis/</link><pubDate>Fri, 23 Mar 2018 08:19:47 +0100</pubDate><guid>https://manuel.bernhardt.io/2018/03/23/tour-akka-cluster-testing-multi-node-testkit-handful-raspberry-pis/</guid><description>&lt;p>In the previous parts of this article series, we have looked at various functionality of Akka Cluster: &lt;a href="https://manuel.bernhardt.io/2018/01/03/tour-akka-cluster-akka-distributed-data/">distributed data&lt;/a>, &lt;a href="https://manuel.bernhardt.io/2018/01/31/tour-akka-cluster-eventual-consistency-persistent-actors-message-delivery-semantics/">persistence, message delivery semantics&lt;/a> and &lt;a href="https://manuel.bernhardt.io/2018/02/26/tour-akka-cluster-cluster-sharding/">cluster sharding&lt;/a>. We are far from done with exploring Akka Cluster features, but today it is time to look at one feature that is extremely useful when it comes to building production-quality systems based on Akka Cluster: the test support. As testing itself isn&amp;rsquo;t the most exciting activity there is, let&amp;rsquo;s space this article a bit up by throwing a few Raspberry PIs in the mix:&lt;/p></description></item><item><title>Tour of Akka Cluster – Eventual consistency, persistent actors, message delivery semantics</title><link>https://manuel.bernhardt.io/2018/01/31/tour-akka-cluster-eventual-consistency-persistent-actors-message-delivery-semantics/</link><pubDate>Wed, 31 Jan 2018 14:19:43 +0100</pubDate><guid>https://manuel.bernhardt.io/2018/01/31/tour-akka-cluster-eventual-consistency-persistent-actors-message-delivery-semantics/</guid><description>&lt;p>In &lt;a href="https://manuel.bernhardt.io/2018/01/03/tour-akka-cluster-akka-distributed-data/">Tour of Akka Cluster - Akka Distributed Data&lt;/a> we looked into building a reactive payment processing system using Akka Distributed Data as a means to provide master-master replication to the order storage component. We did not, however, ensure in any way of form that the system as a whole could withstand individual node crashes. In this article, we will explore options for making the Reactive Payment Processor fault-tolerant.&lt;/p>
&lt;h2 id="evaluating-the-existing-design-in-the-light-of-redundancy">Evaluating the existing design in the light of redundancy&lt;/h2>
&lt;p>Let&amp;rsquo;s make a thought experiment and see if our current design is fit to be &amp;ldquo;upgraded&amp;rdquo; in the light of redundancy. Let&amp;rsquo;s suppose we have made the validation process redundant, so that it would take place on any node (not just the node on which the order was first registered). This way, should the order receiving the node fail, we would still be able to continue validation and processing (so long as it wasn&amp;rsquo;t the node also handling the particular acquring bank).&lt;/p></description></item><item><title>Tour of Akka Cluster – Akka Distributed Data</title><link>https://manuel.bernhardt.io/2018/01/03/tour-akka-cluster-akka-distributed-data/</link><pubDate>Wed, 03 Jan 2018 15:23:04 +0100</pubDate><guid>https://manuel.bernhardt.io/2018/01/03/tour-akka-cluster-akka-distributed-data/</guid><description>&lt;p>Building distributed systems is hard. Pesky things like the laws of physics get in the way of maintaining state accross geographically (and chronologically) disparate systems, and, if that weren&amp;rsquo;t already outrageous enough in itself, those systems may be subject to network failures, forcing us to think about annoying tradeoffs regarding consistency, availability and the meaning of life.&lt;/p>
&lt;p>One of the more interesting (well, at least from my perspective) tools in the &lt;a href="https://akka.io">Akka&lt;/a> toolbox is &lt;a href="https://doc.akka.io/docs/akka/current/cluster-usage.html?language=scala">Akka Cluster&lt;/a> and the modules built on top of it. Through its design it acknowledges the hard reality of life, promoting a &amp;ldquo;no magic here&amp;rdquo; approach to building distributed applications and yet at the same time, takes care about many of the harder aspects of doing so.&lt;/p></description></item><item><title>A handful Akka techniques</title><link>https://manuel.bernhardt.io/2014/04/23/a-handful-akka-techniques/</link><pubDate>Wed, 23 Apr 2014 19:50:28 +0200</pubDate><guid>https://manuel.bernhardt.io/2014/04/23/a-handful-akka-techniques/</guid><description>&lt;p>I&amp;rsquo;ve been using &lt;a href="http://akka.io">Akka&lt;/a> for 3 years in a variety of projects and by now, I have a hard time imagining to deal with
some of the parts of my work without it. Sure, Scala provides other powerful paradigms for dealing with concurrency, but
I find Actors to be one of the most elegant concept when it comes to reasoning about it.&lt;/p>
&lt;p>There are a few techniques that I&amp;rsquo;ve used repeatedly in projects and that I would like to share. Make no mistake though&lt;/p></description></item></channel></rss>