InfoQ

The Software Architects' Newsletter
November 2017

We are delighted to be able to share our fourth monthly architects' newsletter with you, which we will send on the last Friday of every month. InfoQ strives to facilitate the spread of knowledge and innovation within this space, and in this newsletter we aim to curate and summarise key learnings from news items, articles and presentations created by industry peers, both on InfoQ and across the web. We aim to keep readers informed and educated about emerging trends, peer-validated early adoption of technologies, and architectural best practices, and are always keen to receive feedback from our readers.

News

Service Interaction Mechanisms

This month on InfoQ, Srini Penchikala organised a virtual panel on the topic of "Microservices Interaction and Governance Model - Orchestration v Choreography." Highlights of the panel included the recommendation to think of microservices interaction in terms of commands and queries, as popularised by Command Query Responsibility Segregation (CQRS): commands are external requests that create, update or delete data; and queries are external requests that simply read data.

Service interaction mechanisms include messaging/eventing, Remote Procedure Calls (RPC), and REST-like interaction e.g. JSON over HTTP/S. Service orchestration gives visibility into the processes and data flow involved, but it's inflexible as you have to describe every interaction. Service choreography works by the exchange of messages between different services, which ultimately translates into decentralized service composition.

The panel concludes with a discussion of the Spring Cloud Stream framework - which lets developers focus on writing messaging-centric services - and the Spring Cloud Data Flow framework - which enables the orchestration of messaging-based microservices.

Artem Bilan has created an interesting related article that discusses "How to test Spring Cloud Stream applications (Part I)." The article sets the scope of the challenge by quoting Gregor Hohpe in the introduction "One of the reasons integration solutions are not tested thoroughly is the fact that testing asynchronous, message-based middleware solutions is challenging." The remainder of the article walks through a practical example of unit testing a Spring Cloud Stream application, and the second part in the series will explore integration testing further.

Processing and Querying Streams

Ken Finnigan has created a sample application and tutorial for "Data Streaming with WildFly Swarm and Apache Kafka." The associated GitHub repository contains code to allow developers to experiment with sending and consuming events via Kafka and Java-based applications deployed on OpenShift.

Continuing a very comprehensive series of articles on the Confluent blog, this month Ben Stopford has written "Building a Microservices Ecosystem with Kafka Streams and KSQL." Kafka Streams is the core API for stream processing on the JVM - Java, Scala, Clojure etc - and it is based on a DSL (Domain Specific Language) that provides a declaratively-styled interface where streams can be manipulated in a SQL-like fashion, and joined, filtered, grouped or aggregated.

KSQL provides a simple, interactive SQL interface for stream processing for applications that are not running on the JVM. KSQL can be run standalone, for example via the sidecar pattern, and uses the Kafka Streams API under the hood. This means it can be used to do the same kind of declarative "slicing and dicing" that might be done in JVM code using the Streams API. Then a native Kafka client, in whatever language the consuming service is built in, can process the manipulated streams one message at a time.

Case Studies

Special Focus: Event Sourcing

At the recent Microservices Conference QCon London 2017, Greg Young claimed that event sourced microservices is an area that hasn't been explored nearly as much as it should be. However, event sourcing is not a panacea, and it was strongly emphasized that developers should not event source every microservice within an application. Instead, Young recommended examining the requirements of individual services and applying the event sourcing pattern to services that will actually benefit from it.

Jonas Bonér, Founder & CTO at Lightbend, gave the keynote presentation at the recent Reactive Summit 2017 conference and discussed how event driven architectures (EDA) and event stream processing (ESP) technologies are helping with designing the modern applications based on distributed systems. Bonér recommended developers to not focus on just the "things" in the system - the Domain Objects - but rather focus on what happens - the Events. A key takeaway of the talk is that event sourcing allows developers to model time by treating an event as a snapshot in time and the event log as the full history. This allows for "time travel" in the sense that the log can be replayed for historic debugging, as well as stored for auditing and traceability.

For architects looking to get started with exploring the topic of event sourcing, Kenny Bastani has created an event-souring-microservices-basic GitHub repository that provides a reference example that is intended to teach the basics of event sourcing in Spring Boot applications. Additional theory can be found in Chris Richardson’s InfoQ series "Developing Transactional Microservices Using Aggregates, Event Sourcing and CQRS" from earlier this year. Jan Ypma also recently gave a talk at ProgSCon "Disrupting Development Using Reactive Event Sourced Systems with Akka," which presented the building of a system which exposes reactive events as a real-time streaming REST API.

To get notifications when InfoQ publishes content on this topic follow Event Driven Architecture on InfoQ.

This is the fourth issue of a monthly newsletter, focusing exclusively on software architecture. We thought it would be valuable for you to get a quick overview of things you might like to keep an eye on. If this is not the case, you can unsubscribe using the link below.

Unsubscribe

Forwarded email? Subscribe and get your own copy.

Subscribe