Creating a microservice based architecture using Warewolf

Over the last year or so, microservices have become an increasingly popular buzzword in software development, so much that microservice architectures are considered to be the preferred SOA architecture pattern of many experts like Martin Fowler. This blog post will examine microservices as an enterprise architecture pattern and the use of Warewolf as a microservice server.

What are microservices?

It’s best to explain microservices by first explaining the problem microservices attempt to fix.

Many years ago, I contracted at a company that processed surveys for various clients. The company’s main application that processed the surveys consisted of an internet facing application hosted in IIS that also acted as a portal for clients to integrate with or view their data. As the application grew, the needs of clients became more sophisticated. Naïve CEP and reporting became a key part of the system.

The problem, however, was that each survey was different; and most clients required custom reporting and event processing actions per survey. The original application was architected in such a way that it was impossible to deploy a new event processor without first re deploying the entire application.

This became a major problem; frequent deploys lead to decreased processing capacity and a large support burden for an admittedly small support team. Botched deploys happened often and this lead to client dissatisfaction. Each change required regression testing of the entire application and the lead time between dev. complete and deployment grew with each passing month.

The diagram below is a simplification of the application in question:

 

monolithic application

 

The application was a monolith and monoliths are clumsy and slow. The answer is a more agile architecture. Instead of building a monolith, the solution to this problem is to architect the system as a series of small independent services that are self-contained and easily deployable. And that is essentially what a microservice is.

Formally, microservices can be defined as self-contained, independently deployable units of software that use standard REST based communication and act as the server side components of a larger system.

 

How does Warewolf fit in?

Warewolf is a microservice platform that allows you to host microservices designed using the Warewolf service designer or to host existing .Net DLLs, stored procedures or web services as microservices. Warewolf microservices are accessible via restful web services and deployable from any other Warewolf server with network access. On top of all this, Warewolf provides a security layer and detailed logging.

Once again, it is probably best to use an example to illustrate the use of Warewolf as a microservice platform.

“Bob’s Building Supplies” is a company that provides building supplies to various large construction firms. Bob himself is a visionary and commissions a system that allows his clients to integrate with his stock control systems so that they can always be aware of supply constraints and so that he can better forecast the supply chain.

Knowing that some of his clients have quite antiquated systems, Bob wants to provides his clients with three methods of integration; web services, FTP uploads and access to his existing stock control application via a DLL using Domain security. Being a visionary Bob wants the new integration application to be designed using new-fangled microservices because he anticipates many changes in the future.

To design this application using microservices in Warewolf is quite trivial and can be accomplished in a few simple steps.
The FTP Microservice can be designed as follows:

 

FTP microservice

 

The Web Service Microservice can be designed as follows:

 

web service microservice
The existing Domain DLL Microservice can be designed as follows:

 

DLL microservice
Each of the services shown in the diagrams above is independently deployable and self-contained. They can be further composed into more complex services using the simple drag and drop design surface. They are accessible via Restful services. It really is as simple as that.

Microservices are a natural evolution of SOA, which fits perfectly into the more agile software development methodologies prevalent today. They form the architectural foundation for companies such as Amazon and Netflix.

Like all other patterns, they are not applicable to every problem domain, however the next time that you are tasked with creating a green field application or you need to refactor an existing monolith, consider microservices or better yet, have a look at Warewolf as a microservice.

FacebookTwitterLinkedInGoogle+RedditEmail

2 Comments

  1. Great article Leon introducing some of the benefits of microservices and how Warewolf can be used to easily implement these. As Martin Fowler mentions simple message queue using for example RabbitMQ, failure detection and recovery are crucial to a microservice architect. Are these offered, or on the cards for Warewolf ?

    1. Robin van den Heever

      Hi Jason,

      Great question. Warewolf has several safeguards built into the product.

      Each tool that is used in a Warewolf microservice flow has the ability to report an error. This is analogous to having error handling included within each traditional method in a class.

      Included in each of the error handling options is the option to terminate the microservice if the error handler is activated.

      The error handler can also run another microservice which can be used for immediate notification about a microservice’s state, so this can immediately send SMS’s, Emails, messages, or whatever may be required to get the crucial state handled.

      Warewolf also has 7 levels of logging for both Warewolf Studio and Warewolf Server. The most verbose level provides highly detailed logs describing the microservice execution.

      It is also fairly simple to set up a server that handles log aggregation from your different Warewolf servers. Warewolf can push log files on schedule to a log aggregation system like Logstash for aggregation, monitoring and analysis.

Leave A Comment?