Tag Archives: ee

Thoughts on microservices. Part 2. Evolution of Microprofile.io

Looks like public transport is a good place to blog. For several hours I just have a time on my own. I may stay focused on the topic.

So, I’m now on my flight from Novosibirsk to Moscow after wonderful CodeFest conference! I’ve got four free hours, an A/C plug and no free internet (yes, there is payed one). Only the views of immense Siberia from my window .. and the beauty of Aeroflot stewardesses disturb me a little bit when passing by…

I had an amazing time in Siberia! I had a lot of really exciting moments there! I met a lot of truly interesting people and had the pleasure to talk to them! Trip report to CodeFest will be published soon!

But this time on the plane I have I want to dedicate to some other thoughts I recently had in my mind, and they are about the evolution of MicroProfile.io.

I had the privilege to be invited to CodeFest to give my talk right about MicroProfile.io in Russian. I was very happy that the audience was so excited about this project. I had a lot of questions that kept me in the discussion zone for more than one hour after my talk. The interest was great!

The MicroProfile.io project is an amazing example of a community work! It is very young, but it evolves extremely fast! I was the eyewitness of the birth of the project, when it has started with just three specs inside CDI, JSON-P, JAX-RS. It was kind of brave move to start with just these specs, but the same time it was very wise IMHO. This ignited a lot discussion and community work. Shortly after that a brand-new Config spec was created, allowing us the creation of not only portable code, but portable configuration as well.

Community worked hard to establish what is really useful in the microservices world and created Fault tolerance, Health checks, Metrics and JWT propagation. The specs like OpenAPI, RestClient and OpenTracing made the picture complete. JSON-B came as a cherry on the top. Every new version of the MicroProfile.io came with some new specs and evolutions of the already available ones, definitely great! Let us not forget that all this happened only in about two years period.

Every time together with Ivan Ivanov we gave our workshop on MicroProfile, or we gave our talks about it we saw some really huge enthusiasm in the eyes of our attendees. Finally, there is a lightweight absolutely standardized and portable way to write microservices in Java world.

The platform vendors from their side made some really tremendous efforts to implement all of those specs. Some of the servers were rewritten like from scratch. Completely new projects like Helidon and Quarkus emerged.

Starting from MicroProfile version 1.2 (which I believe is mature enough) I’ve started using it in my projects. Although it is a bit hard with the testing, I’m quite happy about it. I just love standard code, I like the portability. I even have used it twice, when we had to switch servers from different vendors. It really went seamlessly. In one of my previous post I’ve described how easy it was for us to migrate to Quarkus one of our services. Almost copy/paste! The power of standards!

There are some things that nevertheless bother me. I’m reading carefully the discussion in the MicroProfile.io mailing list and I’m not sure if, for example, adding a persistence spec to the project will be a good idea. I know, a lot of services are stateful and persist a lot… but is it really relevant to microservices? Everything can persist and this is not something specific to microservices. Why then should we put it to the MicroProfile.io project? There are a lot of stateless services. They don’t need any persistence.

I had the pleasure to share these my thoughts with Emily Jiang at Voxxed Bucharest. I have proposed to start thinking a little bit differently – why won’t we make separate profiles relevant only specific problem we are solving? Should we have a special “Persistence profile”? Or if we want to make thing reactively we should establish a “Reactive profile”? And if we need more than one profile, we just combine them.

This may sound even absurd, but I believe, that current set of specs is just enough for MicroProfile.io. There are already 12 of them. Most of them are really microservices specific like Fault tolerance etc., other like CDI are the foundation. Should JPA spec one of the foundation specs? I really don’t think so. If CDI is really a glue to put it all together, JPA can be sometimes totally ignored, if the service is stateless.

I’m still not sure if I’m right in my thoughts. I sincerely wait for critics. But I believe that staying focused on microservice relevant specs is a better evolution path. There are more microservice specific thing to be discussed, like better servicemesh integration. Or a common set of server flags?

Currently these 12 specs in MicroProfile 2.2 solve all of my microservice specific tasks. It’s only the JSON-P spec that I’m not using it anymore, I do it all through JSON-B 🙂

Ok, our plane is approaching Moscow, I already see the Ostankino tower and the Moscow-city skyscrapers. Time to switch off the laptop..