Difference between Drools engine and Database

Programming and Maths :

I was going through Drools documentation and found it is not doing anything interesting / solving any problems (May be I'm wrong).

In drools we specify the business rules (in .drl file) as, for example,

  when "type = jewellery" then setDiscount(25%)
  when "type = KidDress" then setDiscount(30%) 
  1. What is the difference between the above vs using database?

  2. I can ALWAYS expose custom API's from which business rules can be specified and I can directly store it in RDBMS. Formally if required, I can build a sample UI (in 1-2 days) which integrates with exposed APIs. This will also allow business people's to easily add/update/delete rules If I expose CRUD operations.

For something as simple as I explained, what problem is Drools solving? I cannot find in any documentation from g-search / in official documentation.

Can someone help here?

Karol Dowbecki :

The two main points:

  1. In theory Drools rules are written in a way that can be easier to understood by non-technical people like business analysts.

  2. If decision logic is stored in one place e.g. as a Decision Table it might be easier to manage. This is sometimes handy if you have a more complex calculation with a lot of variables like credit check criteria.

In practice in all the projects that I worked on with Drools the developers had to write custom functions that were called from DRL file to handle more complex logic. This negated above benefits and made the solution significantly harder to manage because logic was shared between normal code and DRL files.

I had bad experience when Drools and similar tools. I'd not recommend for simple use-cases.

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=378608&siteId=1