Developing OQGRAPH, a tool for graph based traversal of SQL data in MariaDB [linux.conf.au 2014]

Опубликовано: 23 Октябрь 2024
на канале: Konstantin Bläsi
1,104
10

The 'Social Graph' may have been popularised by Facebook, however graphs are a powerful tool for analysing many relationships. The use of computers to analyze and manipulate complex relationships extends into many fields: a family tree is a graph; a GPS map is a graph.
The most interesting information is data often stored in a relational database, such as MariaDB/MySQL. Customer records, bug reports, sports results. And SQL is generally not very good at analysing data and extracting graph data.
The OQGRAPH engine is a computation engine allowing hierarchies and more complex graph structures to be handled in a relational fashion. In a nutshell, tree structures and friend-of-a-friend style searches can now be done using standard SQL syntax, and results joined onto other tables. No SQL syntax extensions are necessary; OQGRAPH is implemented as a clean engine plugin for MariaDB 5.2 and above, loadable at runtime, and access data stored in a standard table.
After introducing some simple examples, in this talk I will show how OQGRAPH is implemented utilising the Mysql/MariaDB storage engine interface (usually used for providing difference persistence methods) and how graph traversal is implemented with the open source C++ Boost Graph Library. I will take a quick look at MTR, the automated test/regression suite accompanying MariaDB, and how this is used to verify the results of OQGRAPH; and briefly provide a few pointers on how to effectively debug storage engine code using gdb when you can't simply do a 'bre main'

Andrew McDonnell

Andrew McDonnell is a successful software engineer, having grown up hacking code since receiving his first Commodore 64 at age 12. He has significant experience programming in C++, Java and Python and a multitude of scripting languages, applying both traditional and agile methods. Outside of family and work he sometimes has time to play with his collection of 8-bit and PC/XT-vintage computers; computing and electronics has always been his passion. He intermittently maintains a blog at http://blog.oldcomputerjunk.net sometimes posting how he solved a problem in the hope it may be useful to someone else.

https://lca2014.linux.org.au/wiki/ind...