SlideShare una empresa de Scribd logo
1 de 63
Descargar para leer sin conexión
Data modeling
                             . . . with graphs

                                         @PeterBell
Wednesday, November 28, 12
-   Terminology
                             -   Examples
                             -   Patterns
                             -   Key takeaways



Agenda
Wednesday, November 28, 12
Terminology




Wednesday, November 28, 12
relational database

                                    tables
                                   columns
                                   records
                                 foreign keys



Wednesday, November 28, 12
Wednesday, November 28, 12
neo4j

                                 nodes
                             relationships
                              properties



Wednesday, November 28, 12
Wednesday, November 28, 12
Wednesday, November 28, 12
indexes




Wednesday, November 28, 12
Wednesday, November 28, 12
indexes




Wednesday, November 28, 12
traversals




Wednesday, November 28, 12
Wednesday, November 28, 12
Wednesday, November 28, 12
Wednesday, November 28, 12
Cypher




Wednesday, November 28, 12
OO language - domain objects
                             Object (graph|relational) mapping

           Java domain objects                    Java domain objects
                 Hibernate                         Spring Data Neo4j
                   SQL                                   Cypher
         Tables/rows/columns/FKs              Nodes/relationships/properties

Wednesday, November 28, 12
Examples




Wednesday, November 28, 12
Wednesday, November 28, 12
Wednesday, November 28, 12
Article
    CATEGORIZED_UNDER                          WRITTEN_BY

                               ADDED_TO
                Category                            Author
                                   Comment
                             WRITTEN_BY
                                                 FOLLOWS
                                   Commenter


Wednesday, November 28, 12
Geographic




Wednesday, November 28, 12
Bioinformatic




Wednesday, November 28, 12
Patterns




Wednesday, November 28, 12
start with a whiteboard




Wednesday, November 28, 12
Wednesday, November 28, 12
Handling entities




Wednesday, November 28, 12
...provide a familiar and consistent Spring
                             based programming model while retaining
                                store specific features and capabilities
Wednesday, November 28, 12
Wednesday, November 28, 12
Restaurant
                                         - name
                                         - address
                                         - cuisine



                                              - comment
                             RECOMMENDS_THE
                                              - rating


                                          User
                                        - first_name
                                        - last_name

Wednesday, November 28, 12
Wednesday, November 28, 12
Wednesday, November 28, 12
Restaurant
                                        - name
                                        - address
                                        - cuisine



                             RECOMMENDS_A - comment
                                             - rating


                                         User
                                       - first_name
                                       - last_name

Wednesday, November 28, 12
Restaurant         SERVES
                                  - name                    Cuisine
                                  - address



                                       - comment
                      RECOMMENDS_THE
                                       - rating


                                   User
                                 - first_name
                                 - last_name

Wednesday, November 28, 12
SERVES
                                    Taj Mahal                      Indian cuisine



                                          - “Great garlic nan and tandoori”
                             RECOMMENDS
                                          - 4/5




                                    Fred Jones

Wednesday, November 28, 12
read sentences from graph




Wednesday, November 28, 12
Wednesday, November 28, 12
Indexes for starting points




Wednesday, November 28, 12
User
                             - email_address
                             - first_name
                             - last_name




Wednesday, November 28, 12
Relationships for querying




Wednesday, November 28, 12
User
                                        - email_address
                                        - first_name
                                        - last_name
                                        - shipping_state



                             Select * where shipping_state = ‘Ca’?

Wednesday, November 28, 12
User                   State
                       - email_address   LIVES_IN   - name
                       - first_name
                                                    - code
                       - last_name




Wednesday, November 28, 12
Jess
                                      LIVES_IN


                                               California
                                                            LIVES_IN

                                    LIVES_IN
                                                                  Andreas

                                      Andrew


Wednesday, November 28, 12
Use meaningful names




Wednesday, November 28, 12
Language         Country
                             - language_id
                                             - country_id
                             - name
                                             - name
                             - word count
                                             - flag url
                             - country_id




Wednesday, November 28, 12
Language     LanguageCountry     Country
                  - language_id   - language_id     - country_id
                  - name          - country_id      - name
                  - word count    - spoken_since    - flag url




Wednesday, November 28, 12
Language     LanguageCountry     Country
                  - language_id   - language_id     - country_id
                  - name          - country_id      - name
                  - word count    - spoken_since    - flag url




Wednesday, November 28, 12
Language                     Country
                                     IS_SPOKEN_IN
                      - name                        - name
                      - word count                  - flag url




Wednesday, November 28, 12
Language                       Country
                                       IS_SPOKEN_IN
                      - name                          - name
                      - word count                    - flag url




                                SIMILAR_TO      ADJACENT_TO
Wednesday, November 28, 12
Anti-Patterns




Wednesday, November 28, 12
Hefty nodes




Wednesday, November 28, 12
User


                             - first_name
                                               - ship_address
                             - last_name
                                               - ship_city
                             - email_address
                                               - ship_state
                             - bill_address
                                               - ship_zip
                             - bill_city
                                               - regular_customer
                             - bill_state
                             - bill_zip




Wednesday, November 28, 12
BILLS_TO     Address
                             User
                 - first_name                     - street_address
                 - last_name                     - city
                 - email_address                 - state
                 - regular_customer   SHIPS_TO   - zip




Wednesday, November 28, 12
BILLS_TO
                             User                       Address
                   - first_name                        - street_address
                   - last_name             SHIPS_TO   - city
                   - email_address                    - state
                                                      - zip

                                    IS_A


            Regular customer
Wednesday, November 28, 12
Jess
                                      IS_A

                                             Regular
                                             customer   IS_A
                                     IS_A
                                                               Andreas

                                    Andrew


Wednesday, November 28, 12
Missing nodes




Wednesday, November 28, 12
EMAILED
                             Peter             Jim




Wednesday, November 28, 12
SENT           TO
                             Peter          Email        Jim




Wednesday, November 28, 12
Hot node




Wednesday, November 28, 12
Wednesday, November 28, 12
Key takeaways




Wednesday, November 28, 12
Indexes for starting points
                               Relationships for queries
                             Read sentences from the graph
                               Look out for verb’d nouns



Wednesday, November 28, 12
- Indexes for starting points
                             - Relationships for queries
                             - Read sentences from the graph
                             - Look out for verb’d nouns




Data modeling with graphs                        @PeterBell
Wednesday, November 28, 12

Más contenido relacionado

Más de Dmitry Makarchuk

2012 11-28 rich web data modeling with graphs-1
2012 11-28 rich web data modeling with graphs-12012 11-28 rich web data modeling with graphs-1
2012 11-28 rich web data modeling with graphs-1
Dmitry Makarchuk
 
Hadoop and mysql by Chris Schneider
Hadoop and mysql by Chris SchneiderHadoop and mysql by Chris Schneider
Hadoop and mysql by Chris Schneider
Dmitry Makarchuk
 
A random forest approach to skin detection with r
A random forest approach to skin detection with rA random forest approach to skin detection with r
A random forest approach to skin detection with r
Dmitry Makarchuk
 
"Your script just killed my site" by Steve Souders
"Your script just killed my site" by Steve Souders"Your script just killed my site" by Steve Souders
"Your script just killed my site" by Steve Souders
Dmitry Makarchuk
 
RBrowserPlugin Project (Gabriel Becker)
RBrowserPlugin Project (Gabriel Becker)RBrowserPlugin Project (Gabriel Becker)
RBrowserPlugin Project (Gabriel Becker)
Dmitry Makarchuk
 
Builiding analytical apps on Hadoop
Builiding analytical apps on HadoopBuiliding analytical apps on Hadoop
Builiding analytical apps on Hadoop
Dmitry Makarchuk
 
Jesse Yates: Hbase snapshots patch
Jesse Yates: Hbase snapshots patchJesse Yates: Hbase snapshots patch
Jesse Yates: Hbase snapshots patch
Dmitry Makarchuk
 
Mongo DB in gaming industry
Mongo DB in gaming industryMongo DB in gaming industry
Mongo DB in gaming industry
Dmitry Makarchuk
 

Más de Dmitry Makarchuk (11)

Linzer slides-barug
Linzer slides-barugLinzer slides-barug
Linzer slides-barug
 
2012 11-28 rich web data modeling with graphs-1
2012 11-28 rich web data modeling with graphs-12012 11-28 rich web data modeling with graphs-1
2012 11-28 rich web data modeling with graphs-1
 
Hadoop and mysql by Chris Schneider
Hadoop and mysql by Chris SchneiderHadoop and mysql by Chris Schneider
Hadoop and mysql by Chris Schneider
 
A random forest approach to skin detection with r
A random forest approach to skin detection with rA random forest approach to skin detection with r
A random forest approach to skin detection with r
 
"Your script just killed my site" by Steve Souders
"Your script just killed my site" by Steve Souders"Your script just killed my site" by Steve Souders
"Your script just killed my site" by Steve Souders
 
RBrowserPlugin Project (Gabriel Becker)
RBrowserPlugin Project (Gabriel Becker)RBrowserPlugin Project (Gabriel Becker)
RBrowserPlugin Project (Gabriel Becker)
 
Bridge to r
Bridge to rBridge to r
Bridge to r
 
Builiding analytical apps on Hadoop
Builiding analytical apps on HadoopBuiliding analytical apps on Hadoop
Builiding analytical apps on Hadoop
 
Jesse Yates: Hbase snapshots patch
Jesse Yates: Hbase snapshots patchJesse Yates: Hbase snapshots patch
Jesse Yates: Hbase snapshots patch
 
Phoenix h basemeetup
Phoenix h basemeetupPhoenix h basemeetup
Phoenix h basemeetup
 
Mongo DB in gaming industry
Mongo DB in gaming industryMongo DB in gaming industry
Mongo DB in gaming industry
 

Último

Último (20)

Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 

2012 11-28 rich web data modeling with graphs-1