Skip to content

Instantly share code, notes, and snippets.

@jdavidmitchell
Last active August 29, 2015 14:02
Show Gist options
  • Save jdavidmitchell/7899bdcce3ad2d2ebecc to your computer and use it in GitHub Desktop.
Save jdavidmitchell/7899bdcce3ad2d2ebecc to your computer and use it in GitHub Desktop.
= Configuration Management
Shilpa Manchala <shilpa.manchala@equifax.com>
John David Mitchell <david.mitchell@equifax.com>
Quang Le <quang.le@equifax.com>
v1.0, 2014/06/12
== About You
We work at IXI Services, a division of Equifax. This is a solution to our company wide Hackathon using a Graph Database.
== Introduction to Problem
Sofware components and products externalize their configuration to support environmental differences and customize the user behavior without requiring code modifications and/or repackaging. If different teams are involved in building a platform and fulfilling a customer specific solution (professional services), then there is also a set of predefined configurations that are provided out of the box from the platform team to the fulfillment team. The fulfillment teams just need to override a subset of those configurations.
Historically, each application team is responsible for building the capabilities around externalizing and managing these configurations which has resulted in multiple implementations at various degrees of maturity and flexibility. We can benefit from building a reusable set of assets that could be leveraged by multiple Business Units.
== Explanation of Solution
We will be building a Configuration Management tool that will make it easy for our <users> to create and modify all Configuration Items for the FooBar application.
== How Graph Database can help
blah, blah, blah
== Configuration Management Tool Data Model
image of data model goes here
== Setup
Intialize the graph with the initial Configuration Data for the Order Management Feature in the FooBar application.
//hide
//setup
//output
[source,cypher]
----
CREATE (foobar:application {name: 'foobar'})
CREATE (default_acro:datasource {name: 'default acro', ip: '172.1.1.12', port: 27000, member_number:'', security_code:'', scores: '', type:'base'} )
CREATE (default_sbe:datasource {name: 'default sbe', ip: '172.223.12.1', port: 8934, service_code:'SSBD', transaction_id:'XSOF', customer_number: '', security_code: '', type:'base'} )
CREATE (foobar)-[:USES_DATASOURCE]->(default_acro)
CREATE (foobar)-[:USES_DATASOURCE]->(default_sbe)
CREATE (sbe_scranton:datasource {name: 'SBE Scranton', customer_number: '999ZSQ1645', security_code: 'BX6'} )
CREATE (acro_scranton:datasource {name: 'ACRO Scranton', member_number: '7X2345TW', security_code: 'XUZ', scores: 'Vantage, FICO'} )
CREATE (sbe_newyork:datasource {name: 'SBE NewYork', security_code: 'J76'})
CREATE (acro_albany:datasource {name: 'ACRO NewYork', member_number: '88889TC', security_code: 'YZA', scores: 'Vantage'})
CREATE (acro_scranton)-[:INHERITS]->(default_acro)
CREATE (sbe_scranton)-[:INHERITS]->(default_sbe)
CREATE (sbe_newyork)-[:INHERITS]->(sbe_scranton)
CREATE (acro_albany)-[:INHERITS]->(acro_scranton)
CREATE (scranton:customer{name: 'Scranton_Dunder', type:'Head Office', city: 'Scranton', state: 'PA'})
CREATE (newyork:customer{name: 'NewYork_Dunder', type:'Branch Office', city: 'New York', state: 'NY'})
CREATE (nashua:customer{name: 'Nashua_Dunder', type:'Branch Office', city: 'Nashua', state: 'NH'})
CREATE (akron:customer{name: 'Akron_Dunder', type:'Branch Office', city: 'Akron', state: 'OH'})
CREATE (albany:customer{name: 'Albany_Dunder', type:'Branch Office', city: 'Albany', state: 'NY'})
CREATE (utica:customer{name: 'Utica_Dunder', type:'Head Office', city: 'Utica', state: 'NY'})
CREATE (scranton)-[:USES_DATASOURCE]->(acro_scranton)
CREATE (scranton)-[:USES_DATASOURCE]->(sbe_scranton)
CREATE (newyork)-[:USES_DATASOURCE]->(sbe_newyork)
CREATE (albany)-[:USES_DATASOURCE]->(acro_albany)
CREATE (albany)-[:IS_BRANCH_OF]->(newyork)
CREATE (utica)-[:IS_BRANCH_OF]->(newyork)
CREATE (newyork)-[:IS_BRANCH_OF]->(scranton)
CREATE (akron)-[:IS_BRANCH_OF]->(scranton)
CREATE (nashua)-[:IS_BRANCH_OF]->(scranton)
CREATE (scranton_products:products {name: 'scranton_products', products: ['Paper', 'Benders', 'Labels', 'Envelopes']})
CREATE (nashua_products:products {name: 'nashua_products', products: ['Paper', 'Labels']})
CREATE (utica_products:products {name: 'utica_products', products: ['Forms', 'Filing Supplies']})
CREATE (utica_products)-[:INHERITS]->(scranton_products)
CREATE (scranton)-[:INHERITS]->(scranton_products)
CREATE (nashua)-[:INHERITS]->(nashua_products)
CREATE (utica)-[:INHERITS]->(utica_products)
CREATE (u1:user { name : 'Bob', type:'developer' } )
CREATE (u2:user { name : 'Alice', type:'support' } )
----
//graph
=== Find list of Products that The Dunder Milfin Head Office in Scranton, PA sells
=== returns stanton products
[source,cypher]
----
match (c:customer{city: 'Scranton', state:'PA'})-[:SELLS_PRODUCTS]->(p) with c, p optional match (p)-[:IN_ADDITION_TO]->(p2) return c.name, p.products, p2.products
----
//table
=== Find list of Products that The Dunder Milfin Head Office in Utica, New York sells
=== returns utica and stanton products
[source,cypher]
----
match (c:customer{city: 'Utica', state:'NY'})-[:SELLS_PRODUCTS]->(p) with c, p optional match (p)-[:IN_ADDITION_TO]->(p2) return c.name, p.products, p2.products
----
//table
=== Get Acro datasource for Albany, NY
=== return Albany Acro and base
[source,cypher]
----
match (c:customer{city: 'Albany', state:'NY'})-[:USES_DATASOURCE]->(d) with c, d optional match (d)-[:INHERITS*1..]->(b) return c.name, d, collect(b)
----
//table
=== Get Datasource for Utica, NY
[source,cypher]
----
match (c:customer{city: 'Utica', state:'NY'})-[rels*1..]->(d) where all(r in rels where type(r) = 'IS_BRANCH_OF' or type(r) = 'SELLS_PRODUCTS') with c, d optional match(d)-[rels*1..]->(b) where all(r in rels where type(r) = 'USES_DATASOURCE' or type(r) = 'INHERITS') return c as branch, collect(b) as configuration_items
----
//table
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment