Exploring Stateful Microservices built with Open Source Java in Kubernetes


Mary Grygleski
IBM, Senior Developer Advocate

Mary is a Senior Developer Advocate with the Websphere/Liberty technology team at IBM, with a focus on Liberty, MicroProfile, Reactive Java, Open Source, Cloud, and Enterprise Distributed Systems. She started working as a software engineer with C and Unix, then got into Java, Open Source, and web development in the new Millennium, and now she has ventured into Reactive, Mobile, and the DevOps space. In her previous incarnations, she worked for several technology product companies in the Route 128 Boston Technology Corridor as well the San Francisco Bay Area. She now resides in the Greater Chicago area and is the President and Executive Board Member of the Chicago Java Users Group (CJUG). She is also an active co-organizer for the Data, Cloud, and AI In Chicago, Chicago Cloud, and IBM Cloud Chicago meetup groups. Mary continues to be amazed by how software innovations can dramatically transform our lives. Despite the many challenges in an ever-evolving technical world, she gets energized by the constant change and believes that she has uncovered the pathway to staying young. She can’t wait to see what the next tech wave will be like.


How does one choose to architect a system that has a Microservice / REST API endpoints? There are many solutions out there. Some are better than others. Should state be held in a server side component, or externally? Generally, we are told this is not a good practice for a Cloud-Native system, when the 12-factor guidelines seem to be all about stateless containers, but is it? It’s unclear and this confusion may lead to poor technology stack choices that are impossible or extremely hard to change later on as your system evolves in terms of demand and performance.

While stateless systems are easier to work with, the reality is that we live in a stateful world, so we have to handle the state of data accordingly to ensure data integrity beyond securing it.

We will examine and demonstrate the fundamentals of a Cloud Native system with Stateful Microservices that’s built with Open Liberty in Kubernetes:

  • Microservices/REST API – Options to use when running your apps in the JVM
  • Concurrency – how to take advantage of multi-core CPUs and clustered distributed systems
  • Stateful vs Stateless - while stateless apps are easier to implement, the bulk of the apps in production are stateful which involve a higher level of complexity and risk, especially when data would need to travel across multiple machines and network boundaries
  • Deployment – how about containerization and orchestration using Kubernetes?