Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Rulette : A pragmatic business rule management library

This talk was given at the first Grofers tech meet up in Bangalore on 20 April, 2019. I talk about the whys of Rulette and use some case studies to demonstrate how Rulette can be used effectively to model and apply business rules.

  • Login to see the comments

  • Be the first to like this

Rulette : A pragmatic business rule management library

  1. 1. Rulette Pragmatic business rule management
  2. 2. Me... Kislay Verma Bangalore, India 12 years of code @ Uber | Myntra | D.E. Shaw
  3. 3. What are business rules?
  4. 4. Jargon Rule : IF order status=”cancelled” AND refunded=”false”, THEN action=”doRefund”. Rule Input : “order status”, “refunded” in the above example. Rule Output : “action” in the above example.
  5. 5. Jargon Rule : Mapping of “n” rule inputs to 1 output Rule System : System with ability to manage rules and evaluate them against an input.
  6. 6. Jargon
  7. 7. Business Rules in Excel-speak
  8. 8. Rule Engines
  9. 9. Problems with Drools 1. Cognitive Modelling Mismatch 2. Too much flexibility at the cost of expression 3. No data types 4. How to handle “Any”/”Others”? 5. Large set-up
  10. 10. Enter Rulette... 1. Talks the same language as your business 2. Works out-of-the-box 3. Rule management and evaluation 4. Lightweight with minimal boilerplate 5. Completely extensible with custom data types and data sources
  11. 11. When not to use Rulette 1. Rules go beyond “equals”, “less than”, and “greater than”. 2. The output logic is complicated - genuine ad-hocness. 3. Maintaining a set-up is not a problem.
  12. 12. Rulette Components
  13. 13. Rulette : Core Entities Rule System a. Id b. Name c. Table name d. Output column name e. Input column name
  14. 14. Rulette : Core Entities Rule Input a. Rule system id b. Name c. Rule Input Type d. Rule Input Data Type e. Priority f. Low threshold column name g. High Threshold column name
  15. 15. Rulette : Consistency Semantics 1. Rule Input Data Types : Number, Date, String 2. Rule Input Input Types : Value, Range 3. Value inputs can’t all be equal for 2 rules. 4. Ranges can’t overlap partially, one should completely contain another 5. Output : Always String, interpret however you want
  16. 16. Rulette : Stitching things
  17. 17. Case Studies
  18. 18. Modelling GST (Taxes)
  19. 19. Core Entities
  20. 20. Core Entities
  21. 21. Setting up the rules
  22. 22. Modelling Discounts
  23. 23. What next? 1. Support for databases other than MySql. 2. Clustering Support for In-Memory Rulette. 3. Evolving Rulette REST server. 4. Admin UI.
  24. 24. Reference 1. Github - https://github.com/kislayverma/Rulette/wiki 2. Javadoc - https://github.com/kislayverma/Rulette/wiki/Javadoc

×