Successful software development = organization + process + architecture #gluecon

Successful software development requires the right organizational structure, development processes, and software architecture.

SuccessfulDevelopment.001

Fred Brooks in his book the Mythical Man Month describes how the communication overhead for a team of size n is n(n – 1)/2. Consequently, a software development organization should either be a small team, or  a collection of small, autonomous teams. Amazon, for example,  famously organize around two pizza teams. Pizzas are an ambiguous unit of measurement but probably each team should be 6-10 people.

Despite rumors of the death of agile,  it almost always makes sense to use an agile development process.  Teams should do continuous delivery or, ideally, continuous deployment. Small, agile and autonomous teams can move fast (without breaking things) and keep up with the needs of the business. But what about the software architecture?

For small, simple applications the monolithic architecture often the best choice.  Development is simple, testing is easier and the application is easier to deploy and manage. However, successful application have a habit of growing and your monolithic application will become  large and complex. It will become extremely difficult to develop and deploy in an agile fashion. Teams are no longer autonomous. Delivering software will require lengthy merges and excessive amounts of communication and coordination. You will likely end up in monolithic hell.

Once your application becomes large you will need to adopt the microservices architecture. You functionally decompose what would otherwise be a monolith into a set of small applications or services. Each team owns one or more services. Each service has its own private data in order to ensure loose coupling. This architecture enables the teams to be agile and autonomous.

To learn more about microservices

Take a look at our founder, Chris Richardson’s recent talk at Gluecon on a microservices pattern language.

Learn more about Eventuate

To find out more about Eventuate:

Microservices and Redis – a keynote at #redisconf

Yesterday, Chris Richardson, the founder of Eventuate, gave a keynote about microservices and Redis at RedisConf 2016. Chris described the microservices architecture, explained why you should use it and discussed where Redis fits in.

Slides

Here are the slides:

Example code

There is also an sample application consists of event-driven microservices built using event sourcing and CQRS that uses Redis as a CQRS view.

Learn more about Eventuate

To find out more about Eventuate:

 

Real-time, collaborative Kanban board example built with event sourcing, microservices, @springboot and @docker

We are super excited about the latest Eventuate sample application. It is a real-time, collaborative Kanban board. The application uses Websockets to deliver events published by the Eventuate event store to each user’s browser. This ensures that every user viewing a Kanban board sees the same consistent view . It is a great example of how event sourcing is an excellent choice for real-time collaborative applications.

The following diagram shows the architecture.

The application has an AngularJS front-end. Each of the microservices as well as the API Gateway are written in Java and use Spring Boot. The system-of-record is the Eventuate event store. MongoDB is used as a CQRS view of boards and tasks. The microservices , the API gateway and MongoDB are deployed using Docker.

Event sourcing is a good choice for this kind of collaborative application. That is because whenever the state of the application – i.e. a board or a task – changes an event is published. Those events can then update the information displayed to the users. In this application the events are transformed into WebSocket messages and delivered each user’s browser.

Learn more about Eventuate

To find out more about Eventuate:

 

The Eventuate Todo List application: #microservices, @SpringBoot, #EventSourcing, #CQRS

It is a challenge to write a simple yet meaningful example application that illustrates how to develop event-driven microservices using the Eventuate platform. That is because the microservices architecture requires you to have at least two services. The Money Transfer application has, for example, three (soon to be at least 4) separate services. Even though it is a great example of how to write event-driven microservices using event sourcing and CQRS it is not the easiest introduction to the topic.

To make the getting started experience easier we have created the Todo List application. This application is a Java and Spring Boot application built using Eventuate™’s Event Sourcing based programming model. The application has a HATEAOS-style REST API for creating, querying, updating and deleting a todo list. The API design is inspired by the Todo backend project. The principle difference is that unlike the original version this API is eventually consistent.

The application has a CQRS-based architecture. Creates, updates and deletes are handled by the command side service, which consists of a Todo Aggregate that is persisted using event sourcing. Queries are handled by the query side service, which maintains a materialized view of the todo list in a SQL database.

There are two versions of the application. The simplest version is a single module Gradle project that builds monolithic version of the application of the API. It is a great way to learn the Eventuate API.

The other version of the application is a multi-module Gradle project, which can be deployed as either a monolith or as two microservices: a command-side service and a query-side service.

Both versions come with a Docker Compose file that can be used to launch the application along with a MySQL database.

To get started take a look at the README.md.

Learn more about Eventuate

To find out more about how you can use the Eventuate platform to build event-driven microservices:

Using Eventuate with @SpringBoot 1.3.3

If you use the Eventuate Java/Scala client framework with Spring Boot 1.3.3 (rather Spring Boot 1.2.x) you will encounter this exception:

Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [net.chrisrichardson.eventstore.subscriptions.config.EventStoreSubscriptionsConfiguration$$EnhancerBySpringCGLIB$$20370698]: Constructor threw exception; nested exception is java.lang.VerifyError: class com.fasterxml.jackson.module.scala.ser.ScalaIteratorSerializer overrides final method withResolved.(Lcom/fasterxml/jackson/databind/BeanProperty;Lcom/fasterxml/jackson/databind/jsontype/TypeSerializer;Lcom/fasterxml/jackson/databind/JsonSerializer;)Lcom/fasterxml/jackson/databind/ser/std/AsArraySerializerBase;
at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:163)
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:89)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:1098)
... 71 more
Caused by: java.lang.VerifyError: class com.fasterxml.jackson.module.scala.ser.ScalaIteratorSerializer overrides final method withResolved.(Lcom/fasterxml/jackson/databind/BeanProperty;Lcom/fasterxml/jackson/databind/jsontype/TypeSerializer;Lcom/fasterxml/jackson/databind/JsonSerializer;)Lcom/fasterxml/jackson/databind/ser/std/AsArraySerializerBase;
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:760)

This exception is thrown because of an incompatibility between the version of jackson-module-scala used by Eventuate and the version of Jackson JSON used by  Spring Boot 1.3.3.

A later version of the Eventuate client will address this problem. In the meantime, you can fix the problem by defining the following dependency:

dependencies {
compile com.fasterxml.jackson.module:jackson-module-scala_2.10:2.6.3
}

#hacksummit 2016 – event-driven microservices – Events on the outside, on the inside and at the core

A couple of days ago at the virtual conference Hacksummit 2016, Chris Richardson, the founder of Eventuate, gave a talk on event-driven microservices. Here is the abstract:

This presentation looks at the importance of events and the role that they play in applications. We describe how events are a key application integration mechanism and how they are used by applications to communicate with the outside world. You will learn how the microservices inside a system can use events to maintain data consistency. We discuss how easy it is to implement both of these mechanisms by developing your core business logic using an event-centric approach known as event sourcing.

The talk describes how to build event-centric business logic using event sourcing. The events emitted by DDD aggregates are used within an application to maintain data consistency across services. They are also used to integrate applications using the patterns of enterprise integration. Events are used to generate notifications (SMS, email, mobile push etc) that are sent to users.

Here are the slides:

And, here is the video

Learn more about Eventuate

To find out more about how you can use the Eventuate platform to build event-driven microservices:

Presentation on event-driven microservices – Events on the outside, on the inside and at the core

A couple of weeks ago at JFokus 2016, Chris Richardson, the founder of Eventuate, gave a talk on event-driven microservices. Here is the abstract:

This presentation looks at the importance of events and the role that they play in applications. We describe how events are a key application integration mechanism and how they are used by applications to communicate with the outside world. You will learn how the microservices inside a system can use events to maintain data consistency. We discuss how easy it is to implement both of these mechanisms by developing your core business logic using an event-centric approach known as event sourcing.

The talk describes how to build event-centric business logic using event sourcing. The events emitted by DDD aggregates are used within an application to maintain data consistency across services. They are also used to integrate applications using the patterns of enterprise integration. Events are used to generate notifications (SMS, email, mobile push etc) that are sent to users.

Here are the slides:

Learn more about Eventuate

To find out more about how you can use the Eventuate platform to build event-driven microservices:

Early access version of the Eventuate Platform

We have released the early access version of the Eventuate Platform. It solves the distributed data management problems inherent in a microservice architecture. The platform  provides a simple yet powerful programming model for writing event-driven microservices. It is based on the principles of Event Sourcing and Command Query Responsibility Segregation (CQRS).

It would be great if you could take a look and provide feedback to shape the future direction of the platform.

Microservices – more than just infrastructure

Matt Miller of Sequoia recently published a map of the microservices ecosystem.

 

The ecosystem map is very focussed on infrastructure. It lists many of the usual suspects including Docker, Kafka, Cloud Foundry, Azure, and Chef. It includes some developer frameworks such as Hystrix but unfortunately, the focus on infrastructure means there are some surprising omissions.

Microservices need a chassis

James Watters from Pivotal, for instance, points out that Spring Boot and Spring Cloud are nowhere to be seen:

That is a shame because if you are building microservices you need a microservice chassis, such as Spring Cloud + Spring Boot. A microservice chassis is a framework that enables you to quickly create a new service. It handles cross-cutting concerns such as logging, service discovery, service registration, externalized configuration, etc.

Microservices and distributed data management problems

Also absent from the microservices ecosystem map are technologies that make it easier for application developers to write the business logic, the raison d’être for the microservices. This is unfortunate since microservice patterns such as Database per Service have a profound impact on how business logic is written. It is often impossible to use the familiar ACID transaction model and instead developers must use BASE transactions.

The goal of the Eventuate platform is to to help application developers address these issues.

It provides a simple yet powerful event-driven, programming model that, among other benefits, solves the distributed data management problems inherent in a microservice architecture. The platform consists of a scalable, distributed event store server and client libraries for various languages and frameworks including Java, Scala, and the Spring framework. Eventuate makes it easy for application developers to implement eventually consistent transactions that span multiple microservices.

Towards a more comprehensive map of the microservices ecosystem

Microservices are more than than just infrastructure. You need a microservices chassis so that you can quickly create new services. Many microservice-based applications will benefit from using a platform such as Eventuate to solve distributed data management problems. Hopefully, the microservices ecosystem map will be expanded to reflect this reality.

Learn more about Eventuate

To find out more about Eventuate: