From Data to Connections: Leveraging Hyperconnectivity in E-commerce Data (Part 1)
Bitnine Global Marketing team
Fri Jul 05 2024
In today’s hyper-connected world, everything is linked—people, data, and devices—thanks to the rapid advancement of internet and communication technologies. This interconnected web is known as a hyper-connected society, where vast amounts of data are generated and interlinked. This level of connectivity has the potential to drive innovation and transformation across various sectors. In essence, hyper-connectivity describes the intricate and logical interconnections of data across all services and devices.
E-commerce is a prime example of transforming data into connections among people (customers and sellers), data, and products. It manages the entire commercial process of buying and selling online, overseeing both production and consumption. In this article, we'll explore the concept of hyper-connectivity using sample e-commerce data and demonstrate its practical applications.
Data Modeling with Relational Database
Let's start with a hypothetical table of a customer's purchases at Shopping Mall A, modeled in a relational database. This table includes products, stores, payment information, and the relationships between stores.
Figure 1. RDB Modeling with Payment Sample Data Table
Understanding the relationships between datasets is crucial for achieving hyper-connectivity. This is where the 'JOIN' method comes into play for analyzing tables. An entity-relationship diagram (ERD) visualizes real-world data and facilitates the connections between tables of different types. Relational databases help comprehend data flow between tables and uncover inter-table relationships.
Data Modeling with Graph Database
A graph database, a type of NoSQL database, stores and manages relationships using 'nodes' and 'edges'. These databases enable hyper-connectivity by exploring the relationships between data.
Figure 2. Graph Database Modeling with Payment Sample Data Table Querying Graph Relationships
Graph databases provide a more efficient way to query data in a hyper-connected system. For example, Apache AGE, which combines table and graph data operations, allows intuitive queries using Cypher (a graph query language) along with SQL.
Here’s how to extract and retrieve data using both Cypher and SQL.
Querying Simple Relationships
We can start by asking simple questions to find out what products customers buy and what services they use.
Figure 3. Relationship Querying for Graph Relationships in Apache AGE
The graph query above (Cypher) traverses the graph to find the relationship in the clause “match (a: customer)-[r]-(b: product)” and what product the customer buys. It uses a hybrid query format with “SELECT” and “FROM” clauses in Apache AGE to make the graph output easier to manipulate for users unfamiliar with graph databases.
Querying Complex Relationships
With Apache AGE, we can also query complex relationships, such as identifying which bank customers used, what cards they used, and what product categories they purchased.
Figure 4. Sophisticated Relationship Querying for Graph Relationships in Apache AGE
In the MATCH clause, you can specify the path to extract. For example, the clause {"(a: customer)-[r1]-(b: bank {name: 'AGE bank'})"} queries the bank they used, and the (a)-[r3]-(d: card) clause queries what card they used, while the (a)-[r4]-(e: product)-[r5]-(f
) clause queries what products they bought and their categories.
Graph database queries demonstrate hyperconnectivity implementation more efficiently.
Apache AGE excels with its hybrid query capability, allowing even non-experts to derive results using SQL. As a PostgreSQL extension, Apache AGE offers flexibility with extensions tailored to specific needs, enhancing its practicality.
Interested in learning more about Apache AGE? Learn More Now.