Introducing Arishem: A Lightweight and High-Performance DSL Rule Engine
Arishem is an innovative DSL rule engine developed by the customer service platform architecture team at ByteDance. This cutting-edge tool is designed to improve the efficiency of business decision-making processes by separating frequently changing business logic from application code. It enables users to flexibly create business rules through a visual interface, significantly speeding up response time to business demands.
Key Features of Arishem
-
DSL Syntax Compatible with JSON: Arishem defines its rule syntax using a format that is fully compatible with JSON. This compatibility extends to IDL languages like Thrift and Protocol Buffers. This means that Arishem not only caters to non-programmers by providing an intuitive, visual rule configuration interface but also integrates seamlessly in various technical settings.
-
Efficient Execution: The engine has been performance-optimized through internal use of AST parsing and rule execution refinements, allowing even complex rule executions to complete within microsecond-level timeframes. Benchmark tests show that a single complex rule usually executes in less than 30 microseconds, showcasing its incredible speed.
-
Customization and Parallel Execution: Users can benefit from customizable rule execution order and granular concurrency levels. Arishem supports concurrent fetching of runtime data and predictions, enhancing its adaptability and efficiency in dynamic data environments.
-
Rich Operator and Built-in Functionality: Arishem comes with an array of operators and built-in functions that cover common operations including string and array manipulations, ensuring comprehensive rule capabilities out of the box.
Example of Arishem in Action
For instance, Arishem's powerful capabilities allow users to create rules like checking if a user's age is greater than a certain value using straightforward JSON-compatible syntax. This flexibility is built into the system, enabling expressions to be both simple and advanced based on the desired outcome.
Getting Started
To begin using Arishem, developers should install version 1.0.9 or above via Go modules. Initialization with Arishem’s default configuration is required, usually done in the application’s initialization method. This ensures that the engine functions optimally from the start.
Advanced Features
Arishem offers impressive customizability in rule priority and execution order, supporting both prioritized and non-prioritized rules (and combinations thereof). Furthermore, users can leverage custom configurations and callback options to monitor execution processes, enhancing troubleshooting and error handling capabilities.
The engine also supports network data through concurrent feature fetching, offering a flexible way to incorporate real-time data into rule evaluations.
License and Feedback
Arishem is released under the Apache License 2.0, and ByteDance welcomes feedback and issue reporting from the community to help refine and enhance the tool.
This introduction highlights how Arishem stands out as a robust, fast, and user-friendly solution for rule-based business logic assessments, appealing to both technical and business-oriented users.