SlideShare uma empresa Scribd logo
1 de 63
Baixar para ler offline
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

Mais conteúdo relacionado

Mais 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-1Dmitry Makarchuk
 
Hadoop and mysql by Chris Schneider
Hadoop and mysql by Chris SchneiderHadoop and mysql by Chris Schneider
Hadoop and mysql by Chris SchneiderDmitry 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 rDmitry 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 SoudersDmitry 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 HadoopDmitry Makarchuk
 
Jesse Yates: Hbase snapshots patch
Jesse Yates: Hbase snapshots patchJesse Yates: Hbase snapshots patch
Jesse Yates: Hbase snapshots patchDmitry Makarchuk
 
Mongo DB in gaming industry
Mongo DB in gaming industryMongo DB in gaming industry
Mongo DB in gaming industryDmitry Makarchuk
 

Mais 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

Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...FIDO Alliance
 
WSO2CONMay2024OpenSourceConferenceDebrief.pptx
WSO2CONMay2024OpenSourceConferenceDebrief.pptxWSO2CONMay2024OpenSourceConferenceDebrief.pptx
WSO2CONMay2024OpenSourceConferenceDebrief.pptxJennifer Lim
 
AI presentation and introduction - Retrieval Augmented Generation RAG 101
AI presentation and introduction - Retrieval Augmented Generation RAG 101AI presentation and introduction - Retrieval Augmented Generation RAG 101
AI presentation and introduction - Retrieval Augmented Generation RAG 101vincent683379
 
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya HalderCustom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya HalderCzechDreamin
 
Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024Patrick Viafore
 
The UX of Automation by AJ King, Senior UX Researcher, Ocado
The UX of Automation by AJ King, Senior UX Researcher, OcadoThe UX of Automation by AJ King, Senior UX Researcher, Ocado
The UX of Automation by AJ King, Senior UX Researcher, OcadoUXDXConf
 
Syngulon - Selection technology May 2024.pdf
Syngulon - Selection technology May 2024.pdfSyngulon - Selection technology May 2024.pdf
Syngulon - Selection technology May 2024.pdfSyngulon
 
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)Julian Hyde
 
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...FIDO Alliance
 
Structuring Teams and Portfolios for Success
Structuring Teams and Portfolios for SuccessStructuring Teams and Portfolios for Success
Structuring Teams and Portfolios for SuccessUXDXConf
 
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...FIDO Alliance
 
Free and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
Free and Effective: Making Flows Publicly Accessible, Yumi IbrahimzadeFree and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
Free and Effective: Making Flows Publicly Accessible, Yumi IbrahimzadeCzechDreamin
 
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdfHow Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdfFIDO Alliance
 
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo DiehlFuture Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo DiehlPeter Udo Diehl
 
Intro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджераIntro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджераMark Opanasiuk
 
Powerful Start- the Key to Project Success, Barbara Laskowska
Powerful Start- the Key to Project Success, Barbara LaskowskaPowerful Start- the Key to Project Success, Barbara Laskowska
Powerful Start- the Key to Project Success, Barbara LaskowskaCzechDreamin
 
ECS 2024 Teams Premium - Pretty Secure
ECS 2024   Teams Premium - Pretty SecureECS 2024   Teams Premium - Pretty Secure
ECS 2024 Teams Premium - Pretty SecureFemke de Vroome
 
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...CzechDreamin
 
Designing for Hardware Accessibility at Comcast
Designing for Hardware Accessibility at ComcastDesigning for Hardware Accessibility at Comcast
Designing for Hardware Accessibility at ComcastUXDXConf
 
Top 10 Symfony Development Companies 2024
Top 10 Symfony Development Companies 2024Top 10 Symfony Development Companies 2024
Top 10 Symfony Development Companies 2024TopCSSGallery
 

Último (20)

Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
 
WSO2CONMay2024OpenSourceConferenceDebrief.pptx
WSO2CONMay2024OpenSourceConferenceDebrief.pptxWSO2CONMay2024OpenSourceConferenceDebrief.pptx
WSO2CONMay2024OpenSourceConferenceDebrief.pptx
 
AI presentation and introduction - Retrieval Augmented Generation RAG 101
AI presentation and introduction - Retrieval Augmented Generation RAG 101AI presentation and introduction - Retrieval Augmented Generation RAG 101
AI presentation and introduction - Retrieval Augmented Generation RAG 101
 
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya HalderCustom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
 
Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024
 
The UX of Automation by AJ King, Senior UX Researcher, Ocado
The UX of Automation by AJ King, Senior UX Researcher, OcadoThe UX of Automation by AJ King, Senior UX Researcher, Ocado
The UX of Automation by AJ King, Senior UX Researcher, Ocado
 
Syngulon - Selection technology May 2024.pdf
Syngulon - Selection technology May 2024.pdfSyngulon - Selection technology May 2024.pdf
Syngulon - Selection technology May 2024.pdf
 
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
 
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
 
Structuring Teams and Portfolios for Success
Structuring Teams and Portfolios for SuccessStructuring Teams and Portfolios for Success
Structuring Teams and Portfolios for Success
 
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
 
Free and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
Free and Effective: Making Flows Publicly Accessible, Yumi IbrahimzadeFree and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
Free and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
 
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdfHow Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
 
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo DiehlFuture Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
 
Intro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджераIntro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджера
 
Powerful Start- the Key to Project Success, Barbara Laskowska
Powerful Start- the Key to Project Success, Barbara LaskowskaPowerful Start- the Key to Project Success, Barbara Laskowska
Powerful Start- the Key to Project Success, Barbara Laskowska
 
ECS 2024 Teams Premium - Pretty Secure
ECS 2024   Teams Premium - Pretty SecureECS 2024   Teams Premium - Pretty Secure
ECS 2024 Teams Premium - Pretty Secure
 
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
 
Designing for Hardware Accessibility at Comcast
Designing for Hardware Accessibility at ComcastDesigning for Hardware Accessibility at Comcast
Designing for Hardware Accessibility at Comcast
 
Top 10 Symfony Development Companies 2024
Top 10 Symfony Development Companies 2024Top 10 Symfony Development Companies 2024
Top 10 Symfony Development Companies 2024
 

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