52
David Colebatch @dcolebatch [email protected] Graph Applications for the Enterprise, FAST Wednesday, 6 November, 13

Graph Applications for the Enterprise, FAST - David Colebatch @ GraphConnect NY 2013

Embed Size (px)

DESCRIPTION

LightMesh quickly launched its next generation SaaS CMDB despite the challenge of a complex business domain by leveraging the xnlogic framework with Neo4j. In this talk, David will take you through some of the gotchas of enterprise application development with graphDB and how to solve them.

Citation preview

Page 1: Graph Applications for the Enterprise, FAST - David Colebatch @ GraphConnect NY 2013

David����������� ������������������  Colebatch����������� ������������������  ����������� ������������������  ����������� ������������������  @[email protected]����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  

Graph����������� ������������������  Applications����������� ������������������  for����������� ������������������  the����������� ������������������  Enterprise,����������� ������������������  FAST

Wednesday, 6 November, 13

Page 2: Graph Applications for the Enterprise, FAST - David Colebatch @ GraphConnect NY 2013

David����������� ������������������  Colebatch����������� ������������������  ����������� ������������������  ����������� ������������������  [email protected]����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  @dcolebatch

Who����������� ������������������  Are����������� ������������������  We?

• Toronto-based Graph Database services company

• Partner with Neo Technology

• Organizers of GraphTO

• Authors of the popular Pacer gem, an extensible graph traversal library

GraphTO

Wednesday, 6 November, 13

Page 3: Graph Applications for the Enterprise, FAST - David Colebatch @ GraphConnect NY 2013

David����������� ������������������  Colebatch����������� ������������������  ����������� ������������������  ����������� ������������������  [email protected]����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  @dcolebatch

Enterprise����������� ������������������  Application����������� ������������������  Examples

Wednesday, 6 November, 13

Page 4: Graph Applications for the Enterprise, FAST - David Colebatch @ GraphConnect NY 2013

ERPCRM

Accounting

MRPPLM

CMDBAMDB

InventoryExcel

MDM

Wednesday, 6 November, 13

Page 5: Graph Applications for the Enterprise, FAST - David Colebatch @ GraphConnect NY 2013

ERPCRM

Accounting

MRPPLM

CMDBAMDB

InventoryExcel

MDM

Wednesday, 6 November, 13

Page 6: Graph Applications for the Enterprise, FAST - David Colebatch @ GraphConnect NY 2013

Data complexity

Perfo

rman

ce

SQL database

Requirement of application

The����������� ������������������  Zone����������� ������������������  of����������� ������������������  SQL����������� ������������������  Adequacy

Wednesday, 6 November, 13

Page 7: Graph Applications for the Enterprise, FAST - David Colebatch @ GraphConnect NY 2013

Data complexity

Perfo

rman

ce

SQL database

Requirement of application

The����������� ������������������  Zone����������� ������������������  of����������� ������������������  SQL����������� ������������������  Adequacy

Wednesday, 6 November, 13

Page 8: Graph Applications for the Enterprise, FAST - David Colebatch @ GraphConnect NY 2013

Data complexity

Perfo

rman

ce

SQL database

Requirement of application

The����������� ������������������  Zone����������� ������������������  of����������� ������������������  SQL����������� ������������������  Adequacy

Salary List

ERP

CRM

Wednesday, 6 November, 13

Page 9: Graph Applications for the Enterprise, FAST - David Colebatch @ GraphConnect NY 2013

Data complexity

Perfo

rman

ce

SQL database

Requirement of application

Network / CloudManagement

Social

MDM

Geo

The����������� ������������������  Zone����������� ������������������  of����������� ������������������  SQL����������� ������������������  Adequacy

Salary List

ERP

CRM

Wednesday, 6 November, 13

Page 10: Graph Applications for the Enterprise, FAST - David Colebatch @ GraphConnect NY 2013

Data complexity

Perfo

rman

ce

SQL database

Requirement of application

Network / CloudManagement

Social

MDM

Geo

The����������� ������������������  Zone����������� ������������������  of����������� ������������������  SQL����������� ������������������  Adequacy

Salary List

ERP

CRM

Wednesday, 6 November, 13

Page 11: Graph Applications for the Enterprise, FAST - David Colebatch @ GraphConnect NY 2013

Configuration����������� ������������������  Management

Wednesday, 6 November, 13

Page 12: Graph Applications for the Enterprise, FAST - David Colebatch @ GraphConnect NY 2013

Configuration����������� ������������������  Management

Wednesday, 6 November, 13

Page 13: Graph Applications for the Enterprise, FAST - David Colebatch @ GraphConnect NY 2013

Configuration����������� ������������������  Management

Wednesday, 6 November, 13

Page 14: Graph Applications for the Enterprise, FAST - David Colebatch @ GraphConnect NY 2013

Configuration����������� ������������������  Management

Wednesday, 6 November, 13

Page 15: Graph Applications for the Enterprise, FAST - David Colebatch @ GraphConnect NY 2013

David����������� ������������������  Colebatch����������� ������������������  ����������� ������������������  ����������� ������������������  [email protected]����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  @dcolebatch

Enterprise����������� ������������������  Application����������� ������������������  #fails

Wednesday, 6 November, 13

Page 16: Graph Applications for the Enterprise, FAST - David Colebatch @ GraphConnect NY 2013

David����������� ������������������  Colebatch����������� ������������������  ����������� ������������������  ����������� ������������������  [email protected]����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  @dcolebatch

Often CRUD Only• One screen for each record type

• UI maps to table structure• ...or rather, is constrained by the table structure

Enterprise����������� ������������������  Application����������� ������������������  #fails

Wednesday, 6 November, 13

Page 17: Graph Applications for the Enterprise, FAST - David Colebatch @ GraphConnect NY 2013

David����������� ������������������  Colebatch����������� ������������������  ����������� ������������������  ����������� ������������������  [email protected]����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  @dcolebatch

Relationships to one-degree• “This thing is related to that thing”

• Slow to traverse relationships

• Inhibits discovery by serendipity

Enterprise����������� ������������������  Application����������� ������������������  #fails

Wednesday, 6 November, 13

Page 18: Graph Applications for the Enterprise, FAST - David Colebatch @ GraphConnect NY 2013

Configuration����������� ������������������  Management

Wednesday, 6 November, 13

Page 19: Graph Applications for the Enterprise, FAST - David Colebatch @ GraphConnect NY 2013

David����������� ������������������  Colebatch����������� ������������������  ����������� ������������������  ����������� ������������������  [email protected]����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  @dcolebatch

So����������� ������������������  what’s����������� ������������������  the����������� ������������������  solution?

Wednesday, 6 November, 13

Page 20: Graph Applications for the Enterprise, FAST - David Colebatch @ GraphConnect NY 2013

David����������� ������������������  Colebatch����������� ������������������  ����������� ������������������  ����������� ������������������  [email protected]����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  @dcolebatch

Wednesday, 6 November, 13

Page 21: Graph Applications for the Enterprise, FAST - David Colebatch @ GraphConnect NY 2013

David����������� ������������������  Colebatch����������� ������������������  ����������� ������������������  ����������� ������������������  [email protected]����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  @dcolebatch

Manager/Client:����������� ������������������  ����������� ������������������  “But����������� ������������������  it’s����������� ������������������  new...”

• Only 32% of software projects considered successful

• 44% are considered “challenged”• 24% never get completed

• 50% for project > $1mil

Wednesday, 6 November, 13

Page 22: Graph Applications for the Enterprise, FAST - David Colebatch @ GraphConnect NY 2013

David����������� ������������������  Colebatch����������� ������������������  ����������� ������������������  ����������� ������������������  [email protected]����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  @dcolebatch

Gather Requirements

Define Data Model

Define Security Constraints

Develop Business Logic

Implement API

Implement UI

Test

Training

Acceptance. Go/No Go

Iterate!

Wednesday, 6 November, 13

Page 23: Graph Applications for the Enterprise, FAST - David Colebatch @ GraphConnect NY 2013

David����������� ������������������  Colebatch����������� ������������������  ����������� ������������������  ����������� ������������������  [email protected]����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  @dcolebatch

Gather Requirements

Training

Acceptance. Go/No Go

Iterate!

Define Data Model

Define Security Constraints

Develop Business Logic

Implement API

Implement UI

Test

Wednesday, 6 November, 13

Page 24: Graph Applications for the Enterprise, FAST - David Colebatch @ GraphConnect NY 2013

David����������� ������������������  Colebatch����������� ������������������  ����������� ������������������  ����������� ������������������  [email protected]����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  @dcolebatch

Gather Requirements

Training

Acceptance. Go/No Go

Iterate!

Define Data Model

Define Security Constraints

Develop Business Logic

Implement API

Implement UI

Test

Wednesday, 6 November, 13

Page 25: Graph Applications for the Enterprise, FAST - David Colebatch @ GraphConnect NY 2013

David����������� ������������������  Colebatch����������� ������������������  ����������� ������������������  ����������� ������������������  [email protected]����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  @dcolebatch

So����������� ������������������  what’s����������� ������������������  the����������� ������������������  solution?

Wednesday, 6 November, 13

Page 26: Graph Applications for the Enterprise, FAST - David Colebatch @ GraphConnect NY 2013

David����������� ������������������  Colebatch����������� ������������������  ����������� ������������������  ����������� ������������������  [email protected]����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  @dcolebatch

Wednesday, 6 November, 13

Page 27: Graph Applications for the Enterprise, FAST - David Colebatch @ GraphConnect NY 2013

David����������� ������������������  Colebatch����������� ������������������  ����������� ������������������  ����������� ������������������  [email protected]����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  @dcolebatch

Wednesday, 6 November, 13

Page 28: Graph Applications for the Enterprise, FAST - David Colebatch @ GraphConnect NY 2013

David����������� ������������������  Colebatch����������� ������������������  ����������� ������������������  ����������� ������������������  [email protected]����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  @dcolebatch

The����������� ������������������  xnlogic����������� ������������������  framework

• RESTful API driven application framework• Declare your model, define your business logic• Framework then produces a domain-specific

JSON and xml api

Wednesday, 6 November, 13

Page 29: Graph Applications for the Enterprise, FAST - David Colebatch @ GraphConnect NY 2013

David����������� ������������������  Colebatch����������� ������������������  ����������� ������������������  ����������� ������������������  [email protected]����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  @dcolebatch

Advanced����������� ������������������  Features

• Composable models vs Inheritance• Fine-grained security• History Graph for temporal queries• Multi-tenant: • One framework, multiple applications

• Customer segregation

Wednesday, 6 November, 13

Page 30: Graph Applications for the Enterprise, FAST - David Colebatch @ GraphConnect NY 2013

David����������� ������������������  Colebatch����������� ������������������  ����������� ������������������  ����������� ������������������  [email protected]����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  @dcolebatch

Composable����������� ������������������  Parts

ContactDetails

HasAccounts

HasFriends

HasEmployer

Person

ContactDetails

HasAccounts

Jurisdiction

CorporateDetails

Business

Employer

Wednesday, 6 November, 13

Page 31: Graph Applications for the Enterprise, FAST - David Colebatch @ GraphConnect NY 2013

David����������� ������������������  Colebatch����������� ������������������  ����������� ������������������  ����������� ������������������  [email protected]����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  @dcolebatch

Composable����������� ������������������  Parts

ContactDetails

HasAccounts

HasFriends

HasEmployer

Person

ContactDetails

HasAccounts

Jurisdiction

CorporateDetails

Business

Employer

Wednesday, 6 November, 13

Page 32: Graph Applications for the Enterprise, FAST - David Colebatch @ GraphConnect NY 2013

David����������� ������������������  Colebatch����������� ������������������  ����������� ������������������  ����������� ������������������  [email protected]����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  @dcolebatch

• Composition promotes code reuse (DRY)

• Here, color shows the delta between a Person and a Business model (Hypothetical)

• User permissions are tied to the “Part”

• Parts define properties, relationships, actions and traversals

Wednesday, 6 November, 13

Page 33: Graph Applications for the Enterprise, FAST - David Colebatch @ GraphConnect NY 2013

David����������� ������������������  Colebatch����������� ������������������  ����������� ������������������  ����������� ������������������  [email protected]����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  @dcolebatch

Simple����������� ������������������  Part����������� ������������������  Definitions

module YourApplication module ContactDetails pacer_vertex

property :address, type: :text property :lat, type: :numeric property :lon, type: :numeric endend

module YourApplication module HasEmployer pacer_vertex

to_one :employer endend

Wednesday, 6 November, 13

Page 34: Graph Applications for the Enterprise, FAST - David Colebatch @ GraphConnect NY 2013

David����������� ������������������  Colebatch����������� ������������������  ����������� ������������������  ����������� ������������������  [email protected]����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  @dcolebatch

RESTful����������� ������������������  API

Wednesday, 6 November, 13

Page 35: Graph Applications for the Enterprise, FAST - David Colebatch @ GraphConnect NY 2013

David����������� ������������������  Colebatch����������� ������������������  ����������� ������������������  ����������� ������������������  [email protected]����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  @dcolebatch

Self����������� ������������������  Describing,����������� ������������������  Domain����������� ������������������  Specific����������� ������������������  API

GET /is[ 'contact_details', 'has_accounts', 'has_employer', 'has_friends', 'corporate_details', 'jurisdiction']

GET /model[ 'person', 'business']

PartsThe building blocks of your application

ModelsComposed of Parts

Wednesday, 6 November, 13

Page 36: Graph Applications for the Enterprise, FAST - David Colebatch @ GraphConnect NY 2013

David����������� ������������������  Colebatch����������� ������������������  ����������� ������������������  ����������� ������������������  [email protected]����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  @dcolebatch

Metadata����������� ������������������  Driven

GET /is/contact_details/metadata{ update_access: true, create_access: true, delete_access: true, parts: [ 'record', 'contact_details' ], descriptive_parts: [ 'contact_details' ], properties: { name: { name: 'name', label: 'Name', type: 'text', unit: null, default: null, validations: { allow_blank: true }, part: 'record', index: true },...

Includes: 1)Current-user’s access rights2)Property definitions3)Relationship definitions4)Validation rules5)Actions/Jobs6)Queries/Traversals

Wednesday, 6 November, 13

Page 37: Graph Applications for the Enterprise, FAST - David Colebatch @ GraphConnect NY 2013

David����������� ������������������  Colebatch����������� ������������������  ����������� ������������������  ����������� ������������������  [email protected]����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  @dcolebatch

Built-in����������� ������������������  Documentation

GET /is/contact_details/metadata/doc

Wednesday, 6 November, 13

Page 38: Graph Applications for the Enterprise, FAST - David Colebatch @ GraphConnect NY 2013

David����������� ������������������  Colebatch����������� ������������������  ����������� ������������������  ����������� ������������������  [email protected]����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  @dcolebatch

URLs����������� ������������������  map����������� ������������������  to����������� ������������������  Traversals

GET /model/person/rel/employer[ { meta: { xnid: '/model/business/2028', model_name: 'business', rendered: [ 'record', 'contact_details', ‘has_accounts’, ‘corporate_details’], format: 'partial' }, id: 2028, name: 'Acme Bank', rel: {}, description: 'A very large FI.', created_at: ‘2012-10-02 12:07:31, updated_at: null, address: '88 Fairtrade Blvd., NYC.', lat: '40.755622', lon: '-73.977221', company_url: 'http://www.acme.com', display_name: 'FI - US - ACME' ...},

Returns: 1)All employers of all people

Wednesday, 6 November, 13

Page 39: Graph Applications for the Enterprise, FAST - David Colebatch @ GraphConnect NY 2013

David����������� ������������������  Colebatch����������� ������������������  ����������� ������������������  ����������� ������������������  [email protected]����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  @dcolebatch

Limitless����������� ������������������  Queries

/model/person/filter/name/rel/employer/rel/customer/filter/related_employer ?name[regex]=J.*Bloggs

Wednesday, 6 November, 13

Page 40: Graph Applications for the Enterprise, FAST - David Colebatch @ GraphConnect NY 2013

David����������� ������������������  Colebatch����������� ������������������  ����������� ������������������  ����������� ������������������  [email protected]����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  @dcolebatch

Limitless����������� ������������������  Queries

/model/person/filter/name/rel/employer/rel/customer/filter/related_employer ?name[regex]=J.*Bloggs

Wednesday, 6 November, 13

Page 41: Graph Applications for the Enterprise, FAST - David Colebatch @ GraphConnect NY 2013

David����������� ������������������  Colebatch����������� ������������������  ����������� ������������������  ����������� ������������������  [email protected]����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  @dcolebatch

Limitless����������� ������������������  Queries

/model/person/filter/name/rel/employer/rel/customer/filter/related_employer ?related_employer[id]=972

Wednesday, 6 November, 13

Page 42: Graph Applications for the Enterprise, FAST - David Colebatch @ GraphConnect NY 2013

David����������� ������������������  Colebatch����������� ������������������  ����������� ������������������  ����������� ������������������  [email protected]����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  @dcolebatch

Limitless����������� ������������������  Queries

/model/person/filter/name/rel/employer/rel/customer/filter/related_employer ?related_employer[id]=972

Wednesday, 6 November, 13

Page 43: Graph Applications for the Enterprise, FAST - David Colebatch @ GraphConnect NY 2013

David����������� ������������������  Colebatch����������� ������������������  ����������� ������������������  ����������� ������������������  [email protected]����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  @dcolebatch

Limitless����������� ������������������  Queries

/model/person/filter/name/rel/employer/rel/customer/filter/related_employer ...&related_employer[id]=972

Wednesday, 6 November, 13

Page 44: Graph Applications for the Enterprise, FAST - David Colebatch @ GraphConnect NY 2013

David����������� ������������������  Colebatch����������� ������������������  ����������� ������������������  ����������� ������������������  [email protected]����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  @dcolebatch

So����������� ������������������  What?

Wednesday, 6 November, 13

Page 45: Graph Applications for the Enterprise, FAST - David Colebatch @ GraphConnect NY 2013

David����������� ������������������  Colebatch����������� ������������������  ����������� ������������������  ����������� ������������������  [email protected]����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  @dcolebatch

So����������� ������������������  What?

• Eliminate “infrastructure” development cycles• Bootstrap HTML5 User Interface

Wednesday, 6 November, 13

Page 46: Graph Applications for the Enterprise, FAST - David Colebatch @ GraphConnect NY 2013

David����������� ������������������  Colebatch����������� ������������������  ����������� ������������������  ����������� ������������������  [email protected]����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  @dcolebatch

So����������� ������������������  What?

• Eliminate “infrastructure” development cycles• Bootstrap HTML5 User Interface

• Shorter Time To Market

Wednesday, 6 November, 13

Page 47: Graph Applications for the Enterprise, FAST - David Colebatch @ GraphConnect NY 2013

David����������� ������������������  Colebatch����������� ������������������  ����������� ������������������  ����������� ������������������  [email protected]����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  @dcolebatch

So����������� ������������������  What?

• Eliminate “infrastructure” development cycles• Bootstrap HTML5 User Interface

• Shorter Time To Market• Software Project Risk Reduction

Wednesday, 6 November, 13

Page 48: Graph Applications for the Enterprise, FAST - David Colebatch @ GraphConnect NY 2013

David����������� ������������������  Colebatch����������� ������������������  ����������� ������������������  ����������� ������������������  [email protected]����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  @dcolebatch

So����������� ������������������  What?

• Eliminate “infrastructure” development cycles• Bootstrap HTML5 User Interface

• Shorter Time To Market• Software Project Risk Reduction• Powered by Graph™ - Answer the hard Q’s

Wednesday, 6 November, 13

Page 49: Graph Applications for the Enterprise, FAST - David Colebatch @ GraphConnect NY 2013

David����������� ������������������  Colebatch����������� ������������������  ����������� ������������������  ����������� ������������������  [email protected]����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  @dcolebatch

Quick����������� ������������������  Example

Wednesday, 6 November, 13

Page 50: Graph Applications for the Enterprise, FAST - David Colebatch @ GraphConnect NY 2013

David����������� ������������������  Colebatch����������� ������������������  ����������� ������������������  ����������� ������������������  [email protected]����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  @dcolebatch

Questions?

Wednesday, 6 November, 13

Page 51: Graph Applications for the Enterprise, FAST - David Colebatch @ GraphConnect NY 2013

David����������� ������������������  Colebatch����������� ������������������  ����������� ������������������  ����������� ������������������  @[email protected]����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  

Graph����������� ������������������  Applications����������� ������������������  for����������� ������������������  the����������� ������������������  Enterprise,����������� ������������������  FAST

Wednesday, 6 November, 13

Page 52: Graph Applications for the Enterprise, FAST - David Colebatch @ GraphConnect NY 2013

David����������� ������������������  Colebatch����������� ������������������  ����������� ������������������  ����������� ������������������  [email protected]����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  @dcolebatch

Resources

xnlogic.comgithub.com/pangloss/pacermeetup.com/GraphTO

Wednesday, 6 November, 13