Book Image

Graph Data Modeling in Python

By : Gary Hutson, Matt Jackson
Book Image

Graph Data Modeling in Python

By: Gary Hutson, Matt Jackson

Overview of this book

Graphs have become increasingly integral to powering the products and services we use in our daily lives, driving social media, online shopping recommendations, and even fraud detection. With this book, you’ll see how a good graph data model can help enhance efficiency and unlock hidden insights through complex network analysis. Graph Data Modeling in Python will guide you through designing, implementing, and harnessing a variety of graph data models using the popular open source Python libraries NetworkX and igraph. Following practical use cases and examples, you’ll find out how to design optimal graph models capable of supporting a wide range of queries and features. Moreover, you’ll seamlessly transition from traditional relational databases and tabular data to the dynamic world of graph data structures that allow powerful, path-based analyses. As well as learning how to manage a persistent graph database using Neo4j, you’ll also get to grips with adapting your network model to evolving data requirements. By the end of this book, you’ll be able to transform tabular data into powerful graph data models. In essence, you’ll build your knowledge from beginner to advanced-level practitioner in no time.
Table of Contents (16 chapters)
1
Part 1: Getting Started with Graph Data Modeling
4
Part 2: Making the Graph Transition
7
Part 3: Storing and Productionizing Graphs
11
Part 4: Graphing Like a Pro

Refactoring and Evolving Schemas

This chapter will spend some time discussing what makes a good schema and approaches to take if you need to refactor or change your schema. We will explore what and how entities can change in a graph database. This will then lead us to why you need to consider evolving schemas. Here, the focus will be on making your schema bulletproof when it comes to its evolution.

Following on from this, we will present a use case of Twitter circles, which will look at setting up your interface between Neo4j and Python (this is something we have extensively covered in other chapters), adding constraints to the Cypher queries we will write to build the graph data model in Neo4j, and some considerations you need to make pre-schema change concerning node and edgelist relationships. Then, we will change the schema with our hypothetical needs, without disrupting a live service. Finally, we will reflect on why the design of evolving schemas is pivotal for successful...