Using Drools to perform an Action based on Events
===

I wanted to use drools for one of our projects - Online Buying and Selling.

Events are like Buying a book, Buying a pen, Buying a kindle.
These events are stored in a database.

Now, based on the events happened before, I want to decide the consequence.

Like say if a person had the following sequence,

    1. Buy a book at a price.
    2. Sell the same book at a higher price.
Then 

    Do something based on that.

If someone has done this,

    1. Buy a kindle.
    2. Purchase a book in Science Section of books.
Then 

    show him the relevant content in the UI.

I have all the listed things as Events in the database.
Now I have written an interface for the Actions to be done and I have also done the interface to pass a Customer when an event happens.

Now what would give me the best performance to process the events and make a decision based on the sequence of events. I cannot store all the events in memory for sure as I have a whole lot of those. 


