TL;DR
This paper introduces XChange, a novel language for programming reactive behavior on the web. XChange allows developers to define complex event queries that can detect and react to intricate situations occurring across distributed web resources, moving beyond simple event detection to handle real-world scenarios.
What Problem Does This Paper Address?
The web is becoming increasingly dynamic, with services and resources constantly updating. To effectively leverage this dynamism, systems need to be "reactive" – capable of automatically responding to events. Existing approaches for web reactivity often fall short, struggling to detect and react to complex, real-life situations that involve multiple, potentially time-related events. For instance, a travel organizer needs to react not just to a single flight delay, but to a combination of events like a flight delay followed by a hotel cancellation, or a series of events occurring within a specific timeframe. This paper addresses the challenge of expressing and detecting such "composite events" in a distributed web environment, where a central clock and management are absent.
Methods
XChange tackles this problem by introducing a high-level language that builds upon the web query language Xcerpt. The core innovation lies in its composite event queries, which allow for the specification of complex temporal relationships and logical combinations of events. Key methodological aspects include:
- Event Model: XChange distinguishes between atomic events (single occurrences like updates or explicit messages) and composite events (combinations of atomic events). Events are treated as volatile data, akin to speech, which cannot be modified once occurred, contrasting with persistent web data (written text).
- Composite Event Query Constructs: The language provides a rich set of constructs for defining composite events:
- Temporal Range: Events can be filtered based on time intervals (e.g.,
within TimeInterval,before TimePoint). - Non-Temporal Composition: Logical
AND(unordered conjunction) andOR(inclusive disjunction) operators combine event queries. - Temporal Composition: Constructs like
andthen(ordered conjunction),overlap,meets, andincludedefine temporal relationships between events. - Event Exclusions: The
withoutconstruct allows specifying that a composite event should not occur if another event happens within a certain timeframe. - Multiple Selections/Exclusions:
m of {EQ1, ..., EQn}allows specifying that m out of n event queries must occur, with optional non-occurrence of others. - Branching:
if-then-elseandcaseconstructs enable conditional execution based on event occurrences. - Quantifications:
n times,atleast n times,atmost n times, andlastallow specifying event occurrences based on counts and ranks. - Peer-to-Peer Communication: XChange uses a peer-to-peer model for event message exchange, avoiding a central point of failure.
- Local Event Managers: Each XChange-aware web site has a local event manager that incrementally processes incoming events and evaluates event queries.
- XML-based Event Representation: Events are represented as XML documents, allowing for nested structures and rich pattern matching.
Datasets
Not discussed in the paper. The paper focuses on the language design and its capabilities rather than empirical evaluation on specific datasets.
Key Insights and Ideas
- Events as First-Class Citizens: Treating events as XML documents with potentially complex structures is a significant departure, enabling richer pattern matching than simple event types.
- Speech vs. Written Text Metaphor: The analogy of events as "speech" (volatile, unmodifiable) and web content as "written text" (persistent, updatable) provides a clear conceptual framework for understanding reactivity and data management.
- Distributed Reactivity: The emphasis on a peer-to-peer model and local event managers is crucial for building reactive systems on the inherently distributed and decentralized web.
- Expressiveness of Temporal Composition: The range of temporal operators (
andthen,overlap,meets,include) allows for sophisticated modeling of real-world event sequences and interactions. - Integration with Query Languages: Embedding a web query language like Xcerpt within XChange is a pragmatic approach, allowing reactive rules to seamlessly query persistent web data.
Key Results
The paper's primary contribution is the design and specification of the XChange language, particularly its novel constructs for defining and detecting composite events. While no quantitative results are presented, the paper demonstrates the language's expressiveness through numerous examples illustrating how complex real-world scenarios can be modeled. The key qualitative result is the provision of a powerful and flexible language for building reactive web applications that can handle intricate event patterns.
Limitations and Future Work
- Processing Semantics: The paper mentions that the semantics of rule execution are not discussed due to space limitations.
- Time Granularity: Investigating different time granularities (beyond time points, e.g., "week") for temporal ordering is an ongoing area of research.
- Security Functionalities: Extending XChange with security features like authentication and authorization is a promising direction, potentially leveraging Grid architecture protocols.
- Consistency and Durability: While XChange transactions aim for atomicity and isolation, consistency and durability are not yet fully investigated and are expected to build on standard database solutions.
- Integration with CaTTS: Combining XChange with the calendar and temporal type system CaTTS for more flexible date and time specifications is planned.
Summary updated