![mysql enterprise rules mysql enterprise rules](https://1.bp.blogspot.com/-Q61EqNCiYr0/YTGx9yLQIWI/AAAAAAAAId8/Vyi8bS_XR_YaW4W8XpIPP5v43UFEW7g0QCNcBGAsYHQ/s899/deploy-cloud-native-apps.png)
![mysql enterprise rules mysql enterprise rules](http://www.clusterdb.com/wp-content/uploads/2010/05/Cluster_MEM_rule.jpg)
As long as they're sandboxed and organized properly, and hide behind a generalized and consistent interface, then they work just fine.Īt my company, it depends on the scale of the rules and how often they change as to what we go with. A database rules engine, in my experience, is sub-optimal in comparison often to even simply just making, say, Java based rules. Where I work, being right and being productive is more important than being fast in execution, so we go with the Excel/web service.Īnd to expand on slavik262's comment, what you really want to achieve with rules engines, ultimately, is abstraction and generalization, to minimize moving parts and increase reliability, testability, and understandability. What I'm getting at though is that make sure you're making the right trade offs in terms of usability/expressiveness/testability/performance. And it's not the only possible solution here. Now of course, as you can imagine, a web service driven Excel rules engine isn't going to fit every situation.
#Mysql enterprise rules code#
You can color code and add all sorts of other visual cues to Excel to make error conditions, etc, really stand out.A database is less (much less) expressive compared to Excel.Logic in the database is harder to test and develop for compared to Excel, because Excel provides instant feedback.Ĭontrast storing the logic in a database versus, say, an Excel spreadsheet: We use this for automation (to handle variable logic based on effective date, etc), and we also compile rather complex insurance rating logic to Perl scripts interfaced via a web service, using this product. At the very least, use a language that's already proven (Python, javscript, etc) and embed that in there.Įven better- if the rules are sufficiently complex, I personally prefer to employ Excel spreadsheets. One of the big mistakes I've seen happen is attempting to write your own ad-hoc rules language and using that to drive conditional logic via the database. Having dealt with rules engines in various forms, including database driven, I can tell you it can get really frustrating and unproductive, really quickly. I think what needs to be done first is question whether or not you should be putting the rules in a database to begin with.ĭatabases are a heavy handed solution, and are often simply not needed. INSERT INTO unary (operator_statement_id, operand_statement_id1, operand_statement_id2) VALUES (6, 5, 4) INSERT INTO operator (statement_id, type) VALUES (6, 'sum')
![mysql enterprise rules mysql enterprise rules](https://www.oracle.com/a/ocom/img/social-og-mysql-logo-1200x1200.jpg)
INSERT INTO statement (statement_id) VALUES (6) INSERT INTO operand (statement_id, type) VALUES (5, 'double') INSERT INTO statement (statement_id) VALUES (5) INSERT INTO unary (operator_statement_id, operand_statement_id1, operand_statement_id2) VALUES (4, 3, 2) INSERT INTO operator (statement_id, type) VALUES (4, 'multiply') INSERT INTO statement (statement_id) VALUES (4) INSERT INTO operand (statement_id, type) VALUES (3, 'double') INSERT INTO statement (statement_id) VALUES (3) INSERT INTO binary (operator_statement_id, operand_statement_id) VALUES (2, 1) INSERT INTO operator (statement_id, type) VALUES (2, 'minus') INSERT INTO statement (statement_id) VALUES (2) INSERT INTO operand (statement_id, type) VALUES (1, 'double') INSERT INTO statement (statement_id) VALUES (1) Once you have a database structure to store/reload your object to/from, you can simply create your classes such that each object is responsible to load/store itself.įor instance if you want to store the statement a + b * -c into database, it could be translated as the following inserts: - c Then it's time to convert it into an ERD: The procedure will be as follow: First the class diagram You will be evaluating the rules in a programming language after all. The general way to design a database to store complex data like this is to design the way you would keep them in memory as objects and then try and design the database accordingly.
![mysql enterprise rules mysql enterprise rules](https://sematext.com/wp-content/uploads/2020/11/mysql-monitoring-post-image-2.png)