SlideShare uma empresa Scribd logo
1 de 36
Baixar para ler offline
Your network is more powerful than you think



Neo4J au cœur du graphe social
    de 45 millions de membres


                                    Viadeo Tech Days
                     Les 20, 21 et 22 novembre 2012

                                                       1
ABOUT THE VIADEO GROUP



                                               • 1 million new members /
                                                 month

                                               • 10 million connexions /
                                                 month

                                               • 100 million profiles
                                                 viewed / month




Your network is more powerful than you think                            2 / 36
GRAPHS ARE EVERYWHERE
GRAPHS ARE EVERYWHERE




Your network is more powerful than you think       4 / 36
GRAPHS ARE EVERYWHERE




Your network is more powerful than you think       5 / 36
GRAPHS ARE EVERYWHERE




                                               © Air France / KLM




Your network is more powerful than you think              6 / 36
GRAPHS ARE EVERYWHERE




Your network is more powerful than you think       7 / 36
SOCIAL GRAPH
SOCIAL GRAPH




                                          Nodes




                                          Relationships




Your network is more powerful than you think                       9 / 36
SOCIAL GRAPH




                                               Direct contacts




Your network is more powerful than you think                     10 / 36
SOCIAL GRAPH




                                               Level 2 contacts




Your network is more powerful than you think                  11 / 36
SOCIAL GRAPH


                                                     Path
                                                  Distance 3




                                                            Path
                                                         Distance 4




Your network is more powerful than you think                     12 / 36
PREHISTORY
2006 - 2011
PREHISTORY 2006-2011



     • In-house algorithm

     • Network storage in MySQL Database




                    CREATE TABLE `Network` (
                      `memberId` int(11) NOT NULL DEFAULT '0',
                      `L1` mediumblob NOT NULL,
                      `L2` mediumblob NOT NULL,
                    PRIMARY KEY (`memberId`)
                    ) ENGINE=InnoDB;




Your network is more powerful than you think                 14 / 36
PREHISTORY 2006-2011



        Update the network (old-fashioned style)

        Member A and Member B are now in contacts

           Update of A.L1 + B.L1 and A.L2 + B.L2
           Retrieving A.L1 + B.L1 and update *.L2

        Example:
        • A has 500 contacts
        • B has 150 contacts
          500 + 150 + 2 = 652 updates!




Your network is more powerful than you think              15 / 36
PREHISTORY 2006-2011




              Good performances on
                      Computation of Paths

                      Computation of Distances




Your network is more powerful than you think              16 / 36
PREHISTORY 2006-2011



                                        =




                                               =




Your network is more powerful than you think                17 / 36
PREHISTORY 2006-2011


      LIMITATIONS

      1) Important latency for complete update



                                          2) Massive bandwidth impact
                                          for internal network




                  3) 48 hours to restart
                          from scratch


Your network is more powerful than you think                       18 / 36
GRAPH DATABASE
GRAPH DATABASE

                                                                                                               Name: Graham Greene
  Name: Graham Greene                Title: Tinker, Soldier, Spy                Title: Our man in Havana       Born: 02-10-1904
  Born: 19-10-1932                   Published: 1974                            Published: 1958                Died: 02-04-1991



           1            WROTE                    2                                         4               WROTE        3

                                                     RECOMMENDED
                                                     Date: 09-09-2011

                            RECOMMENDED                                           RECOMMENDED
                            Date: 05-07-2011                                      Date: 03-02-2011



                        6                                                   5

                  Name: Alan                                            Name: Ian




                                                                                                                   © Ian Robinson



Your network is more powerful than you think                                                                              20 / 36
GRAPH DATABASE

                                                                                                               Name: Graham Greene
  Name: Graham Greene                Title: Tinker, Soldier, Spy                Title: Our man in Havana       Born: 02-10-1904
  Born: 19-10-1932                   Published: 1974                            Published: 1958                Died: 02-04-1991



           1            WROTE                    2                                         4               WROTE        3

                                                     RECOMMENDED
                                                     Date: 09-09-2011

                            RECOMMENDED                                           RECOMMENDED
                            Date: 05-07-2011                                      Date: 03-02-2011
                                                                                                                    Nodes
                        6                                                   5

                  Name: Alan                                            Name: Ian




                                                                                                                   © Ian Robinson



Your network is more powerful than you think                                                                              21 / 36
GRAPH DATABASE

                                                                                                               Name: Graham Greene
  Name: Graham Greene                Title: Tinker, Soldier, Spy                Title: Our man in Havana       Born: 02-10-1904
  Born: 19-10-1932                   Published: 1974                            Published: 1958                Died: 02-04-1991



           1            WROTE                    2                                         4               WROTE        3

                                                     RECOMMENDED
                                                     Date: 09-09-2011

                            RECOMMENDED                                           RECOMMENDED
                            Date: 05-07-2011                                      Date: 03-02-2011
                                                                                                                    Nodes
                        6                                                   5                                  Relationships

                  Name: Alan                                            Name: Ian




                                                                                                                   © Ian Robinson



Your network is more powerful than you think                                                                              22 / 36
GRAPH DATABASE

                                                                                                               Name: Graham Greene
  Name: Graham Greene                Title: Tinker, Soldier, Spy                Title: Our man in Havana       Born: 02-10-1904
  Born: 19-10-1932                   Published: 1974                            Published: 1958                Died: 02-04-1991



           1            WROTE                    2                                         4               WROTE        3

                                                     RECOMMENDED
                                                     Date: 09-09-2011

                            RECOMMENDED                                           RECOMMENDED
                            Date: 05-07-2011                                      Date: 03-02-2011
                                                                                                                     Nodes
                        6                                                   5                                  Relationships

                  Name: Alan                                            Name: Ian                                  Properties


                                                                                                                    © Ian Robinson



Your network is more powerful than you think                                                                              23 / 36
WHY NEO4J
WHY Neo4J

      Findings after POC on 3 other tools:
      • Old technology with add-on for graph management
      • No user communities
      • Bad performance
      • “Black Box” code


      Why                ?
      • OpenSource project
      • Good documentation
      • User community
      • Excellent performance
      • ACID
      • Very simple
      • (How to better model a Social Graph than with a
        Graph database ?!?)

Your network is more powerful than you think              25 / 36
WHY Neo4J


   1 node = 1 member                             1 Relationship
                                               = 1 direct contact




Your network is more powerful than you think                   26 / 36
WHY Neo4J

                      BENEFITS

                                    Very easy to integrate
                                      (less than 2 months)

                     Instantaneous
                     graph updates



                                           High Availability

                     Backup /
                     Restore




Your network is more powerful than you think                        27 / 36
LIMITATION
LIMITATION

          Doesn’t handle SHARDING!
          (Split one graph onto several servers)

                                      « Size doesn’t matter… », but…

                                                  Server 1     Server 2




Your network is more powerful than you think                              29 / 36
EXPLORATION MODE
EXPLORATION MODE




            What for the future?
                Store various kind of objects

                Change the development paradigm




Your network is more powerful than you think               31 / 36
EXPLORATION MODE




Your network is more powerful than you think               32 / 36
EXPLORATION MODE




Your network is more powerful than you think               33 / 36
CONCLUSION
CONCLUSION


      Neo4J:
        Has replaced a 5-year-old in-house technology in only 2
        months

        Supports the core system of the Viadeo Professional Social
        Network

        Has been in production for 1 year ½

        Deals smoothly with Viadeo’s usage growth

      Think about how Neo4J will improve your own business!




Your network is more powerful than you think                         35 / 36
Neo4j au coeur du graphe social de 45 millions de membres par Nicolas Tricot

Mais conteúdo relacionado

Mais de Olivier DASINI

MySQL Document Store for Modern Applications
MySQL Document Store for Modern ApplicationsMySQL Document Store for Modern Applications
MySQL Document Store for Modern ApplicationsOlivier DASINI
 
MySQL Performance Best Practices
MySQL Performance Best PracticesMySQL Performance Best Practices
MySQL Performance Best PracticesOlivier DASINI
 
MySQL 8.0.22 - New Features Summary
MySQL 8.0.22 - New Features SummaryMySQL 8.0.22 - New Features Summary
MySQL 8.0.22 - New Features SummaryOlivier DASINI
 
MySQL Database Service - 100% Developed, Managed and Supported by the MySQL Team
MySQL Database Service - 100% Developed, Managed and Supported by the MySQL TeamMySQL Database Service - 100% Developed, Managed and Supported by the MySQL Team
MySQL Database Service - 100% Developed, Managed and Supported by the MySQL TeamOlivier DASINI
 
Upgrade from MySQL 5.7 to MySQL 8.0
Upgrade from MySQL 5.7 to MySQL 8.0Upgrade from MySQL 5.7 to MySQL 8.0
Upgrade from MySQL 5.7 to MySQL 8.0Olivier DASINI
 
MySQL 8.0.21 - New Features Summary
MySQL 8.0.21 - New Features SummaryMySQL 8.0.21 - New Features Summary
MySQL 8.0.21 - New Features SummaryOlivier DASINI
 
MySQL 8.0.19 - New Features Summary
MySQL 8.0.19 - New Features SummaryMySQL 8.0.19 - New Features Summary
MySQL 8.0.19 - New Features SummaryOlivier DASINI
 
MySQL 8.0.18 - New Features Summary
MySQL 8.0.18 - New Features SummaryMySQL 8.0.18 - New Features Summary
MySQL 8.0.18 - New Features SummaryOlivier DASINI
 
MySQL 8.0.17 - New Features Summary
MySQL 8.0.17 - New Features SummaryMySQL 8.0.17 - New Features Summary
MySQL 8.0.17 - New Features SummaryOlivier DASINI
 
MySQL 8.0.16 New Features Summary
MySQL 8.0.16 New Features SummaryMySQL 8.0.16 New Features Summary
MySQL 8.0.16 New Features SummaryOlivier DASINI
 
MySQL Day Paris 2018 - Introduction & The State of the Dolphin
MySQL Day Paris 2018 - Introduction & The State of the DolphinMySQL Day Paris 2018 - Introduction & The State of the Dolphin
MySQL Day Paris 2018 - Introduction & The State of the DolphinOlivier DASINI
 
MySQL Day Paris 2018 - MySQL & GDPR; Privacy and Security requirements
MySQL Day Paris 2018 - MySQL & GDPR; Privacy and Security requirementsMySQL Day Paris 2018 - MySQL & GDPR; Privacy and Security requirements
MySQL Day Paris 2018 - MySQL & GDPR; Privacy and Security requirementsOlivier DASINI
 
MySQL Day Paris 2018 - Upgrade from MySQL 5.7 to MySQL 8.0
MySQL Day Paris 2018 - Upgrade from MySQL 5.7 to MySQL 8.0MySQL Day Paris 2018 - Upgrade from MySQL 5.7 to MySQL 8.0
MySQL Day Paris 2018 - Upgrade from MySQL 5.7 to MySQL 8.0Olivier DASINI
 
MySQL Day Paris 2018 - MySQL InnoDB Cluster; A complete High Availability sol...
MySQL Day Paris 2018 - MySQL InnoDB Cluster; A complete High Availability sol...MySQL Day Paris 2018 - MySQL InnoDB Cluster; A complete High Availability sol...
MySQL Day Paris 2018 - MySQL InnoDB Cluster; A complete High Availability sol...Olivier DASINI
 
MySQL Day Paris 2018 - MySQL JSON Document Store
MySQL Day Paris 2018 - MySQL JSON Document StoreMySQL Day Paris 2018 - MySQL JSON Document Store
MySQL Day Paris 2018 - MySQL JSON Document StoreOlivier DASINI
 
MySQL Day Paris 2018 - What’s New in MySQL 8.0 ?
MySQL Day Paris 2018 - What’s New in MySQL 8.0 ?MySQL Day Paris 2018 - What’s New in MySQL 8.0 ?
MySQL Day Paris 2018 - What’s New in MySQL 8.0 ?Olivier DASINI
 
MySQL 8.0, what's new ? - Forum PHP 2018
MySQL 8.0, what's new ? - Forum PHP 2018MySQL 8.0, what's new ? - Forum PHP 2018
MySQL 8.0, what's new ? - Forum PHP 2018Olivier DASINI
 
MySQL JSON Document Store - A Document Store with all the benefits of a Trans...
MySQL JSON Document Store - A Document Store with all the benefits of a Trans...MySQL JSON Document Store - A Document Store with all the benefits of a Trans...
MySQL JSON Document Store - A Document Store with all the benefits of a Trans...Olivier DASINI
 
MySQL 8.0 - What's New ?
MySQL 8.0 - What's New ?MySQL 8.0 - What's New ?
MySQL 8.0 - What's New ?Olivier DASINI
 
MySQL Document Store - A Document Store with all the benefts of a Transactona...
MySQL Document Store - A Document Store with all the benefts of a Transactona...MySQL Document Store - A Document Store with all the benefts of a Transactona...
MySQL Document Store - A Document Store with all the benefts of a Transactona...Olivier DASINI
 

Mais de Olivier DASINI (20)

MySQL Document Store for Modern Applications
MySQL Document Store for Modern ApplicationsMySQL Document Store for Modern Applications
MySQL Document Store for Modern Applications
 
MySQL Performance Best Practices
MySQL Performance Best PracticesMySQL Performance Best Practices
MySQL Performance Best Practices
 
MySQL 8.0.22 - New Features Summary
MySQL 8.0.22 - New Features SummaryMySQL 8.0.22 - New Features Summary
MySQL 8.0.22 - New Features Summary
 
MySQL Database Service - 100% Developed, Managed and Supported by the MySQL Team
MySQL Database Service - 100% Developed, Managed and Supported by the MySQL TeamMySQL Database Service - 100% Developed, Managed and Supported by the MySQL Team
MySQL Database Service - 100% Developed, Managed and Supported by the MySQL Team
 
Upgrade from MySQL 5.7 to MySQL 8.0
Upgrade from MySQL 5.7 to MySQL 8.0Upgrade from MySQL 5.7 to MySQL 8.0
Upgrade from MySQL 5.7 to MySQL 8.0
 
MySQL 8.0.21 - New Features Summary
MySQL 8.0.21 - New Features SummaryMySQL 8.0.21 - New Features Summary
MySQL 8.0.21 - New Features Summary
 
MySQL 8.0.19 - New Features Summary
MySQL 8.0.19 - New Features SummaryMySQL 8.0.19 - New Features Summary
MySQL 8.0.19 - New Features Summary
 
MySQL 8.0.18 - New Features Summary
MySQL 8.0.18 - New Features SummaryMySQL 8.0.18 - New Features Summary
MySQL 8.0.18 - New Features Summary
 
MySQL 8.0.17 - New Features Summary
MySQL 8.0.17 - New Features SummaryMySQL 8.0.17 - New Features Summary
MySQL 8.0.17 - New Features Summary
 
MySQL 8.0.16 New Features Summary
MySQL 8.0.16 New Features SummaryMySQL 8.0.16 New Features Summary
MySQL 8.0.16 New Features Summary
 
MySQL Day Paris 2018 - Introduction & The State of the Dolphin
MySQL Day Paris 2018 - Introduction & The State of the DolphinMySQL Day Paris 2018 - Introduction & The State of the Dolphin
MySQL Day Paris 2018 - Introduction & The State of the Dolphin
 
MySQL Day Paris 2018 - MySQL & GDPR; Privacy and Security requirements
MySQL Day Paris 2018 - MySQL & GDPR; Privacy and Security requirementsMySQL Day Paris 2018 - MySQL & GDPR; Privacy and Security requirements
MySQL Day Paris 2018 - MySQL & GDPR; Privacy and Security requirements
 
MySQL Day Paris 2018 - Upgrade from MySQL 5.7 to MySQL 8.0
MySQL Day Paris 2018 - Upgrade from MySQL 5.7 to MySQL 8.0MySQL Day Paris 2018 - Upgrade from MySQL 5.7 to MySQL 8.0
MySQL Day Paris 2018 - Upgrade from MySQL 5.7 to MySQL 8.0
 
MySQL Day Paris 2018 - MySQL InnoDB Cluster; A complete High Availability sol...
MySQL Day Paris 2018 - MySQL InnoDB Cluster; A complete High Availability sol...MySQL Day Paris 2018 - MySQL InnoDB Cluster; A complete High Availability sol...
MySQL Day Paris 2018 - MySQL InnoDB Cluster; A complete High Availability sol...
 
MySQL Day Paris 2018 - MySQL JSON Document Store
MySQL Day Paris 2018 - MySQL JSON Document StoreMySQL Day Paris 2018 - MySQL JSON Document Store
MySQL Day Paris 2018 - MySQL JSON Document Store
 
MySQL Day Paris 2018 - What’s New in MySQL 8.0 ?
MySQL Day Paris 2018 - What’s New in MySQL 8.0 ?MySQL Day Paris 2018 - What’s New in MySQL 8.0 ?
MySQL Day Paris 2018 - What’s New in MySQL 8.0 ?
 
MySQL 8.0, what's new ? - Forum PHP 2018
MySQL 8.0, what's new ? - Forum PHP 2018MySQL 8.0, what's new ? - Forum PHP 2018
MySQL 8.0, what's new ? - Forum PHP 2018
 
MySQL JSON Document Store - A Document Store with all the benefits of a Trans...
MySQL JSON Document Store - A Document Store with all the benefits of a Trans...MySQL JSON Document Store - A Document Store with all the benefits of a Trans...
MySQL JSON Document Store - A Document Store with all the benefits of a Trans...
 
MySQL 8.0 - What's New ?
MySQL 8.0 - What's New ?MySQL 8.0 - What's New ?
MySQL 8.0 - What's New ?
 
MySQL Document Store - A Document Store with all the benefts of a Transactona...
MySQL Document Store - A Document Store with all the benefts of a Transactona...MySQL Document Store - A Document Store with all the benefts of a Transactona...
MySQL Document Store - A Document Store with all the benefts of a Transactona...
 

Neo4j au coeur du graphe social de 45 millions de membres par Nicolas Tricot

  • 1. Your network is more powerful than you think Neo4J au cœur du graphe social de 45 millions de membres Viadeo Tech Days Les 20, 21 et 22 novembre 2012 1
  • 2. ABOUT THE VIADEO GROUP • 1 million new members / month • 10 million connexions / month • 100 million profiles viewed / month Your network is more powerful than you think 2 / 36
  • 4. GRAPHS ARE EVERYWHERE Your network is more powerful than you think 4 / 36
  • 5. GRAPHS ARE EVERYWHERE Your network is more powerful than you think 5 / 36
  • 6. GRAPHS ARE EVERYWHERE © Air France / KLM Your network is more powerful than you think 6 / 36
  • 7. GRAPHS ARE EVERYWHERE Your network is more powerful than you think 7 / 36
  • 9. SOCIAL GRAPH Nodes Relationships Your network is more powerful than you think 9 / 36
  • 10. SOCIAL GRAPH Direct contacts Your network is more powerful than you think 10 / 36
  • 11. SOCIAL GRAPH Level 2 contacts Your network is more powerful than you think 11 / 36
  • 12. SOCIAL GRAPH Path Distance 3 Path Distance 4 Your network is more powerful than you think 12 / 36
  • 14. PREHISTORY 2006-2011 • In-house algorithm • Network storage in MySQL Database CREATE TABLE `Network` ( `memberId` int(11) NOT NULL DEFAULT '0', `L1` mediumblob NOT NULL, `L2` mediumblob NOT NULL, PRIMARY KEY (`memberId`) ) ENGINE=InnoDB; Your network is more powerful than you think 14 / 36
  • 15. PREHISTORY 2006-2011 Update the network (old-fashioned style) Member A and Member B are now in contacts Update of A.L1 + B.L1 and A.L2 + B.L2 Retrieving A.L1 + B.L1 and update *.L2 Example: • A has 500 contacts • B has 150 contacts 500 + 150 + 2 = 652 updates! Your network is more powerful than you think 15 / 36
  • 16. PREHISTORY 2006-2011 Good performances on Computation of Paths Computation of Distances Your network is more powerful than you think 16 / 36
  • 17. PREHISTORY 2006-2011 = = Your network is more powerful than you think 17 / 36
  • 18. PREHISTORY 2006-2011 LIMITATIONS 1) Important latency for complete update 2) Massive bandwidth impact for internal network 3) 48 hours to restart from scratch Your network is more powerful than you think 18 / 36
  • 20. GRAPH DATABASE Name: Graham Greene Name: Graham Greene Title: Tinker, Soldier, Spy Title: Our man in Havana Born: 02-10-1904 Born: 19-10-1932 Published: 1974 Published: 1958 Died: 02-04-1991 1 WROTE 2 4 WROTE 3 RECOMMENDED Date: 09-09-2011 RECOMMENDED RECOMMENDED Date: 05-07-2011 Date: 03-02-2011 6 5 Name: Alan Name: Ian © Ian Robinson Your network is more powerful than you think 20 / 36
  • 21. GRAPH DATABASE Name: Graham Greene Name: Graham Greene Title: Tinker, Soldier, Spy Title: Our man in Havana Born: 02-10-1904 Born: 19-10-1932 Published: 1974 Published: 1958 Died: 02-04-1991 1 WROTE 2 4 WROTE 3 RECOMMENDED Date: 09-09-2011 RECOMMENDED RECOMMENDED Date: 05-07-2011 Date: 03-02-2011 Nodes 6 5 Name: Alan Name: Ian © Ian Robinson Your network is more powerful than you think 21 / 36
  • 22. GRAPH DATABASE Name: Graham Greene Name: Graham Greene Title: Tinker, Soldier, Spy Title: Our man in Havana Born: 02-10-1904 Born: 19-10-1932 Published: 1974 Published: 1958 Died: 02-04-1991 1 WROTE 2 4 WROTE 3 RECOMMENDED Date: 09-09-2011 RECOMMENDED RECOMMENDED Date: 05-07-2011 Date: 03-02-2011 Nodes 6 5 Relationships Name: Alan Name: Ian © Ian Robinson Your network is more powerful than you think 22 / 36
  • 23. GRAPH DATABASE Name: Graham Greene Name: Graham Greene Title: Tinker, Soldier, Spy Title: Our man in Havana Born: 02-10-1904 Born: 19-10-1932 Published: 1974 Published: 1958 Died: 02-04-1991 1 WROTE 2 4 WROTE 3 RECOMMENDED Date: 09-09-2011 RECOMMENDED RECOMMENDED Date: 05-07-2011 Date: 03-02-2011 Nodes 6 5 Relationships Name: Alan Name: Ian Properties © Ian Robinson Your network is more powerful than you think 23 / 36
  • 25. WHY Neo4J Findings after POC on 3 other tools: • Old technology with add-on for graph management • No user communities • Bad performance • “Black Box” code Why ? • OpenSource project • Good documentation • User community • Excellent performance • ACID • Very simple • (How to better model a Social Graph than with a Graph database ?!?) Your network is more powerful than you think 25 / 36
  • 26. WHY Neo4J 1 node = 1 member 1 Relationship = 1 direct contact Your network is more powerful than you think 26 / 36
  • 27. WHY Neo4J BENEFITS Very easy to integrate (less than 2 months) Instantaneous graph updates High Availability Backup / Restore Your network is more powerful than you think 27 / 36
  • 29. LIMITATION Doesn’t handle SHARDING! (Split one graph onto several servers) « Size doesn’t matter… », but… Server 1 Server 2 Your network is more powerful than you think 29 / 36
  • 31. EXPLORATION MODE What for the future? Store various kind of objects Change the development paradigm Your network is more powerful than you think 31 / 36
  • 32. EXPLORATION MODE Your network is more powerful than you think 32 / 36
  • 33. EXPLORATION MODE Your network is more powerful than you think 33 / 36
  • 35. CONCLUSION Neo4J: Has replaced a 5-year-old in-house technology in only 2 months Supports the core system of the Viadeo Professional Social Network Has been in production for 1 year ½ Deals smoothly with Viadeo’s usage growth Think about how Neo4J will improve your own business! Your network is more powerful than you think 35 / 36