Building a Data-Driven Graph-Powered Application
local graph
Chapter 10: Building a Data-Driven Graph-Powered Application
Section titled “Chapter 10: Building a Data-Driven Graph-Powered Application”Graph-powered applications — Lambda architecture, Neo4j graph database, JanusGraph for large datasets, graph processing engines, technology selection.
So far, we have provided you with both theoretical and practical ideas to allow you to design and implement machine learning models that leverage graph structures. Besides designing the algorithm, it is often very important to embed the modeling/analytical pipeline into a robust and reliable end-to-end application. This is especially true in industrial applications, where the goal is usually to design and implement production systems that support data-driven decisions and/or provide users with timely information. However, creating a data-driven application that resorts to graph representation/modeling is indeed a challenging task that requires a proper design that is a lot more complicated than simply importing networkx. This chapter aims to provide you with a general overview of the key concepts and frameworks that are used when building graph-based, scalable, data-driven applications.
We will start by providing an overview of the so-called Lambda architectures, which provide a framework to structure scalable applications that require large-scale processing and real-time updates. We will then continue by applying this framework in the context of graph-powered applications, that is, applications that leverage graph structures using techniques such as the ones described in this book. We will describe their two main analytical components: graph processing engines and graph querying engines. We’ll present some of the technologies used, both in shared memory machines and distributed memory machines, outlining the similarities and differences. The following topics will be covered in this chapter:
- Overview of Lambda architectures
- Lambda architectures for graph-powered applications
- Technologies and examples of graph processing engines
- Graph querying engines and graph databases
Overview of Lambda architecture
Section titled “Overview of Lambda architecture”In recent years, great focus has been given to designing scalable architectures that will allow, on the one hand, the processing of a large amount of data, and, on the other, providing answers/alerts/actions in real time, using the latest available information. Additionally, these systems need to also be able to scale out seamlessly to a larger number of users or a larger amount of data by increasing resources horizontally (adding more servers) or vertically (using servers that are more powerful).
Lambda architecture is a particular data-processing architecture that is designed to process massive quantities of data and ensure large throughput in a very efficient manner, preserving reduced latency and ensuring fault tolerance and negligible errors.
The Lambda architecture is composed of three different layers:
- The batch layer: This layer sits on top of the storage system – either local or distributed – and can handle and store all historical data, as well as performing online analytical processing (OLAP) computation on the entire dataset. New data is continuously ingested and stored, as it would be traditionally done in data warehouse systems. Large-scale processing is generally achieved via massively parallel jobs, which aim to produce aggregation, structuring, and computation of relevant information. In the context of machine learning, model training that relies on historical information is generally done in this layer, thus producing a trained model to be used either in a batch prediction job or in real-time execution.
- The speed layer: This is a low-latency layer that allows the real-time processing of the information to provide timely updates and information. It is generally fed by a streaming process, usually involving fast computation that does not require long computational time or load. It produces an output that is integrated with the data generated by the batch layer in (near) real time, providing support for online transaction processing (OLTP) operations.
The speed layer might also very well use some outputs of the OLAP computations, such as a trained model. Oftentimes, applications that use machine learning modeling in real time (for example, fraud detection engines used in credit card transactions) embed trained models in their speed layers that provide prompt predictions and trigger real-time alerts of potential fraud. Libraries may operate at an event level (such as Apache Storm) or over mini-batches (such as Spark Streaming), providing, depending on the use case, slightly different requirements for latency, fault tolerance, and computational speed.
- The serving layer: The serving layer is responsible for organizing, structuring, and indexing information in order to allow the fast retrieval of data coming from the batch and speed layers. The serving layer thus integrates the outputs of the batch layer with the most updated and real-time information of the speed layer in order to deliver to the user a unified and coherent view of the data. A serving layer can be composed of a persistence layer that integrates both historical aggregation and real-time updates. This component may be based on some kind of database, which can be relational or not, conveniently indexed in order to reduce latency and allow the fast retrieval of relevant data. The information is generally exposed to the user via either a direct connection to the database and is accessible using a specific domain query language, such as SQL, or via dedicated services, such as RESTful API servers (which in Python can be easily implemented using several frameworks, such as flask, fastapi, or turbogear), which provide the data via specifically designed endpoints.
The following diagram illustrates the Lambda architecture with these three layers:

Figure 10.1: Functional diagram for an application based on Lambda architecture
All the service layers (batch, real-time, and serving) interact with the data layers, where all data – both operational and historical – are stored. Batch and real-time layers generally perform both read and write operations on the data, while the serving layers generally mostly read from the data layers.
Lambda architectures have several benefits that have motivated and promoted their use, especially in the context of big data applications. In the following bullet points, we list some of the main pros of Lambda architectures:
- No server management: The Lambda architectural design pattern typically abstracts the functional layers and does not require installing, maintaining, or administering any software/infrastructure
- Flexible scaling: The application can be either automatically scaled or scaled by controlling the number of processing units that are used in batch layers (for example, computing nodes) and/or in speed layers (for example, Kafka brokers) separately
- Automated high availability: It represents a serverless design for which we already have built-in availability and fault tolerance
- Business agility: Reacts in real time to changing business/market scenarios
Although very powerful and flexible, Lambda architectures come with some limitations mainly due to the presence of two interconnected processing flows: the batch layer and the speed layer. This may require developers to build and maintain separate code bases for batch and stream processes, resulting in more complexity and code overhead, which may lead to harder debugging, possible misalignment, and bug promotion.
So far, we have provided a short overview of Lambda architectures and their basic building blocks. For more details on how to design scalable architectures and the most commonly used architectural patterns, please refer to the book Data Lake for Enterprises, 2017, by Tomcy John and Pankaj Misra.
In the next section, we will show you how to implement a Lambda architecture for graph-powered applications. In particular, we will describe the main components and review the most common technologies.
Lambda architectures for graph-powered applications
Section titled “Lambda architectures for graph-powered applications”When dealing with scalable, graph-powered, data-driven applications, the design of Lambda architectures is also reflected in the separation of functionalities between two crucial components of the analytical pipeline:
- The graph processing engine executes computations on the graph structure in order to extract features (such as embeddings), compute statistics (such as degree distributions, the number of edges, and cliques), compute metrics and key performance indicators (KPIs) (such as centrality measures and clustering coefficients), and identify relevant subgraphs (for example, communities) that often require OLAP.
- The graph querying engine allows us to persist network data (usually done via a graph database) and provides fast information retrieval and efficient querying and graph traversal (usually via graph querying languages). All of the information is already persisted in some data storage (that may or may not be in memory) and no further computation is required apart from (possibly) some final aggregation results, for which indexing is crucial to achieving high performance and low latency.
The following diagram illustrates this:

Figure 10.2: Graph-based architecture, with the main components also reflected in a Lambda architectural pattern
Graph processing engines sit on top of batch layers and produce outputs that may be stored and indexed in appropriate graph databases. These databases are the backend of graph querying engines, which allow relevant information to be easily and quickly retrieved, representing the operational views used by the serving layer.
Depending on the use cases and/or the size of the graph, it often makes sense to run both the graph processing engine and the graph query engine on top of the same infrastructure.
Instead of storing the graph on a low-level storage layer (for example, the filesystem, Hadoop Distributed File System, or S3), there are graph database options that could support both OLAP and OLTP. These provide, at the same time, a backend persistence layer where historical information processed by batch layers, together with real-time updates from the speed layer, is stored, and information that needs to be queried efficiently by the serving layer.
As compared to other use cases, this condition is indeed quite peculiar for graph-powered, data-driven applications. Historical data often provides a topology on top of which new, real-time updates and OLAP outputs (KPIs, data aggregations, embeddings, communities, and so on) can be stored. This data structure also represents the information that is later queried by the serving layer that traverses the enriched graph.
In the next sections, we will be discussing graph querying engines and the graph processing engine in more detail.
Graph querying engine
Section titled “Graph querying engine”In the last decade, due to the large diffusion of non-structured data, NoSQL databases have started to gain considerable attention and importance. Among them, graph databases are indeed extremely powerful for storing information based on a relation between entities. Indeed, in many applications, data can naturally be seen as entities, associated with metadata in the form of node properties, connected by edges that also have properties that further describe the relationship between entities.
Examples of graph databases are libraries or tools such as Neo4j, OrientDB, ArangoDB, Amazon Neptune, Cassandra, JanusGraph (previously named TitanDB), Google Spanner Graph, and Microsoft Cosmos DB. In the following sections, we will briefly describe some of them, together with the languages that allow us to query and traverse the underlying graphs, which are called graph querying languages.
At the time of writing, Neo4j (https://neo4j.com/) is one of the most common graph databases around, with a large community supporting its use and adoption. It features two editions:
- Community Edition, released under a GPL v3 license, allows users/developers to openly include Neo4j in their applications
- Enterprise Edition, designed for commercial deployments where scale and availability are crucial
With its enterprise edition, Neo4j can scale out to fairly large datasets via sharding, that is, distributing data over multiple nodes and parallelizing queries and aggregation over multiple instances of the database. Additionally, the Neo4j federation also allows querying smaller separated graphs (sometimes even with a different schema) as if they were one large graph.
Some of Neo4j’s strong points are its flexibility (which allows the schema to be evolved) and its user-friendliness. In particular, many operations in Neo4j can be done through its query language, which is very intuitive and easy to learn: Cypher. Cypher can just be seen as the counterpart of SQL for graph databases.
It’s noteworthy that Graph Query Language (GQL) has recently been published as a new ISO standard designed for property graphs. GQL is the first new ISO database language since SQL’s introduction in 1987 and aims to standardize graph querying across different platforms. Cypher has significantly influenced GQL’s development, providing a familiar foundation for those already acquainted with Cypher. However, GQL syntax and Cypher’s are not that different, and, as noted in the GQL announcement, Cypher will be supported for many years to come.
Testing out Neo4j and Cypher is extremely easy. You could install the Community Edition (via Docker; see below) or play around with SaaS services, such as the online sandbox version (https://neo4j.com/sandbox/) or the free tier of Neo4j Aura (https://neo4j.com/free-graph-database/).
In the following, we will use the Docker installation. To start a single instance of the community edition of Neo4j, you can use the following Docker command:
docker run --rm --detach --name neo4j \ --publish=7474:7474 --publish=7687:7687 \ --user="$(id -u):$(id -g)" \ --env NEO4J_AUTH=none \ --env NEO4J_PLUGINS='["graph-data-science"]' \ neo4j:5.26.0Once the service is up and running, you can log in to the UI by opening the link http://localhost:7474 in one of your browsers and supplying the username neo4j and password neo5j. At this point, you are ready to play with your Neo4j database.
In the repository attached to the book, we provide a Cypher query to create the Movie dataset. The Movie dataset is made up of 38 movies and 133 people that acted in, directed, wrote, reviewed, and produced them. Both the on-premises version and the online version have a user-friendly UI that allows the user to query and visualize the data (see Figure 10.3). We start by listing 10 actors in the Movie dataset, by simply querying the following:
MATCH (p: Person) RETURN p LIMIT 10But let’s now use the information about relations between data points. We see that one of the actors that appears in the database is Keanu Reeves. We may wonder who all the actors that he has acted with in the listed movies are. This information can be easily retrieved using the following query:
MATCH (k: Person {name:"Keanu Reeves"})-[:ACTED_IN]-(m: Movie)-[:ACTED_IN]-(a: Person) RETURN k, m, aAs shown in the following figure, the query intuitively and graphically indicates in its syntax how to traverse the graph by declaring the path we are interested in:

Figure 10.3: Example of Neo4j UI with the Cypher query to retrieve the co-actors of Keanu Reeves in the Movie dataset
Neo4j also provides bindings with several programming languages, such as Python, JavaScript, Java, Go, Spring, and .NET. For Python in particular, there are several libraries that implement connections with Neo4j, such as neo4j and graphdatascience, that are officially supported by Neo4j Inc. These libraries provide direct connections to the database via a binary protocol. When using the neo4j client library, creating a connection to the database and running a query is just a matter of a few lines of code:
from neo4j import GraphDatabasedriver = GraphDatabase("bolt://localhost:7687", "my-user", "my-password")
def run_query(tx, query): return tx.run(query)
with driver.session() as session: session.write_transaction(run_query, query)A query could be any Cypher query, for instance, the one written previously to retrieve the co-actors of Keanu Reeves. In the notebook provided in the repository, we show how to create and query the Movie dataset programmatically using Python.
On the other hand, graphdatascience provides a higher-level API that abstracts away the need to instantiate the low-level sessions and transactions:
from graphdatascience import GraphDataScienceuri = f"bolt://localhost:7687"gds = GraphDataScience(uri, auth=("neo4j", "neo5j"))gds.run_cypher(query)As we will see in the following, besides a higher-level API, the graphdatascience also provides intuitive APIs to interact with the Graph Data Science engine to perform various analytical computations on the graph.
JanusGraph – a graph database to scale out to very large datasets
Section titled “JanusGraph – a graph database to scale out to very large datasets”Neo4j is an extremely great piece of software, unbeatable when you want to get things done quickly, thanks to its intuitive interface and query language. Neo4j is indeed a graph database that’s suitable for production, particularly in its Enterprise edition, but it’s especially good in MVPs when agility is crucial.
Indeed, when the volume of the data increases substantially, the Community Edition of Neo4j is likely to not be suitable anymore, and you should either consider switching to the Enterprise edition or other graph database options. Once again, this should be done only when the use case requirements start to hit the limitation of Neo4j Community Edition, as you need to evolve from the MVP initial requirements.
Besides other commercial alternatives, such as Amazon Neptune and Azure Cosmos DB, some open source options are also available. Among them, we believe it is worth mentioning JanusGraph (https://janusgraph.org/), which is a particularly interesting piece of software. JanusGraph is the evolution of a previously open source project that was called TitanDB and is now an official project under the Linux Foundation, also featuring support from top players in the tech landscape, such as IBM, Google, Hortonworks, Amazon, Expero, and Grakn Labs.
JanusGraph is a scalable graph database designed for storing and querying graphs distributed across a multi-machine cluster with hundreds of billions of vertices and edges. As a matter of fact, JanusGraph does not have a storage layer on its own, but it is rather a component, written in Java, that sits on top of other data storage layers, such as the following:
- Google Cloud Bigtable (https://cloud.google.com/bigtable), which is the cloud version of the proprietary data storage system built on Google File System, designed to scale a massive amount of data distributed across data centers (for more information, refer to Bigtable: A Distributed Storage System for Structured Data, Fay Chang et al., 2006)
- Apache HBase (https://hbase.apache.org/), which is a non-relational database that features Bigtable capabilities on top of Hadoop and HDFS, thus ensuring similar scalability and fault tolerance
- Apache Cassandra (https://cassandra.apache.org/), which is an open source distributed NoSQL database that allows handling a large amount of data, spanning multiple data centers
- ScyllaDB (https://www.scylladb.com/), which is specifically designed for real-time applications, and is compatible with Apache Cassandra while achieving significantly higher throughputs and lower latencies
Depending on its storage backend, JanusGraph inherits its various features, such as scalability, high availability, and fault tolerance, from scalable solutions, abstracting a graph view on top of them. Note that when running on top of eventually consistent databases, users should expect similar slack requirements on consistency for JanusGraph as well.
With its integration with ScyllaDB, JanusGraph handles extremely fast, scalable, and high-throughput applications. JanusGraph also integrates indexing layers that can be based on Apache Lucene, Apache Solr, and Elasticsearch in order to allow even faster information retrieval and search functionalities within the graph.
The usage of highly distributed backends together with indexing layers allows JanusGraph to scale to enormous graphs, with hundreds of billions of nodes and edges. This allows it to handle the so-called supernodes very efficiently. These are nodes that have an extremely large degree, which often arises in real-world applications (remember that a very famous model for real networks is the Barabasi-Albert model, based on preferential attachments, which makes hubs naturally emerge within the graph).
In large graphs, supernodes are often potential bottlenecks of the application, especially when the business logic requires traversing the graph passing through them. Having properties (such as timestamps or similarity metrics computed and updated regularly) that can help with rapidly filtering only the relevant edges during a graph traversal can speed up the process significantly and achieve better performance.
Similarly to what has been done for Neo4j, for JanusGraph we can easily start an instance of the database using Docker with the following command:
docker run --rm --detach --name janusgraph \ --publish=8182:8182 \ Janusgraph/janusgraph:1.1.0Once the JanusGraph server is running you can start to interact and play with it. JanusGraph exposes a standard API to query and traverse the graph via the Apache TinkerPop library (https://tinkerpop.apache.org/), which is an open source, vendor-agnostic graph computing framework. Similarly to GQL described earlier, TinkerPop also provides a standard interface for querying and analyzing the underlying graph using the Gremlin graph traversal language. Using a standard querying engine can allow you to create application layers that can seamlessly integrate with the various compatible graph database systems. They allow you to build standard serving layers that do not depend on the backend technology, giving you the freedom to choose/change the appropriate graph technology for your application depending on your actual needs or different environments (e.g. customers having different technological stacks), also avoiding a vendor lock-in to some extent.
Besides Java connectors, Gremlin also has direct Python bindings thanks to the gremlinpython library, which allows Python applications to connect to and traverse graphs.
In the notebook provided in the repository, we show you how to use and interact with JanusGraph using Gremlin.
First of all, we need to connect to the database using the following code snippet:
from gremlin_python.driver.driver_remote_connection import DriverRemoteConnectionfrom gremlin_python.driver.serializer import GraphSONSerializersV3d0
connection = DriverRemoteConnection( 'ws://localhost:8182/gremlin', 'g', message_serializer=GraphSONSerializersV3d0())Once the connection is created, we can then instantiate the GraphTraversalSource object, which is the basis for all Gremlin traversals, and bind it to the connection we just created:
from gremlin_python.structure.graph import Graphfrom gremlin_python.process.graph_traversal import __
graph = Graph()g = graph.traversal().withRemote(connection)Once GraphTraversalSource is instantiated, we can reuse it across the application to query the graph database.
Using Gremlin, we can build a traversal that creates a node with a given label (here, 'student') and some properties (e.g. the name and their GPA):
g.addV('student')\ .property('name', 'Jeffery')\ .property('GPA', 4.0).next()Note that at the end, we use next() since all Gremlin queries have lazy computation, which are first built and then executed. Multiple queries can also be chained together and different elements of the chain can be labeled:
g\ .addV('student')\ .property('name', 'Claire')\ .property('GPA', 3.9).as_("n1")\ .addV('student')\ .property('name', 'Lisa')\ .property('GPA', 3.6).as_("n2")\ .addE("FRIEND_OF")\ .from_("n1").to("n2")\ .property("since", "2014")\ .iterate()This query will both create the two nodes and the edge between them. Using these concepts, in the notebook attached we provide utility functions to create a graph starting from a list of nodes and edges. We then use these utilities to import in JanusGraph both the Karate Club network (discussed in Chapter 1, Getting Started with Graphs) and the Movie dataset used in the previous section.
Once the Movie dataset is imported, we can then re-write the Cypher query we used previously to find all the co-actors of Keanu Reeves using Gremlin:
co_actors = g.V()\ .has('Person', 'name', 'Keanu Reeves')\ .out("ACTED_IN")\ .in("ACTED_IN")\ .values("name").dedup().to_list()As can be seen in the preceding code, Gremlin is a functional language whereby operators are grouped together to form path-like expressions.
Now that we have stored the information in a graph database that can be retrieved using querying engines, it is time to process the data. The next subsection will present the options for processing and analyzing graphs by implementing a graph processing engine.
Graph processing engines
Section titled “Graph processing engines”To select the right technology for a graph processing engine, it is crucial to estimate the size in memory of the network compared to the capacity of the target architecture. You can start by using simple frameworks that allow fast prototyping during the first phases of a project when the goal is to quickly build a minimum viable product (MVP).
Such frameworks can then be substituted for more advanced tools later on when performance and scalability become more crucial. A microservice modular approach and proper structuring of these components will allow the switching of technologies/libraries independently from the rest of the application to target specific issues, which will also guide the choice of the backend stack.
Graph processing engines require information for whole graphs to be accessed quickly, such as having all of the graph in memory, and, depending on the context, you may need distributed architectures. As we saw in Chapter 1, Getting Started with Graphs, networkx is a great example of a library for building a graph processing engine when dealing with relatively small datasets. When datasets get larger but can still fit in single servers or shared memory machines, other libraries may help to reduce computational time. As seen in Chapter 1, Getting Started with Graphs, using libraries other than networkx where graph algorithms are implemented in more performant languages, such as C++ or Julia, may speed up the computation by more than two orders of magnitude.
However, there are cases where datasets grow so much that it is no longer technologically or economically viable to use shared memory machines of increasing capacity (fat nodes). In such cases, it is rather necessary to distribute the data on clusters of tens or hundreds of computing nodes, allowing horizontal scaling. The most popular frameworks that can support a graph processing engine in these cases are the following:
- Apache Spark GraphX, which is the module of the Spark library that deals with graph structures (https://spark.apache.org/graphx). It involves a distributed representation of the graph using resilient distributed datasets (RDDs) for both vertices and edges, or encoding the information using the Spark DataFrame API, resulting in the so-called GraphFrames that provide a more type-safe and structured interface. The graph repartition throughout the computing nodes can be done either with an edge-cut strategy, which logically corresponds to dividing the nodes among multiple machines, or a vertex-cut strategy, which logically corresponds to assigning edges to different machines and allowing vertices to span multiple machines. Although written in Scala, GraphX has wrappers that can be used with both R and Python. GraphX already comes with some algorithms implemented, such as PageRank, connected components, and triangle counting. There are also other libraries that can be used on top of GraphX for other algorithms, such as SparklingGraph, which implements more centrality measures.
- Neo4j Graph Data Science (GDS), a high-performance graph analytics engine that provides a broad set of graph algorithms, ML pipelines, and enterprise support. GDS is optimized for Neo4j’s native graph storage, allowing scalable analysis of large networks in use cases such as fraud detection, recommendations, and supply chain optimization. In the attached notebooks, we show how the Neo4j Graph Data Science engine can be leveraged by using the
graphdatasciencePython library and perform an analysis (e.g., centrality computation) of the Cora dataset. - Amazon Neptune Analytics is a powerful graph processing engine optimized for large-scale graph analysis for fast insights. It integrates well within the AWS ecosystem, making it easy for users already on AWS to get started without needing additional approvals. Neptune supports optimized graph algorithms and low-latency graph queries. The ease of integration makes it a great choice for enterprises using AWS services. In summary, Neptune Analytics offers a seamless and scalable graph analytics solution within the AWS cloud environment.
- In the first version of this book, we mentioned Apache Giraph, which is an iterative graph processing system built for high scalability (https://giraph.apache.org/). It was developed by Facebook to analyze the social graph formed by users and their connections and is built on top of the Hadoop ecosystem for unleashing the potential of structured datasets at a massive scale. Giraph is natively written in Java and, similarly to GraphX, also provides a scalable implementation for some basic graph algorithms, such as PageRank and shortest path. However, it is important to note that Apache Giraph has been retired due to inactivity as of 2023. Therefore, it is no longer recommended for current production applications.
When we consider scale-out to a distributed ecosystem, we should always keep in mind that the available choice for algorithms is significantly smaller than in a shared machine context. This is generally due to two reasons:
- First, implementing algorithms in a distributed way is a lot more complex than in a shared machine due to communication among nodes, which also reduces the overall efficiency
- Secondly, and more importantly, one fundamental mantra of big data analytics is that only algorithms that (nearly) scale linearly with the number of data points should be implemented in order to ensure the horizontal scalability of the solution, by increasing the computational nodes as the dataset increases
In this respect, GraphX and Neo4j GDS also allow you to define scalable, vertex-centric, iterative algorithms using standard interfaces based on Pregel, which can be seen as a sort of equivalent of iterative map-reduce operations for graphs (actually, iterative map-reduce operations applied to triplet node-edge-node instances). A Pregel computation is composed of a sequence of iterations, each called a superstep, each involving a node and its neighbors.
During the superstep, S, a user-defined function is applied for each vertex, V. This function takes the messages sent to V in superstep S – 1 as input and modifies the state of V and its outgoing edges. This function represents the mapping stage, which can be easily parallelized. Besides computing the new states of V, the function also sends messages to other vertices connected to V, which will receive this information at superstep S + 1. Messages are typically sent along outgoing edges, but a message may be sent to any vertex whose identifier is known. In Figure 10.4, we show a sketch of what a Pregel algorithm would look like when computing the maximum value over a network:

Figure 10.4: Example of calculating a maximum value over a node property using Pregel
For further details on this algorithm, please refer to the original paper, Pregel: A System for Large-Scale Graph Processing, written by Malewicz et al. in 2010.
By using Pregel, you can easily implement other algorithms, such as PageRank or connected components, in a very efficient and general way, or even implement node embeddings’ parallel variants (for an example, see Distributed-Memory Vertex-Centric Network Embedding for Large-Scale Graphs, Riazi and Norris, 2020).
Selecting the right technology
Section titled “Selecting the right technology”Neo4j or GraphX? This is a question that often gets asked. However, as we have described briefly, the two pieces of software are not really competitors, but they rather target different needs. Neo4j, Neptune, JanusGraph, and CosmoDB allow us to store information in a graph-like structure and query the data, whereas GraphX, Neo4j Graph Data Science, and Amazon Neptune Analytics make it possible to analytically process a graph (especially for large graph dimensions). Although you could also use Neo4j as a processing engine and GraphX could also be used as an in-memory stored graph, this approach should be discouraged due to performance limitations, scalability concerns, and mismatched feature sets.
Graph processing engines usually compute KPIs that get stored in the graph database layers (potentially indexed such that querying and sorting become efficient) for later use. Thus, technologies such as GraphX are not competing with graph databases such as Neo4j, and they can very well co-exist within the same application to serve different purposes. As we stressed in the introduction, even in MVPs and at early stages, it is best to separate the two components, the graph processing engine and the graph querying engine, and use appropriate technologies for each of them.
Simple and easy-to-use libraries and tools do exist in both cases and we strongly encourage you to use them wisely in order to build a solid and reliable application that can be scaled out seamlessly.
Summary
Section titled “Summary”In this section, we have provided you with the basic concepts of how to design, implement, and deploy data-driven applications that resort to graph modeling and leverage graph structures. We have highlighted the importance of a modular approach, which is usually the key to seamlessly scaling any data-driven use case from early-stage MVPs to production systems that can handle a large amount of data and large computational performances.
We have outlined the main architectural pattern, which should provide you with a guide when designing the backbone structure of your data-driven applications. We then continued by describing the main components that are the basis of graph-powered applications: graph processing engines, graph databases, and graph querying languages. For each component, we have provided an overview of the most common tools and libraries, with practical examples that will help you to build and implement your solutions. You should thus have by now a good overview of what the main technologies out there are and what they should be used for.
In the next chapter, we will explore recent advancements and emerging research trends in temporal graph machine learning. Specifically, we will discuss cutting-edge techniques (such as temporal graph neural networks) and applications. We will also highlight practical examples and potential use cases, drawing insights from the latest scientific literature.