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

Post on 15-Jan-2015

401 views 1 download

Tags:

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.

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

David����������� ������������������  Colebatch����������� ������������������  ����������� ������������������  ����������� ������������������  @dcolebatchdc@xnlogic.com����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  

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

Wednesday, 6 November, 13

David����������� ������������������  Colebatch����������� ������������������  ����������� ������������������  ����������� ������������������  dc@xnlogic.com����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  @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

David����������� ������������������  Colebatch����������� ������������������  ����������� ������������������  ����������� ������������������  dc@xnlogic.com����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  @dcolebatch

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

Wednesday, 6 November, 13

ERPCRM

Accounting

MRPPLM

CMDBAMDB

InventoryExcel

MDM

Wednesday, 6 November, 13

ERPCRM

Accounting

MRPPLM

CMDBAMDB

InventoryExcel

MDM

Wednesday, 6 November, 13

Data complexity

Perfo

rman

ce

SQL database

Requirement of application

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

Wednesday, 6 November, 13

Data complexity

Perfo

rman

ce

SQL database

Requirement of application

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

Wednesday, 6 November, 13

Data complexity

Perfo

rman

ce

SQL database

Requirement of application

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

Salary List

ERP

CRM

Wednesday, 6 November, 13

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

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

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

Wednesday, 6 November, 13

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

Wednesday, 6 November, 13

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

Wednesday, 6 November, 13

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

Wednesday, 6 November, 13

David����������� ������������������  Colebatch����������� ������������������  ����������� ������������������  ����������� ������������������  dc@xnlogic.com����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  @dcolebatch

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

Wednesday, 6 November, 13

David����������� ������������������  Colebatch����������� ������������������  ����������� ������������������  ����������� ������������������  dc@xnlogic.com����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  @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

David����������� ������������������  Colebatch����������� ������������������  ����������� ������������������  ����������� ������������������  dc@xnlogic.com����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  @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

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

Wednesday, 6 November, 13

David����������� ������������������  Colebatch����������� ������������������  ����������� ������������������  ����������� ������������������  dc@xnlogic.com����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  @dcolebatch

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

Wednesday, 6 November, 13

David����������� ������������������  Colebatch����������� ������������������  ����������� ������������������  ����������� ������������������  dc@xnlogic.com����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  @dcolebatch

Wednesday, 6 November, 13

David����������� ������������������  Colebatch����������� ������������������  ����������� ������������������  ����������� ������������������  dc@xnlogic.com����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  @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

David����������� ������������������  Colebatch����������� ������������������  ����������� ������������������  ����������� ������������������  dc@xnlogic.com����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  @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

David����������� ������������������  Colebatch����������� ������������������  ����������� ������������������  ����������� ������������������  dc@xnlogic.com����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  @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

David����������� ������������������  Colebatch����������� ������������������  ����������� ������������������  ����������� ������������������  dc@xnlogic.com����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  @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

David����������� ������������������  Colebatch����������� ������������������  ����������� ������������������  ����������� ������������������  dc@xnlogic.com����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  @dcolebatch

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

Wednesday, 6 November, 13

David����������� ������������������  Colebatch����������� ������������������  ����������� ������������������  ����������� ������������������  dc@xnlogic.com����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  @dcolebatch

Wednesday, 6 November, 13

David����������� ������������������  Colebatch����������� ������������������  ����������� ������������������  ����������� ������������������  dc@xnlogic.com����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  @dcolebatch

Wednesday, 6 November, 13

David����������� ������������������  Colebatch����������� ������������������  ����������� ������������������  ����������� ������������������  dc@xnlogic.com����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  @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

David����������� ������������������  Colebatch����������� ������������������  ����������� ������������������  ����������� ������������������  dc@xnlogic.com����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  @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

David����������� ������������������  Colebatch����������� ������������������  ����������� ������������������  ����������� ������������������  dc@xnlogic.com����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  @dcolebatch

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

ContactDetails

HasAccounts

HasFriends

HasEmployer

Person

ContactDetails

HasAccounts

Jurisdiction

CorporateDetails

Business

Employer

Wednesday, 6 November, 13

David����������� ������������������  Colebatch����������� ������������������  ����������� ������������������  ����������� ������������������  dc@xnlogic.com����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  @dcolebatch

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

ContactDetails

HasAccounts

HasFriends

HasEmployer

Person

ContactDetails

HasAccounts

Jurisdiction

CorporateDetails

Business

Employer

Wednesday, 6 November, 13

David����������� ������������������  Colebatch����������� ������������������  ����������� ������������������  ����������� ������������������  dc@xnlogic.com����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  @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

David����������� ������������������  Colebatch����������� ������������������  ����������� ������������������  ����������� ������������������  dc@xnlogic.com����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  @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

David����������� ������������������  Colebatch����������� ������������������  ����������� ������������������  ����������� ������������������  dc@xnlogic.com����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  @dcolebatch

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

Wednesday, 6 November, 13

David����������� ������������������  Colebatch����������� ������������������  ����������� ������������������  ����������� ������������������  dc@xnlogic.com����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  @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

David����������� ������������������  Colebatch����������� ������������������  ����������� ������������������  ����������� ������������������  dc@xnlogic.com����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  @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

David����������� ������������������  Colebatch����������� ������������������  ����������� ������������������  ����������� ������������������  dc@xnlogic.com����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  @dcolebatch

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

GET /is/contact_details/metadata/doc

Wednesday, 6 November, 13

David����������� ������������������  Colebatch����������� ������������������  ����������� ������������������  ����������� ������������������  dc@xnlogic.com����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  @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

David����������� ������������������  Colebatch����������� ������������������  ����������� ������������������  ����������� ������������������  dc@xnlogic.com����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  @dcolebatch

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

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

Wednesday, 6 November, 13

David����������� ������������������  Colebatch����������� ������������������  ����������� ������������������  ����������� ������������������  dc@xnlogic.com����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  @dcolebatch

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

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

Wednesday, 6 November, 13

David����������� ������������������  Colebatch����������� ������������������  ����������� ������������������  ����������� ������������������  dc@xnlogic.com����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  @dcolebatch

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

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

Wednesday, 6 November, 13

David����������� ������������������  Colebatch����������� ������������������  ����������� ������������������  ����������� ������������������  dc@xnlogic.com����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  @dcolebatch

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

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

Wednesday, 6 November, 13

David����������� ������������������  Colebatch����������� ������������������  ����������� ������������������  ����������� ������������������  dc@xnlogic.com����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  @dcolebatch

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

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

Wednesday, 6 November, 13

David����������� ������������������  Colebatch����������� ������������������  ����������� ������������������  ����������� ������������������  dc@xnlogic.com����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  @dcolebatch

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

Wednesday, 6 November, 13

David����������� ������������������  Colebatch����������� ������������������  ����������� ������������������  ����������� ������������������  dc@xnlogic.com����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  @dcolebatch

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

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

Wednesday, 6 November, 13

David����������� ������������������  Colebatch����������� ������������������  ����������� ������������������  ����������� ������������������  dc@xnlogic.com����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  @dcolebatch

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

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

• Shorter Time To Market

Wednesday, 6 November, 13

David����������� ������������������  Colebatch����������� ������������������  ����������� ������������������  ����������� ������������������  dc@xnlogic.com����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  @dcolebatch

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

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

• Shorter Time To Market• Software Project Risk Reduction

Wednesday, 6 November, 13

David����������� ������������������  Colebatch����������� ������������������  ����������� ������������������  ����������� ������������������  dc@xnlogic.com����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  @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

David����������� ������������������  Colebatch����������� ������������������  ����������� ������������������  ����������� ������������������  dc@xnlogic.com����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  @dcolebatch

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

Wednesday, 6 November, 13

David����������� ������������������  Colebatch����������� ������������������  ����������� ������������������  ����������� ������������������  dc@xnlogic.com����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  @dcolebatch

Questions?

Wednesday, 6 November, 13

David����������� ������������������  Colebatch����������� ������������������  ����������� ������������������  ����������� ������������������  @dcolebatchdc@xnlogic.com����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  

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

Wednesday, 6 November, 13

David����������� ������������������  Colebatch����������� ������������������  ����������� ������������������  ����������� ������������������  dc@xnlogic.com����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  @dcolebatch

Resources

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

Wednesday, 6 November, 13