-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[question] How mature or industrial proven is this framework? #33
Comments
@archenroot Thanks for your interest on light-eventuate-4j which is a service mesh that provides infrastructure for service to service communication. On top of light-eventuate-4j, you can use REST, GraphQL and Hybrid style of APIs/services to communicate with consumers and use light-saga-4j(in development) for distributed transaction orchestration. If you have a single application, I wouldn't recommend to use it as the front infrastructure cost is too high. But if you are expecting to deploy hundreds or thousands services in the future, then it would be very suitable. Currently, we are working with a bank in Canada to implement Rest/Eventuate/Saga for its core business and several big companies (TCS, IBM, Redhat, Deloitte and Capco) are interested in working with us to support and promote the frameworks to other customers. The performance number is no big deal for small number of services but if you have too many services, then the production cost would be significantly different. In summary, our goal is enterprise level scalability, security and reliability as a cloud native platform. We are also exploring serverless offering for small and medium sized business at the moment. |
It is easy to implement projects using the light-4j/light-evenutuate-4j framework. There is a sample project which could be used as a quick start reference. One of the client application which went to production only took a couple of days to implement and deploy. Sample project Github source: Sample project document: |
@stevehu - thanks for review. GraphQL sounds interesting, really. In my case I am trying to get rid of any kind of REST API where possible to make everything event driven async only, including UI (prefering just webscokets) @ChenYan71 - thank you for the links, handson work is worth thousands of, I will try it. If you don't mind I have additional questions, if you have some hints on those in form of best practice.. really welcomed: Event versioning Imagine simplified event store table (one event chain execution - no data, just example): Now I am going to change ProcessCreated event to version 2. So I will end up with: Now, I don’t want to mess the source code with any kind of versioning of classes/methods, something like ProcessFinishedHandler_V2. Instead of I would prefer to recreate the obsolete versions of events: So now I have "duplicates" (not really) of events: By leaving the store in upgraded history version: I red lot of articles here, but I can't stand :-) some classes/method versioning in my code, imagine in extreme situation you have 10 versions, so maintenance can become overkill across the domain... as I see it Event Log/Store Or on the other hand you can have message broker as is and implement Event Log as other service in ecosystem. Not sure what is the best, but interested on what do you prefer in banking domain. Request - Response Patterns in event driven design Command Queary without HTTP(REST), just message broker Do you have experience on this field, or you simply handle this via REST and that's it? Any guidelines will help. UI is not a layer, it is microservice OFFTOPIC I asked here many questions, I mean I do integrations for more than 10 years, so I am not novice in this field, but I worked on project which completely copied Netflix ways (we handled 10,000 requests per second in peaks) and it was amazing, but we did as well serious mistakes in design :-)). this project is much smaller I work on now, but I would like to make it beauty, so looking for the best ways on multiple places. |
@archenroot You have very in-depth knowledge on this topic from the questions you asked. Let me try to answer these questions and Gavin will add his points if anything is missing. Command sourcingIt is doable if you go with events without anything like REST, GraphQL or RPC. In fact, we are using these synchronous request/response interaction only for UI as you cannot ask all customers to use events. It is called command sourcing if you invoke services with messaging and on the service side, the command will be transformed to one or more events as part of the event sourcing. Take a look at this package to see how we abstract message, event and command. Also, if you want to use websocket, here are two examples. https://github.com/networknt/light-example-4j/tree/master/websocket Spring Boot performanceSpring cannot be tuned to reach the same performance with light platform as it is Java EE based and blocking. Also there are too much overhead the framework introduced so we cannot even use it. We have to build our own in-house IoC service. We had some real numbers in comparison done in a bank and those numbers convinced them to choose light instead of spring boot. Basically, one light instance with 4CPU/300MB VM will need over 100 spring boot instances on 4CPU/2GB VMs to reach the same throughput and latency in some extreme use cases. That's several hundreds time more in production provisioning. Event evolutionIt is part of the service evolution but a little bit different. I was about the write something in the document site for this. As you can see we use Kafka as message broker but not event store as events are immutable in Kafka. We use mysql database as event store so that we can always manipulate event if we want to in case the newer version of the event is not backward compatible to the older version. If event is backward compatible, then we can use Apache Avro schema in Kafka to ensure that our handlers can handle different version of the events. Event StoreI prefer database as event store and here is an article to explain the reasons. Kafka is OK to be an event store but not perfect. https://networknt.github.io/light-eventuate-4j/architecture/kafka-eventstore/ Event-Driven designThe event modeling is flexible in our case as most of the time, we are using JSON. The transactionId you are talking about is actually our sagaId. We just call each part different name but the way it works is very similar. Command Side without RESTI've answered it in the command sourcing section. UI layerI am totally agree with you. To break a monolithic application to microservices, it should be cut vertically instead of horizontally. Microservices are about business functionality(bounded context) instead technical tiers. Even with REST, GraphQL, RPC, the UI can be composed with components in React and Angular. It is a long post and I might miss some points. Please let me know if you have further question. I am looking forward to work with you and hope you could help us to improve the frameworks. |
Spring Boot performance benchmark results Event evolution Event Store One question here, is your Event Store developed as another microservice, so following other microservices general layouts, or you more look at that component as something else. Just point of view. I more tend to simply seeing it as again another uService. Event-Driven design Thanks again for your answers. Regards, Ladislav |
We are using Mysql as event store only as we are relying on mysql BinLog to send the CDC (Data Change Capture) to Kafka. If we don't use BinLog, then we have to use 2PC to ensure that sending the message and writing into event store are in the same transaction. As you know 2PC is not scaling. Other then event store in Mysql, we are using ArangoDB for portal and other query side databases as it is multi-mode(Document, Graph and KV). Of cause you can use MongoDB for query side. There is also potential to use MongoDB for event store as it has Log API that can be leverage. One of my clients had asked me to support Oracle as event store and I am looking at Gold Gate at the moment. Light-eventuate-4j and light-saga-4j are actually infrastructure service that form a service mesh to support service to service communication. |
Nice. Now, imagine. You are in the even-driven infrastructure, and you use same message broker/protocol to service inter-commm. At same time you say that events can be consumed by multiple services. (I just repeat high-level fundamentals...) This leads me to opposite/different design of event store to speed up the whole platform by possibly 30% ?: I will simply make Event Store just parallel observer capturing events and providing some infrastructure mechanisms, but not a BORDER in the event flow as it is used now. Scenario
I need really to think about this more as it doesn't create whole much new burden, but I have some security mechanisms in mind and the overall result is much faster performance as it looks like because: Such scenario will be definitely faster, don't you think? But ... :-) Now, you might ask what will happen to the system if Event Store microservice has outage, Well, probably nothing by careful design: So we have now event emited into service B, which is going to work in some method and there could happen:
CQRS work here as natural border to prevent possible race conditions, etc. (which can be anyway solved by introucing versioning/sequence in events) What do you think about this design? :-)))) It might need some brainstorming, but in the end, you reduce communication point in chain from 3 to 2!!! I think when you are interested in performance, this is something you might look into, sorry it is evening here I am laying in these architectures for whole day, so maybe I am missing some fundamental issue with this.... I count on minimal or no outages of event store service cluster, but if it fall down, error scenarios must be onsidered of course. I can also imagine, that there is Event Store monitoring service and if it will see it is down, it will generate Event Store Down event consumed by all services in large cluster which pause any kind of listeners and producers from operation :-) maybe not nice, but you prevent any kind of inconsistences at all, when it is up and running, monitor will generate EventStoreUp and all services continue -> You pause and play universe :-)) Either way, latency in inter-service communication will drop down significantly Different technologies Oracle Yes, I am just reading the service mesh document :-) thanks for pointing those 2 projects. |
Firstly, yes, service produce events (command side) and service consume events (query side) are independently in parallel; And the events process is asynchronous process which trigger by event which reached to event store. Basically, we define the event handlers in the services for certain type of aggregation for different type of purpose. And the event handlers will act as a listener to the event store. When the events come and match the aggregation type, event handler will be trigger and start to process the method. So it is doesn't matter if the event store faster or slower than the service process. And for the CQSR, it depends on how do you design the project. For example, we have event handlers for report system which can save and generate local data store based on the populated event data for report query. |
@archenroot Event store is the source of the truth and I see you are writing to it at the last step and all service accesses are not in an XA transaction. If something happens before the event store is updated, your services and event store won't be in sync. This design will only work if no network failure occurs. I may miss something though. Also, writing into event store, for example Mysql is very fast as it is append only and the event publish to Kafka with all subscribers handling it in parallel. I think this is the second fastest compare with pushing the event to Kafka directly and use Kafka as event store. |
Thank you guys for comprehensive discussion, I will now move to do some hands on work with light framework. I don't write to event store in last step I reduce 3 step flow to 2 step:
Of course failure on infrastructure could introduce unexpected situation, but I have mechanisms how to handle those... but won't bother you I am following study of physics, so to me there is no such thing like command or query in event-driven system at all, neither is anything like request-response. it is just flow of events while new events exists only as reaction on previous, no one commands or query anyone. This is the extreme application of event driven architecture applicable mostly in physics labs, so it will take time when we invent all these ideas into integration space. Thanks again for your answers and especially for your time to discuss with me some concerns. |
@archenroot flow of events is exactly how the universe works. As developer, we always trying to abstract from the natural world and model it into classes or db tables. I myself is trying to avoid it so that is why I am working on the eventuate framework. As a framework provider, we have to provide a full range of solutions. However, I am very interested in the project you are working on as it is an extreme use case which would be a good test for the framework. Let's keep in touch and let us know if you need any help. Thanks for all the questions and ideas. |
@stevehu - really nice diskussion :-), I will post how I ended up. as I said, this time I am limited by time, but I will try to follow this universe idea replication and will post some pictures where I end up. |
Hi,
I am now in need of some kind of framework to help me with implementing event store with CQRS patterns.
My natural choice was Spring technologies, second I found 2 frameworks Eventuate and Axon.
If you have minute and experience Steve, could you elaborate in few sentences where you see strengths of your solution over these, performance is not big deal in our case. In my case I also do not pickup solution which is not yet adopted in some major industrial projects, we have 3-4 months to deliver the project, so I don't have much time for experiments.
The text was updated successfully, but these errors were encountered: