Author: ceracm

Build Eventuate Applications with AWS Lambda and Serverless

We are super excited to announce that you can now develop and deploy Eventuate applications using AWS Lambda and Serverless Framework. AWS Lambda functions have always been able to use the Eventuate APIs to create, update and find aggregates.  In fact, the Eventuate Signup page is a serverless application. What is new is that AWS Lambda functions can now subscribe to events published by the Eventuate event store. As a result, Eventuate applications can now be completely serverless.

We have written a plugin for the Serverless framework that makes it super easy. You simply specify in serverless.yml the events that your lambda is interested in. When serverless deploys your lambda, the plugin tells Eventuate to dispatch those events to your lambda. The following diagram shows how this works.

EventuateAWSGatewayArchitecture

For more information, please see the following examples:

Eventuate Local now supports snapshots

Event sourcing persists domain objects as a sequence of (state changing) events. To load a domain object from an event store, an application must load and replay those events. Long-lived domain objects can potentially have a huge number of events, which would make loading them very inefficient.

The solution is to periodically persist a snapshot of the domain object’s state. The application only has to load the most recent snapshot and the events that have occurred since that snapshot was created.

The Eventuate API now supports a snapshot mechanism. To create snapshots for a domain object, you simply define a SnapshotStrategy in the Spring application context. A SnapshotStrategy defines two methods:

  • possiblySnapshot() – invokes when an AggregateRepository updates an aggregate. It can decide to create a snapshot based on, for example, the number of events
  • recreateAggregate() – recreates an aggregate from a saved snapshot

Currently, only Eventuate Local supports snapshots. Eventuate SaaS will support them soon. For more information, see Defining snapshot strategies in Java

 

Introducing the Eventuate Local Console

We are super excited to announce that the Eventuate Local event store now has a simple console. It lets you browse the aggregate types and view aggregate instances. You can also see  a real-time view of the events as they are saved in the event store.

Here is a screenshot showing the TodoAggregate instances:

aggregateinstances

Here is a screenshot showing recent events:

aggregateevents

The UI is implemented using ReactJS UI and a NodeJS-based server. It is packaged as a Docker container image and can be run by defining the following container in your project’s docker-compose.yml:

consoleserver:
 image: eventuateio/eventuateio-local-console:0.12.0
 links:
 - mysql
 - zookeeper
 ports:
 - "8085:8080"
 environment:
 SPRING_DATASOURCE_URL: jdbc:mysql://mysql/eventuate
 SPRING_DATASOURCE_USERNAME: mysqluser
 SPRING_DATASOURCE_PASSWORD: mysqlpw
 EVENTUATELOCAL_ZOOKEEPER_CONNECTION_STRING: zookeeper:2181

Run the Eventuate Todo example application to see it in action.

The microservice architecture is a means to an end: enabling continuous delivery/deployment

A while ago we wrote that Successful software development = organization + process + architecture and described how the microservice architecture has a key role to play when developing large, complex applications. It is important to remember, however, that the microservice architecture is merely a means to an end. The ultimate goal is to deliver better software faster. Today, that invariably means continuous delivery – for an installed product – or continuous deployment for an -aaS product.

To clarify the goal of the microservice architecture, we decided to redraw the triangle with continuous delivery/deployment at the apex. The two corners at the base of the triangle are small, agile, autonomous, cross functional teams, and the microservice architecture.

successtriangle

The microservice architecture enables teams to be agile and autonomous. Together, the team of teams and the microservice architecture  enable continuous delivery/deployment.

Eventuate Local: Event Sourcing and CQRS with Spring Boot, Apache Kafka and MySQL

Eventuate™  is a platform for developing transactional business applications that use the microservice architecture. Eventuate provides an event-driven programming model for microservices that is based on event sourcing and CQRS.

The benefits of Eventuate include:

  • Easy implementation of eventually consistent business transactions that span multiple microservices
  • Automatic publishing of events whenever data changes
  • Faster and more scalable querying by using CQRS materialized views
  • Reliable auditing for all updates
  • Built-in support for temporal queries

Eventuate™ Local is the open-source version of Eventuate™. It has the same client-framework API as the SaaS version but a different architecture. It uses a MySQL database to persist events, which guarantees that an application can consistently read its own writes. Eventuate Local tails the MySQL transaction log and publishes events to Apache Kafka, which enables applications to benefit from the Apache Kafka ecosystem including Kafka Streams, etc.

This diagram shows the architecture:

Eventuate Local currently only supports Spring Boot applications but we plan to add support for other frameworks and languages over time.

Learn more about Eventuate Local

To find out more about Eventuate Local:

JavaOne 2016: Handling Eventual Consistency in JVM Microservices with Event Sourcing

Last week at JavaOne 2016, Chris Richardson, founder of Eventuate, Inc, and Kenny Bastani, developer advocate at Pivotal, gave a talk on using Event Sourcing to maintain data consistency in a microservices architecture.

Example code

Here is the code for the sample Spring Boot application that Kenny developed for the talk. What is especially exciting is that the microservices demo is built using Eventuate!

Slides

Here are the slides:

Learn more about Eventuate

To find out more about Eventuate:

 

The new Eventuate Java Client

We are super excited to announce that we have started migrating the example applications to the new Eventuate Java client. The highlights of this new client include:

  • Open-source with Javadoc (still work in progress) and source jars
  • Written in Java 8 instead of Scala with a Java wrapper
  • Fully reactive
  • Better modularity, which will make it easier to support more than just Spring applications

So far we have migrated the Money Transfer and the Customer and Orders examples.

For more information, please see the revised getting started guide.

Developing microservices with #DDD aggregates (SpringOne platform, #s1p)

Last week at Spring One Platform, our founder Chris Richardson gave a talk on developing microservices with Domain-Driven Design aggregates.

 

Slides

Here are the slides:

Example code

Here is the code for the Orders and Customers example.

Learn more about Eventuate

To find out more about Eventuate: