Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Neo4j Graph Data Modelling

You're reading from   Neo4j Graph Data Modelling Design efficient and flexible databases by optimizing the power of Neo4j

Arrow left icon
Product type Paperback
Published in Jul 2015
Publisher
ISBN-13 9781784393441
Length 138 pages
Edition 1st Edition
Tools
Concepts
Arrow right icon
Author (1):
Arrow left icon
Mahesh K Lal Mahesh K Lal
Author Profile Icon Mahesh K Lal
Mahesh K Lal
Arrow right icon
View More author details
Toc

Table of Contents (11) Chapters Close

Preface 1. Graphs Are Everywhere FREE CHAPTER 2. Modeling Flights and Cities 3. Formulating an Itinerary 4. Modeling Bookings and Users 5. Refactoring the Data Model 6. Modeling Communication Chains 7. Modeling Access Control 8. Recommendations and Analysis of Historical Data 9. Wrapping Up Index

Business logic should lie in code

We returned data from Neo4j without any processing such as ordering flights by their duration or only choosing those connecting flights that are flying out at least two hours after the arrival of the incoming flight. There are multiple reasons for this:

  • Returning flights or itineraries sorted by flight duration doesn't solve anything for us since the total journey time will be a sum of all the flight durations and all the layovers.
  • Eager aggregation is generally an expensive process and, in case the client consuming data from Neo4j has processing power, it's better to delegate the processing to the client rather than do it in Neo4j.
  • In our case specifically, the aggregation for layover times is a complex calculation, more suited to programming languages rather than a query language such as Cypher.
  • The minimum layover time of two hours is more of a business logic and needs to be tackled in code and not on the database. In general, it's better...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image