3 research outputs found
Βελτιστοποίηση Ροής Σχεσιακών Επερωτήσεων κατά το Χρόνο Εκτέλεσης
Στα πλαίσια αυτής της διπλωματικής εργασίας, έχουμε αναπτύξει μία βιβλιοθήκη σε
Java που επιτρέπει αποδοτικούς συνδυασμούς δύο ή περισσότερων επερωτήσεων σε
μία, η οποία υποβάλλεται εναλλακτικά στη βάση δεδομένων. Ουσιαστικά αυτή η
βιβλιοθήκη λειτουργεί σαν ένας wrapper γύρω από την εκάστοτε JDBC βιβλιοθήκη
του κατασκευαστή της σχεσιακής βάσης δεδομένων. Η βιβλιοθήκη αυτή λειτουργεί σε
δύο καταστάσεις. Στην πρώτη φάση, λειτουργεί σε κατάσταση "εκπαίδευσης", δηλαδή
παρατηρεί τις αρχικές επερωτήσεις και τις καταγράφει μαζί με επιπρόσθετη μετά-
ληροφορία σε ένα n-ary δένδρο, το οποίο ονομάζουμε "context tree". Η πρώτη
φάση, κατά προσέγγιση αντιπροσωπεύει το 10\% του συνολικού χρόνου της
λειτουργίας της επιχειρησιακής εφαρμογής. Μετά το τέλος της πρώτης φάσης, αυτή
η βιβλιοθήκη αποφασίζει ποιες αρχικές επερωτήσεις μπορούν και αξίζει (με
κριτήριο τη μείωση της καθυστέρησης) να συνδυαστούν μεταξύ τους. Στη δεύτερη
φάση που ονομάζεται κατάσταση "κανονικής" λειτουργίας και που συνήθως είναι το
90\% του χρόνου, αυτή η βιβλιοθήκη χρησιμοποιεί τις εναλλακτικές, συνδυαστικές
επερωτήσεις που παρήγαγε η προηγούμενη φάση για να
τις υποβάλλει στη βάση δεδομένων στη θέση των αρχικών απλών επερωτήσεων. Η
επανεγγραφή πραγματοποιείται στον αέρα καθώς το σύστημα είναι σε κανονική
λειτουργία. Παρόλο, που οι παραγόμενες επερωτήσεις είναι πιο πολύπλοκες,
αποκαλύπτουν στον επεξεργαστή επερωτήσεων της σχεσιακής βάσης δεδομένων
περισσότερες ευκαιρίες για βελτιστοποίηση. Διαφορετικά αυτές οι
βελτιστοποιήσεις θα παρέμεναν κρυμμένες και ανευκμετάλλευτες μέσα στην
εφαρμογή. Επιπλέον, έχουμε αναπτύξει ένα μοντέλο για τη κοστολόγηση όλων των
προτεινόμενων τεχνικών επανεγγραφής που μας επιτρέπει να τις συγκρίνουμε
μεταξύ τους και να λαμβάνουμε υπόψιν συστημικές παραμέτρους, όπως τη μέση
καθυστέρηση του δικτύου. Η διαδικασία της κοστολόγησης των διαθέσιμων
εναλλακτικών και της επιλογής του βέλτιστου σχήματος για την επανεγγραφή μίας
ροής επερωτήσεων, πραγματοποιείται μετά το πέρας της "εκπαιδευτικής" φάσης και
πριν την έναρξη της "κανονικής" λειτουργίας. Τέλος, εφαρμόσαμε μία εκτεταμένη
σειρά από ελέγχους απόδοσης, ώστε να καταγράψουμε τις βελτιώσεις στο πρόβλημα
της δικτυακής καθυστέρησης, που γίνεται αντιληπτή στον τελικό χρήστη. Όλες οι
εναλλακτικές στρατηγικές επανεγγραφής αποδείχθηκαν πιο αποδοτικές από το αρχικό
σχήμα επερωτήσεων από 2 έως και 4 φορές! Παρόλαυτά, οι προτεινόμενες
στρατηγικές δεν είναι σε όλες τις περιπτώσεις πιο αποδοτικές. Διαπιστώσαμε,
ότι σε ορισμένα δίκτυα που η μέση καθυστέρηση του δικτύου είναι πολύ μικρή, οι
εναλλακτικές επερωτήσεις μπορούν να είναι πιο αργές από τις αρχικές! Αυτή η
διαπίστωση μαζί με πλήθος άλλωνσυμπερασμάτων παρατίθενται και ερμηνεύονται
αναλυτικά στο αντίστοιχο κεφάλαιο των πειραματικών ελέγχων.Current multi user applications submit streams of relational queries against a
back end database server. For many years the research community has focused its
attention in developing sophisticated storage engines, more efficient query
processors, scalable clustering systems, in main memory key-value caching
servers that would alleviate any throughput bottlenecks and could allow for
more concurrency. Query streams initiated by individual users have received some
attention in the form of result set caching. However, unless the same query is
resubmitted, this remedy has not proved very efficient on minimizing the
latency perceived by the end user. In addition, improvements in network latency
have lagged developments in bandwidth usage. In this thesis, we attempt to
tackle the latency experienced by the end users, which in contrary to the
throughput remains a big issue and there does not seem that any networking
hardware improvements will alleviate it in the future. We have studied a
specific pattern of query streams that is quite often found in most
applications and is
characterized by a number of query correlations and deep nesting. We verified
that these two factors result in excessive numbers of round-trips, which could
be avoided with either manual rewriting of the queries or whith some form of
runtime rewritings on the fly. Although, the manual rewriting of these
applications could result in much more efficient queries, it is not recommended
as it is not always clear for which system configuration or application
instance we should optimize. Furthermore, good sofware engineering practices
promote code modularity and encapsulation, with more simple queries. We have
developed a prototype software library, which allows for run time optimization
of these query streams. We have implemented a number of alternative query
rewritings that are applied during run time and essentially submit at the back
end RDBMS a combined query. This combined query although more complex, reveals
to the RDBMS query processor more scope for optimization, which otherwise would
have remained hidden within the client application code. In addition, we
developed an analytic cost model that allows us to compare different
alternatives and at the same time take into account any critical system
properties like network communication latency. We performed comprehensive
benchmarking so as to measure any improvements, on the total latency, seen by
the end user. Finally, we present experimental results where all the
alternative strategies outperform the orignal queries by 2 to 4 times
State Management for Efficient Event Pattern Detection
Event Stream Processing (ESP) Systeme überwachen kontinuierliche Datenströme, um benutzerdefinierte Queries auszuwerten. Die Herausforderung besteht darin, dass die Queryverarbeitung zustandsbehaftet ist und die Anzahl von Teilübereinstimmungen mit der Größe der verarbeiteten Events exponentiell anwächst.
Die Dynamik von Streams und die Notwendigkeit, entfernte Daten zu integrieren, erschweren die Zustandsverwaltung. Erstens liefern heterogene Eventquellen Streams mit unvorhersehbaren Eingaberaten und Queryselektivitäten. Während Spitzenzeiten ist eine erschöpfende Verarbeitung unmöglich, und die Systeme müssen auf eine Best-Effort-Verarbeitung zurückgreifen. Zweitens erfordern Queries möglicherweise externe Daten, um ein bestimmtes Event für eine Query auszuwählen. Solche Abhängigkeiten sind problematisch: Das Abrufen der Daten unterbricht die Stream-Verarbeitung. Ohne eine Eventauswahl auf Grundlage externer Daten wird das Wachstum von Teilübereinstimmungen verstärkt.
In dieser Dissertation stelle ich Strategien für optimiertes Zustandsmanagement von ESP Systemen vor. Zuerst ermögliche ich eine Best-Effort-Verarbeitung mittels Load Shedding. Dabei werden sowohl Eingabeeevents als auch Teilübereinstimmungen systematisch verworfen, um eine Latenzschwelle mit minimalem Qualitätsverlust zu garantieren. Zweitens integriere ich externe Daten, indem ich das Abrufen dieser von der Verwendung in der Queryverarbeitung entkoppele. Mit einem effizienten Caching-Mechanismus vermeide ich Unterbrechungen durch Übertragungslatenzen. Dazu werden externe Daten basierend auf ihrer erwarteten Verwendung vorab abgerufen und mittels Lazy Evaluation bei der Eventauswahl berücksichtigt. Dabei wird ein Kostenmodell verwendet, um zu bestimmen, wann welche externen Daten abgerufen und wie lange sie im Cache aufbewahrt werden sollen. Ich habe die Effektivität und Effizienz der vorgeschlagenen Strategien anhand von synthetischen und realen Daten ausgewertet und unter Beweis gestellt.Event stream processing systems continuously evaluate queries over event streams to detect user-specified patterns with low latency. However, the challenge is that query processing is stateful and it maintains partial matches that grow exponentially in the size of processed events.
State management is complicated by the dynamicity of streams and the need to integrate remote data. First, heterogeneous event sources yield dynamic streams with unpredictable input rates, data distributions, and query selectivities. During peak times, exhaustive processing is unreasonable, and systems shall resort to best-effort processing. Second, queries may require remote data to select a specific event for a pattern. Such dependencies are problematic: Fetching the remote data interrupts the stream processing. Yet, without event selection based on remote data, the growth of partial matches is amplified.
In this dissertation, I present strategies for optimised state management in event pattern detection. First, I enable best-effort processing with load shedding that discards both input events and partial matches. I carefully select the shedding elements to satisfy a latency bound while striving for a minimal loss in result quality. Second, to efficiently integrate remote data, I decouple the fetching of remote data from its use in query evaluation by a caching mechanism. To this end, I hide the transmission latency by prefetching remote data based on anticipated use and by lazy evaluation that postpones the event selection based on remote data to avoid interruptions. A cost model is used to determine when to fetch which remote data items and how long to keep them in the cache.
I evaluated the above techniques with queries over synthetic and real-world data. I show that the load shedding technique significantly improves the recall of pattern detection over baseline approaches, while the technique for remote data integration significantly reduces the pattern detection latency