devonfw-forge / devon4j-legacy-modules

Server reference implementation (integrates components on devon4j)
Apache License 2.0
13 stars 11 forks source link

Discussion on what microservices route to follow #65

Open amarinso opened 7 years ago

amarinso commented 7 years ago

Currently we are reviewing a PR coming from a real engagement from Carrefour where they have chosen a microservices architecture based on the Netflix stack and running on top of OpenShift.

There are some archetypes for creating infrastructure for microservices as well as some configuration and REST client usage.

There is an obvious overlap between what Spring Cloud provides and what the deployment platform provides, like service discovery, routing or configuration... the same overlap (or similar) will exist with other options like docker Swarm.

We should discuss what will we offer from devon (or OASP)

I'm more in the line of providing utilities/helpers/accelerators that can be used on different scenarios... but that may be insufficient for most of the engagements

Maybe we can propose several alternatives coming from different engagement experiences on the form of documentation (or white books that @ivanderk was proposing)

On my personal opinion we could bet on a platform and favor it on our engagements. In this case I would prefer to rely on OpenShift as the deployment platform because there is already a lot of effort in that project and you have RedHat behind it what gives credibility.

Please share your ideas here so anyone can be aware of our thoughts.

maihacke commented 7 years ago

Here is some input from my current engagement

Netflix OSS

amarinso commented 7 years ago

Can we know a bit more about what kind of problems is that OpenShift engagement facing? Also some detail about what made kubernetes a failure for the PL... Kubernetes is maybe too low level thus my preference for OpenShift (two big customers here, Carrefour and Inditex are adopting it... and we know also that Santander Bank is using it since long time ago....)

As another alternative, checkout this article where I discovered about envoy http://blog.christianposta.com/microservices/microservices-2-0/

Also the REST client of choice may be questioned here as currently the default choice should be CXF as proposed per OASP.

lferna commented 7 years ago

Hi,

In our case (same as @amarinso Engagement) we could give some feedback about our (short) experience:

And something more that I possibly forgot.

hohwille commented 7 years ago

In my project we are using yet another approach. We are using Apache CXF also for the client. Also we have modularized the projects and have an api module for each microservice. We do code first (current OASP4J documentation) instead of contract first (swagger) but that should not really matter. If one microservice/app depends on another, it imports its api. Then we have a component (as a simple interface) that can instantiate the RestService from its interface via a single method defined in the components API. This internally solves service discovery, HTTP header control (e.g. correlation id), security/authentication (in our case passing JWT), error handling and exception mapping, etc. Also mocking in tests (JUnit) was addressed and solved in our project. There are a lot of problems that need to be solved here and some might not even yet be aware of them. My proposal would therefore be:

WDYT? BTW: To already answer the question "are you proposing to create a framework by OASP?": Yes and no. This is optional stuff and the API (empty marker interface) is so minimal that it IMHO is no framework but the value of doing so is quite high. Without such thing we have many problems unsolved in OASP (e.g. if you extract interfaces from REST-Services then OASP will currently fail because it detects services for registration via JAX-RS annotations in implementation that will then however be in interface, etc.). An empty marker interface does not interfere but solves this elegant. Projects who do not want to couple this way can still copy the entire solution into their own project and have the interface in their own project namespace (that is what is currently happening but preventing reuse and causing problems).

amarinso commented 7 years ago

Several comments:

Reviewing CXF I came across this feature I didn't knew fail-over wich pointed me to this Apache project I also did not know about polygene and you may find interesting (Composite Oriented Programming for domain centric application development)

maihacke commented 7 years ago

@amarinso: Because of the problems with openshift you may ask @KarlPrott. Because of the problems with kubernetes and production line you may ask Tobias N.

Looking at the discussion here, it looks to me that every project has a very different approach. Maybe it is to early to give projects a one-size fits all solution, as we tried with the server side stack. May it would be a good first step to give projects a guidance in the form of:

When to "do" microserivces, when not? What topics need to be addressed including advises for "proven" technologies. Service Discovery Routing Security Logging / Tracing / Monitoring Handling Persistence (e.g. for databases, messaging, ...) Application design principles ...

Maybe some of the topics a covered in the microservices book...

maihacke commented 7 years ago

P.S. what could be helpful would be a comparison of different "PaaS" solutions, Swarm, Kubernetes, Openshift. I'm always a bit puzzled when trying to find out what exactly the differences are, and when to choose e.g. Openshift in favor of swarm. At the moment the most obvious point is that openshift offers some additional services (e.g. CI, ...), but is that all?

hohwille commented 7 years ago

BTW: If you still consider my proposal to lead to a framework and that should not be part of OASP for some reason then should I contribute to springframework instead of OASP or implement it in mmm?

amarinso commented 7 years ago

@hohwille Can you share a more elaborate example from your project to properly evaluate it? maybe I under-valuated from your comment.

We are recommending using standards where appropriate and for REST clients now JAX-RS 2 comes with this support and has some alternative implementations (CXF, Jersey, RestEasy)... what do we miss here?

Maybe we can start listing the "requirements" that we want for our clients, to add to the already mentioned:

Some other Rest Frameworks I've come across include:

amarinso commented 7 years ago

Along this thoughts (calling microservices) I highly recommend this blog post from Christian Posta (RedHat)

http://blog.christianposta.com/microservices/the-hardest-part-of-microservices-calling-your-services/

hohwille commented 7 years ago

I already started on my oasp4j fork for a PR on this: https://github.com/hohwille/oasp4j/ Please have a look, get involved and lets work together (not only with words but also with code).

hohwille commented 7 years ago

Along this thoughts (calling microservices) I highly recommend this blog post from Christian Posta (RedHat)

👍

We’re implementing lower-level networking functions at the application layer

I fully agree. So why do we need netflix service discovery in client if docker swarm or kubernetes or mesos can already solve this transparently? Why do we need netflix ribbon client side loadbalancing?

hohwille commented 7 years ago

Angel suggested to consider side-car. Here you can find a quick intro: http://blog.christianposta.com/microservices/00-microservices-patterns-with-envoy-proxy-series/

I very much like that you get a solution that focuses on a lot of different aspects that can be configured without the need to put all of that into your code. This makes the solution reusable across all technologies (Java, .NET, JavaScript/Node.js, etc.). However, we would need to do a verification (ideally in a real world project). Also we need to see that this solution really works cross platform easily as it is written in C++ - so if we have a java app that we can deploy to machine X will side-care also work on machine X OOTB or do I have to compile it myself and even end up with gcc errors?

However, instead of building everything into your app this could be a really nice approach to consider.

As @maihacke stated there are a lot of opportunities and so far no single best-practice. My proposal that I have started as a fork is flexible enough to work with all of these opportunities. However, I would love to also crystallize a best-practice to focus on and provide as default implementation.

andihess commented 7 years ago

How do you evaluate Apache Camel in that context? The Enterprise iPaaS team is using this as their approach to Microservices (with Consul as service registry). I have not looked into their details but Google lead me to articles like e.g. https://dzone.com/articles/microservices-with-apache-camel