There's a new trend in Application Development stacks lately. More and more applications are moving towards the Microservices Architecture.
These modern applications are built to scale from the ground up. Microservices process tasks on-demand, in parallel, and often in isolated and self-contained runtime environments. These event-driven services promote loosely coupled components focused around very specific business capabilities. The biggest promise of this type of architecture, is perhaps the unlimited flexibility it provides - from multi-language support to automatic resource provisioning based on demand, etc.
This past weekend, I built a simple proof-of-concept application that takes advantage of this architecture. It's a rudimentary Twitter Sentiment Analysis app via SMS. Basically, you text a product, company, politician, celebrity, etc. name to the number 904-513-1429. The application then queries Twitter and classifies the tweets as positive, negative or neutral depending on their context.
As you can see from the diagram above, the SMS messages are sent to a service; the service then adds the messages to the queue, where they are processed in parallel by workers implemented as microservices. These workers run in isolated containerized environments, and can even be written in different languages - Ruby, Java, NodeJS, etc.
As you can see, this application can easily scale - with the ability to launch workers as needed, based on the load. It's a simple development architecture paradigm, yet very flexible and very powerful.
For this Proof-of-Concept, I used the following cloud services:
- Twilio for SMS API
- DatumBox for Twitter Sentiment Analysis API
- Iron.io for Queues / Microservices / Task Workers
- Spring Boot for Bootstrapping the Java worker implementation
If you are interested, I created a boilerplate java starter project in GitHub for implementing IronWorkers - https://github.com/bytekast/ironworker-java-starter.