HTTP-APIs/hydra-python-agent

Port all operations to use Redis

Closed this issue ยท 8 comments

All operations on the graph shall be using Redis (so every operation on the graph shall issue one or more Redis command). The only data stored in memory should be the API endpoints graph for now (but possibly it will be in the datastore eventually as well).

Please take a look in depth to closed issues for reference:

Guttz commented

Could someone briefly cite what's yet to be ported to Redis? @Mec-iS @shravandoda @sandeepsajan0

Currently collection, Endpoints and members currently seem to be added to Redis, also queries are made with commands to Redis and the structure appear conformant with issues #11, #22 and #18.

All operations on the graph shall be using Redis

^^

Guttz commented

Yeah, I get that all operations shall be using Redis, perhaps I didn't express myself well enough.

From checking the Agents code the operations already seem to be issuing Redis commands as the "get_collection_properties" method at the image below.

image

Can you mention which part of the architecture is yet to be ported/should issue Redis commands and currently isn't?

all the HTTP methods will perform some sort of operation on the graph. The graph is stored in Redisgraph and shall be using its datastructures and related operations.

For example, connecting different nodes in the graph hasn't been ported out to Redis yet.

Guttz commented

Oh, that makes sense. Thanks for the clarifications @Mec-iS @shravandoda

Please take a look to this page; it defines all the necessary operations though it stores them by allocating Python objects. We want those operations to be performed by Redis, so any of those methods implemented in the Vertex Edge and Graph classes should issue a Redisgraph command.

Remember that in RDF triples (subject-predicate-object, vertex-edge-vertex) are the way of representing data; the result is a directed graph from subjects to objects of triples, with all its mathematical properties.
To give some other references: the two main family of algorithms that are used to search a graph are "Breadth-first" or "Depth-first", Redigraph uses these algos and others to make its commands to return data from the graph. Redis as a datastore in general allows much more efficient and scalable memory management so it makes possible to scale up to billions of vertices and edges (providing high-availability and replication by design). Major Redis data-structures are involved in storing adjacency lists for the graph.