We have ads and alerts, we are supposed to find matching alerts when a new ad is posted and notify them of the ad posted.
One way is
Convert alert to a query and store it in the percolator.
When a new ad is posted identify which alerts to be notified.
Store all the alerts in a index.
When a new ad is posted convert ad into a query which can be executed
on the alerts index and fetch the matching alerts.
Which is the better way and why ?