How mylonasc/pygraphdb works
Main components
• Data Storage Layer: In src/kvstores.py you have implementations of key-value store solutions (for example, LMDBStore as shown in the example). This component is responsible for persisting graph components to disk or other storage.
• Serialization Component: The module in src/serializers.py handles (de)serialization of data objects, thereby bridging the gap between Python objects and stored binary formats.
• Domain Entities: Although not separate files, the Node and Edge classes (presumably defined in src/graphdb.py) are essential parts of the domain model.
• Client/Application Layer: This is illustrated by the example usage in the README and further explored in the notebooks and test.py, which show how external users interact with the GraphDB.
Relationships and interactions
• The Client/Application Layer (including notebooks and test scripts) interacts directly with the GraphDB Core.
• GraphDB Core relies on two key services – the Key-Value Store and the Serializer:
• When a node or edge is to be stored, GraphDB will use the Serializer to convert it into a storable format, then pass it to the KV Store for persistence.
• On retrieval, the reverse happens; the stored data is fetched via the KV Store and deserialized back into GraphDB entities.
• From the Client/Application Layer to the GraphDB Core to indicate API calls (such as put_node, get_edge, etc.).
• From the GraphDB Core to the KV Store and Serializer to show how data is processed and persisted.
Architectural patterns and design principles
• Separation of Concerns: The clear separation between the core graph logic, persistence, and serialization allows for flexibility and easier maintenance.
• Inversion of Control/Dependency Injection: GraphDB is instantiated with a store and a serializer, making it extensible and allowing different storage or serialization mechanisms.
• Modular Design: Each module (graph, store, serializer) acts independently, facilitating testing (as shown by test.py) and future extensions.
Relevant technologies
• Pure Python for implementation.
• LMDBStore is specifically noted, so if LMDB or similar libraries are being used, you may indicate that under the storage component.
• The use of Pickle for serialization (via PickleSerializer) is part of the serialization layer.