Microservices are independent, encapsulated entities that produce meaningful results and business functionality in tentative collaboration. Events and pub/sub are great for allowing such decoupled interaction. Using Apache Kafka as robust, distributed, real-time, high volume event bus, this session demonstrates how microservices packaged with Docker and implemented in Java, Node, Python and SQL collaborate unknowingly. The microservices respond to social (media) events - courtesy of IFTTT - and publish results to multiple channels. The event bus operates across cloud services and on premises platforms such as Kubernetes: both the bus and the microservices can run anywhere. A microservices platform is discussed with generic capabilities.
Outline: presentation summary
- intro microservices objectives, focus on decoupled collaboration
- demo four mservices in different technologies (Node, Java, ...) ; no direct dependencies; show the code (running on its own), show the packing into a container and the step of running the containers on a container management platform, using both Kubernetes and a Container Cloud Service (later on this will further the point of collaborating between microservices that are widely separated)
- discuss generic capabilities of a microservices platform (facilities required in many microservices that should be available as microservice - such as cache, log, authenticate (and compare with Java EE application server)
- demo a microservice providing a generic cache functionality (based on MongoDB)
- outline the desired choreography (a four step workflow that requires participation from various microservices); briefly discuss routing slips and the Saga pattern
- discuss use of events and need of event bus
- intro Kafka
- demo pub and sub from each mservice to Kafka
- link IFTTT to Kafka (for demo: use ngrok to expose local Kafka to IFTTT cloud)
- demo end-to-end Social event=>IFTTT=>Kafka=>choreographed mservices=> final result
- demo: extend one of the microservices: change the code, package a new container image version and update the running version in the container platform; demonstrate that new workflows leverage the new version
- demo: move a microservice from on premises to cloud - showing that the decoupled nature of the mservices mean that this move does not have any impact
- demo: show a change in the logic of the routing slip; none of the mservices require any change for a changed workflow choreography to be executed
- discuss cloud deployment of event bus + mservices