Graph databases are nowadays considered the most appropriate solution for highly connected domains. Nevertheless, the lack of a fixed schema perplexes the implementation of business rules and inhibits the usage of graph database technology in practical use cases. To tackle this challenge, we study cardinality constraints in graph databases, as their focus is on the essential component of the property graph data model - relationships between entities. This paper presents an abstract cardinality constraints model for enforcing cardinality constraints in graph databases, which represent complex graph patterns. We extend our initial k-vertex cardinality constraints model to allow the representation of cardinality constraints between a node and a subgraph with given node and/or edge properties. Second, we implement the proposed model as procedures deployed in the Neo4j Graph Database Management System (GDBMS) to prevent adding new edges that violate k-vertex cardinality constraints to the graph database. Finally, we study the performance of the implemented approach on synthetic and real datasets and analyze its performance compared to the initial model. Overall, the query execution time (QET) of the procedure increases exponentially on larger datasets. Still, the added node/edge property-level evaluation does not show a significant performance effect on the edge insertion process.
Read full abstract