Introduction
# 🎉Overview
In modern software development, as businesses continue to expand and become more complex, the volume of code and the degree of coupling also increase. This growth leads to difficulties in maintenance and expansion, a chaotic hierarchy, challenges in reusing common code between systems, and a lack of efficient system interoperability. Especially in certain business scenarios, due to highly customized and frequently changing requirements, development teams need to continuously modify code and restart systems, which not only affects development efficiency but also reduces user experience.
Furthermore, with the development of AI technology, large models have become a new trend on the internet. These large models need to be effectively and accurately linked with many existing systems, which requires a flexible DSL (Domain-Specific Language) to achieve this linkage.
To address these issues, the RuleGo (opens new window) project was born. As a new generation rule engine, RuleGo is a highly modular rule engine that provides the ability to decouple and orchestrate logic, helping developers better manage and expand business logic. Its configuration-driven design allows developers to implement business logic through configuration rather than coding, thereby reducing the complexity and maintenance cost of code. In addition, RuleGo offers an extremely extensible component ecosystem, greatly lowering the barriers to component sharing and application integration.
# 🏆Advantages
- RuleGo is a lightweight, high-performance, embedded, orchestrable component-based rule engine based on Go language. It can help you quickly build low-coupling, flexible systems and implement complex business logic.
- RuleGo is a non-invasive framework, you can embed it into your existing project, seamlessly use its features, or run it as an independent orchestrable rule engine service.
- RuleGo also supports dynamic loading of components and extension components, allowing you to modify and optimize your business processes at any time, achieving rapid iteration and response to change.
- RuleGo also provides a large number of reusable components, supporting data aggregation, filtering, distribution, conversion, enrichment and execution of various actions, and can also link and integrate with various protocols and systems. Let you take a step ahead to achieve automation marketing, Internet of Things, application integration and other solutions.
You only need to use a simple configuration and orchestration method, without learning any rule language or DSL, you can use the rich components provided by RuleGo to achieve the functions you want.
In addition, RuleGo provides a convenient custom component interface, you can encapsulate business logic into reusable components, and leave the rest to RuleGo, it can build a high-efficiency, maintainable, and scalable system for you.
Compared with traditional rule engines, RuleGo adopts a new rule engine mode, which is a component-based rule engine based on rule chain orchestration. It has the following characteristics:
- Simplicity: Use JSON to configure the rule chain, no need to use any special rule language or DSL, just use common data structures and syntax, you can easily define and modify the rule chain.
- Efficiency: Use a directed acyclic graph to represent the rule chain, each input message only needs to be processed along the path in the graph, no need to match all the rules, which greatly improves the efficiency and speed of message processing, and also saves resources and time.
- Flexibility: Support dynamic configuration and modification of rule chains, without restarting the application or reloading the rules, you can update and apply the rule chains in real time, which is very suitable for rapid change and iteration of business.
# 🚀Features
- Lightweight: No external middleware dependencies, it can sink to the edge server, implement the Internet of Things edge computing solution, or deploy on the cloud as a rule engine service.
- High performance: Thanks to the high-performance characteristics of
Go
, and the use of technologies such as coroutine pool and object pool. - Dual Mode: Embedded and Standalone Deployment modes. Supports embedding
RuleGo
into existing applications. It can also be deployed independently as middleware, providing rule engine and orchestration services. - Componentized: All business logic are components, and can be flexibly configured and reused. You can also encapsulate your business into
RuleGo
components, and then build blocks to achieve your highly variable business needs. - Rule chain: You can flexibly combine and reuse different components to achieve highly customized and extensible business processes.
- Process orchestration: Support dynamic orchestration of rule chain components, without restarting the application, replace or add business logic.
- Easy to extend: Provide rich and flexible extension interfaces, which can easily implement custom components or introduce third-party components.
- Dynamic loading: Support dynamic loading of components and extension components through
Go plugin
. - Rule chain nesting: Support sub-rule chain nesting, achieve process reuse.
- Built-in a large number of components:
Message type routing
,Script routing
,Script filter
,Script converter
,HTTP push
,MQTT push
,Send email
,Log record
,Database operation
and other components. You can also extend custom components by yourself. - Context isolation mechanism: Reliable context isolation mechanism, no need to worry about data cross-flow in high-concurrency situations.
- AOP: Allows adding extra behavior to the execution of the rule chain, or directly replacing the original rule chain or node logic, without modifying the original logic of the rule chain or node.
# 🪁Architecture diagram
RuleGo architecture diagram
RuleGo processes the input message/event according to the rule chain definition , the rule chain orchestration engine drives the rule chain components to complete various businesses, such as: message routing, message processing, message enhancement, message distribution, execution actions/business, or linkage with third-party systems. The rule chain definition supports hot update , dynamically replacing the business logic of each component.
The rule chain processing message/event flow chart is as follows:
Rule chain flow chart
# 🎈Code hosting
# 🧸Participate in contribution
We look forward to your PR!
- Contribute code: Code Repository RuleGo (opens new window) , welcome to submit Issue or Pull Requests
- Maintain documentation: Documentation Repository RuleGo-Doc (opens new window) , welcome to participate in translation and revision