Over a million developers have joined DZone.

Model to Answer Your Questions Rather Than Modelling Reality

DZone's Guide to

Model to Answer Your Questions Rather Than Modelling Reality

· Database Zone
Free Resource

Find out how Database DevOps helps your team deliver value quicker while keeping your data safe and your organization compliant. Align DevOps for your applications with DevOps for your SQL Server databases to discover the advantages of true Database DevOps, brought to you in partnership with Redgate

On the recommendation of Ian Robinson I’ve been reading the 2nd edition of William’s Kent’s ‘Data and Reality‘ and the author makes an interesting observation at the end of the first chapter which resonated with me:

Once more: we are not modelling reality, but the way information about reality is processed, by people.

It reminds me of similar advice in Eric Evans’ Domain Driven Design and it’s advice which I believe is helpful when designing a model in a graph database.

Last year I wrote a post explaining how I’d be using an approach of defining questions that I wanted to ask before modelling my data and in neo4j land we can do this by writing cypher queries up front.

We can then play around with increasing the size of our data set in different ways to check that our queries are still performant and tweak our model if necessary.

For example one simple optimisation would be to run an offline query to make implicit relationships explicit.

Although graphs are very whiteboard friendly and it can be tempting to design our whole model before writing any queries this often causes problems later on.

When we eventually get to asking questions of our data we may find that we’ve modelled some things unnecessarily or have designed the model in a way that leads to inefficient queries.

I’ve found an effective approach is to keep the feedback loop tight by minimising the amount of time between drawing parts of our model on a whiteboard and writing queries against it.

If you’re interested in learning more, Ian has a slide deck from a talk he did at JAX 2013 which covers this idea and others when building out graph database applications.

Align DevOps for your applications with DevOps for your SQL Server databases to increase speed of delivery and keep data safe. Discover true Database DevOps, brought to you in partnership with Redgate


Published at DZone with permission of Mark Needham, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}