Oracle’s PGX (Property Graph analytiX) is an in-memory representation of Oracle Property Graph data. Analytics against the data are parallelized and as such can be extremely fast (especially compared to typical database queries). Such powerful analytics are ideal for recommendations or real-time accept/reject financial transactions for example. A list of the built-in analytics can be found at: https://docs.oracle.com/cd/E56133_01/latest/reference/algorithms/index.html.
This blog focuses on how to leverage Oracle PGX’s in-memory parallel analytics in a live production environment where there are frequent updates to the graph data.
There are a couple of assumptions/requirements we need to get out of the way first:
Note: This pattern won’t work with non-RDBMS storage.
Now that we have that out of the way let’s look at a typical flow involved in updating a graph store and its associated in-memory copy:
Load your graph store into PGX
see: https://docs.oracle.com/cd/E56133_01/2.4.1/reference/api/load-graphs.html
Enable Auto Refresh with Delta Update parameter in property-graph/pgx/conf/pgx.conf:
{ … “allow_user_auto_refresh”: true … }
Configure each of your PGX instance’s Auto Refresh Parameters:
Here’s a diagram of the algorithm that these parameters impact:
additionally you will want to set the following properties to clean up stale snapshots:
Update your Property Graph data (i.e. vertices and edges) using one of the following methods:
Create a change set
Add updates to the change set
Apply the change set to the graph (which in turns creates a snapshot)
Have your application reference the new updated graph (see Note at the end of this blog)
delete the stale graph(s)
That's it! The key is leveraging all the built-in power of the Oracle database. Otherwise, you would need to implement all the steps listed above manually. Pretty sweet if you ask me.
pgx> pg = readGraphWithProperties(cfg) pgx> pg = session.getGraphs() pgx> pg = getAvailabeSnapshots(pg)
pgx> if (!pg.isFresh()) {\ pgx> gm = session.getAvailableSnapshots(pg) \ pgx> session.setSnapshot(pg.gm[0]); \ pgx> }
Many thanks to Albert Godfrind for his insight and knowledge with regards to Oracle's graph technology.
Previous Post