Ans : Let me describe the architectures for drools and web applications. The integration architecture can be defined in two main categories a) Drools as embedded in the web application.
Drools can be implemented as an internal component in the web application.The entire initialization of the rule engine is done from the web application and hence it runs within the same JVM as the web application.So the rule engine is active till the JVM is active.If we stop the JVM then rule engine will also stop.So they are tightly coupled with each other and it has its own disadvantages.
b) Drools as stand alone service interacting with the web application.
Drools can be used as a stand alone component (using Drools server). In this situation web application interacts with the drools server to get service from it. Here the components are loosely coupled and hence runs independently.If the JVM stops, it only stops the web application but the rule engine server is still ON to serve.The biggest advantage is the same rule engine server can serve many web applications (clients).This type of architecture supports scalability and future growth of the application.The main advantages of this architecture are
ii) Loosely coupled
So the conclusion is, it is better to use Drools as a stand alone service when we want to make a good application architecture with future growth prospect. And for small applications which will not grow, the embedded architecture can be used. The embedded architecture is useful when we do POC (proof of concept) or we need some quick solution.