Content based publish-and-subscribe system integrated in a relational database system
First Claim
1. A method for implementing a content based publish-and-subscribe system in a relational database system, the method comprising the steps of:
- receiving a query that is written in a query language supported by the relational database system from a subscriber;
storing the query in the relational database system as a subscription rule for determining whether incoming messages are to be sent to the subscriber;
after storing the query, the relational database system determining whether the incoming messages satisfy the query; and
publishing incoming messages to the subscriber when the incoming messages satisfy the query.
2 Assignments
0 Petitions
Accused Products
Abstract
A method and apparatus are provided for implementing a content based publish-and-subscribe system in a relational database system. A subscriber may request for messages by using a query language supported by the database server. The queries are then used as subscription rules for determining whether an incoming message is to be sent to the subscriber. Evaluation of incoming messages against subscription rules involves a two-tier process. The first tier involves filtering out all the subscription rules that could not possibly apply to the incoming message. The second tier involves further evaluation of the incoming message, if needed, to determine which subscribers are to receive the incoming message. In another aspect of the embodiment, in cases where the publisher is the relational database system itself, queries that request for messages are not stored as subscription rules because publication of the messages is implicit.
156 Citations
45 Claims
-
1. A method for implementing a content based publish-and-subscribe system in a relational database system, the method comprising the steps of:
-
receiving a query that is written in a query language supported by the relational database system from a subscriber;
storing the query in the relational database system as a subscription rule for determining whether incoming messages are to be sent to the subscriber;
after storing the query, the relational database system determining whether the incoming messages satisfy the query; and
publishing incoming messages to the subscriber when the incoming messages satisfy the query. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15)
receiving incoming messages from a publisher;
upon receiving the incoming messages, determining whether the incoming messages satisfy the subscription rule; and
if the incoming messages satisfy the subscription rule, then publishing the incoming messages to the subscriber.
-
-
3. The method of claim 2 wherein the step of determining whether the incoming messages satisfy the subscription rule further comprises the steps of:
-
evaluating the incoming messages against the array of rules associated with each column in an array of filters; and
determining which subscription rules in the array of rules could possibly apply to the incoming messages;
evaluating the incoming messages against the subscription rules that could possibly apply to the incoming messages and determining if further evaluation is needed for the incoming messages; and
if further evaluation is needed, then determining if a simple follow-on evaluation is needed, and if a simple follow-on evaluation is needed, then proceeding with the simple follow-on evaluation; and
determining if a complete evaluation is needed, and if a complete evaluation is needed, then proceeding with the complete evaluation.
-
-
4. The method of claim 3 wherein the complete evaluation further comprises using a query language engine of the relational database system.
-
5. The method of claim 1 wherein the step of storing the query in the relational database system as a subscription rule further comprises the steps of:
-
creating an array of filters comprising one or more columns;
determining to which column in the array of filters the subscription rule applies; and
storing the subscription rule in an array of rules that is associated with the column to which the subscription rule applies in the array of filters.
-
-
6. The method of claim 5 wherein the step of determining to which column in the array of filters the subscription rule applies further comprises the steps of:
-
parsing the query from the subscriber;
normalizing the query into a series of expressions wherein each expression comprises one or more conditions joined by conjunctive operators and wherein each expression is combined with each other expression using a disjunctive operator;
assigning each expression to one column in the array of filters; and
storing each expression as the subscription rule in the array of rules that is associated with the column to which the subscription rule applies in the array of filters.
-
-
7. The method of claim 5 further comprising the step of organizing the array of rules in an index.
-
8. The method of claim 1 further comprising the step of specifying in the subscription rule a destination and a protocol for delivering the incoming messages.
-
9. The method of claim 1 wherein the step of publishing the incoming messages further comprises the step of delivering the incoming messages to a destination specified by the subscription rule submitted by the subscriber.
-
10. The method of claim 1 wherein the step of publishing the incoming messages further comprises the step of sending notifications of the incoming messages to a notification destination specified in the subscription rule submitted by the subscriber and in addition to delivering the incoming messages to a message destination specified by the subscription rule submitted by the subscriber.
-
11. The method of claim 10 wherein the notification destination is different from the message destination.
-
12. The method of claim 1 wherein the step of publishing the incoming messages further comprises the step of delivering the incoming messages to a destination deduced from the context that resulted in the publication of the message.
-
13. The method of claim 1 wherein the step of publishing the incoming messages further comprises the step of delivering the incoming messages using a protocol specified by the subscription rule submitted by the subscriber.
-
14. The method of claim 1 wherein the step of publishing the message further comprises the steps of:
-
determining whether the subscriber qualifies to receive the incoming messages more than once; and
delivering the incoming messages only once.
-
-
15. The method of claim 1 further includes the step of publishing to the subscriber previously published messages that have not been published to the subscriber when the previously published messages satisfy the query.
-
16. A computer-readable medium carrying one or more sequences of instructions for implementing a content based publish-and-subscribe system in a relational database system, wherein execution of the one or more sequences of instructions by one or more processors causes the one or more processors to perform the steps of:
-
receiving a query that is written in a query language supported by the relational database system from a subscriber;
storing the query in the relational database system as a subscription rule for determining whether incoming messages are to be sent to the subscriber; and
publishing incoming messages to the subscriber when the incoming messages satisfy the query. - View Dependent Claims (17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30)
receiving incoming messages from a publisher;
upon receiving the incoming messages, determining whether the incoming messages satisfy the subscription rule; and
if the incoming messages satisfy the subscription rule, then publishing the incoming messages to the subscriber.
-
-
18. The computer-readable medium of claim 17 wherein the step of determining whether the incoming messages satisfy the subscription rule further comprises the steps of:
-
evaluating the incoming messages against the array of rules associated with each column in an array of filters; and
determining which subscription rules in the array of rules could possibly apply to the incoming messages;
evaluating the incoming messages against the subscription rules that could possibly apply to the incoming messages and determining if further evaluation is needed for the incoming messages; and
if further evaluation is needed, then determining if a simple follow-on evaluation is needed, and if a simple follow-on evaluation is needed, then proceeding with the simple follow-on evaluation; and
determining if a complete evaluation is needed, and if a complete evaluation is needed, then proceeding with the complete evaluation.
-
-
19. The computer-readable medium of claim 18 wherein the complete evaluation further comprises using a query language engine of the relational database system.
-
20. The computer-readable medium of claim 16 wherein the step of storing the query in the relational database system as a subscription rule further comprises the steps of:
-
creating an array of filters comprising one or more columns;
determining to which column in the array of filters the subscription rule applies; and
storing the subscription rule in an array of rules that is associated with the column to which the subscription rule applies in the array of filters.
-
-
21. The computer-readable medium of claim 20 wherein the step of determining to which column in the array of filters the subscription rule applies further comprises the steps of:
-
parsing the query from the subscriber;
normalizing the query into a series of expressions wherein each expression comprises one or more conditions joined by conjunctive operators and wherein each expression is combined with each other expression using a disjunctive operator;
assigning each expression to one column in the array of filters; and
storing each expression as the subscription rule in the array of rules that is associated with the column to which the subscription rule applies in the array of filters.
-
-
22. The computer-readable medium of claim 20 further comprising one or more additional sequences of instructions which, when executed by the one or more processors, cause the one or more processors to perform the step of organizing the array of rules in an index.
-
23. The computer-readable medium of claim 16 further comprising one or more additional sequences of instructions which, when executed by the one or more processors, cause the one or more processors to perform the step of specifying in the subscription rule a destination and a protocol for delivering the incoming messages.
-
24. The computer-readable medium of claim 16 wherein the step of publishing the incoming messages further comprises the step of delivering the incoming messages to a destination specified by the subscription rule submitted by the subscriber.
-
25. The computer-readable medium of claim 16 wherein the step of publishing the incoming messages further comprises the step of sending notifications of the incoming messages to a notification destination specified in the subscription rule submitted by the subscriber and in addition to delivering the incoming messages to a message destination specified by the subscription rule submitted by the subscriber.
-
26. The computer-readable medium of claim 25 wherein the notification destination is different from the message destination.
-
27. The computer-readable medium of claim 16 wherein the step of publishing the incoming messages further comprises the step of delivering the incoming messages to a destination deduced from the context that resulted in the publication of the message.
-
28. The computer-readable medium of claim 16 wherein the step of publishing the incoming messages further comprises the step of delivering the incoming messages using a protocol specified by the subscription rule submitted by the subscriber.
-
29. The computer-readable medium of claim 16 wherein the step of publishing the message further comprises the steps of:
-
determining whether the subscriber qualifies to receive the incoming messages more than once; and
delivering the incoming messages only once.
-
-
30. The computer-readable medium of claim 16 further includes the step of publishing to the subscriber previously published messages that have not been published to the subscriber when the previously published messages satisfy the query.
-
31. A relational database system comprising a memory that includes one or more sequences of one or more instructions which, when executed by one or more processors, cause the one or more processors to perform the steps of:
-
receiving a query that is written in a query language supported by the relational database system from a subscriber;
storing the query in the relational database system as a subscription rule for determining whether incoming messages ale to be sent to the subscriber; and
publishing incoming messages to the subscriber when the incoming messages satisfy the query. - View Dependent Claims (32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45)
receiving incoming messages from a publisher;
upon receiving the incoming messages, determining whether the incoming messages satisfy the subscription rule; and
if the incoming messages satisfy the subscription rule, then publishing the incoming messages to the subscriber.
-
-
33. The relational database system of claim 32 wherein the step of determining whether the incoming messages satisfy the subscription rule further comprises the steps of:
-
evaluating the incoming messages against the array of rules associated with each column in an array of filters; and
determining which subscription rules in the array of rules could possibly apply to the incoming messages;
evaluating the incoming messages against the subscription rules that could possibly apply to the incoming messages and determining if further evaluation is needed for the incoming messages; and
if further evaluation is needed, then determining if a simple follow-on evaluation is needed, and if a simple follow-on evaluation is needed, then proceeding with the simple follow-on evaluation; and
determining if a complete evaluation is needed, and if a complete evaluation is needed, then proceeding with the complete evaluation.
-
-
34. The relational database system of claim 33 wherein the complete evaluation further comprises using a query language engine of the relational database system.
-
35. The relational database system of claim 31 wherein the step of storing the query in the relational database system as a subscription rule further comprises the steps of:
-
creating an array of filters comprising one or more columns;
determining to which column it the array of filters the subscription rule applies; and
storing the subscription rule in an array of rules that is associated with the column to which the subscription rule applies in the array of filters.
-
-
36. The relational database system of claim 35 wherein the step of determining to which column in the array of filters the subscription rule applies further comprises the steps of:
-
parsing the query from the subscriber;
normalizing the query into a series of expressions wherein each expression comprises one or more conditions joined by conjunctive operators and wherein each expression is combined with each other expression using a disjunctive operator;
assigning each expression to one column in the array of filters; and
storing each expression as the subscription rule in the array of rules that is associated with the column to which the subscription rule applies in the array of filters.
-
-
37. The relational database system of claim 35 further comprising one or more additional sequences of instructions which, when executed by the one or more processors, cause the one or more processors to perform the step of organizing the array of rules in an index.
-
38. The relational database system of claim 31 further comprising one or more additional sequences of instructions which, when executed by the one or more processors, cause the one or more processors to perform the step of specifying in the subscription rule a destination and a protocol for delivering the incoming messages.
-
39. The relational database system of claim 31 wherein the step of publishing the incoming messages further comprises the step of delivering the incoming messages to a destination specified by the subscription rule submitted by the subscriber.
-
40. The relational database system of claim 31 wherein the step of publishing the incoming messages further comprises the step of sending notifications of the incoming messages to a notification destination specified in the subscription rule submitted by the subscriber and in addition to delivering the incoming messages to a message destination specified by the subscription rule submitted by the subscriber.
-
41. The relational database system of claim 40 wherein the notification destination is different from the message destination.
-
42. The relational database system of claim 31 wherein the step of publishing the incoming messages further comprises the step of delivering the incoming messages to a destination deduced from the context that resulted in the publication of the message.
-
43. The relational database system of claim 31 wherein the step of publishing the incoming messages further comprises the step of delivering the incoming messages using a protocol specified by the subscription rule submitted by the subscriber.
-
44. The relational database system of claim 31 wherein the step of publishing the message further comprises the steps of:
-
determining whether the subscriber qualifies to receive the incoming messages more than once; and
delivering the incoming messages only once.
-
-
45. The relational database system of claim 31 further includes the step of publishing to the subscriber previously published messages that have not been published to the subscriber when the previously published messages satisfy the query.
Specification