Optimize drupal using mongo db

  • View
    9.888

  • Download
    0

Embed Size (px)

Text of Optimize drupal using mongo db

  1. 1. optimize Drupal usingmongoDB
  2. 2. agendalets get startedwhat is problem that we face (or what we need/want)sql - relational databasesshift of technologies - noSQL databasesmongoDB - what is mongohow to install mongofinally - drupal & mongomongoDB module - what we can do with itbenefitsq&a
  3. 3. about mename: Vladimir Ilicemployed at: OWFGemail: v_ilic@hotmail.comt witter: burgerboydaddy
  4. 4. Who should be here instead of me
  5. 5. Who should be here instead of me
  6. 6. Who should be here instead of me
  7. 7. what is problem that we faceor what we want to achievewith Drupal based solutions
  8. 8. what is problem that we faceor what we want to achievewith Drupal based solutions speed
  9. 9. what is problem that we faceor what we want to achievewith Drupal based solutions speedscale
  10. 10. what is problem that we faceor what we want to achievewith Drupal based solutions speedscalesimplicity
  11. 11. how we can do that?or how to speedup Drupalserver side install Varnish for caching pages for anonymous users. install a persistent cache system (Memcached, APC, Memcache). use a CDN such as Akamai to ser ve static files (JavaScript, CSS, images).
  12. 12. how to speedup drupal - code sideuse Pressflow, it allows Varnish to serve cached page foranonymous users.clean Drupals watchdog table. Every time a watchdogerror gets logged, it consumes CPU resources on the webser ver and database server. It also increases load timesignificantly.implement static and persistent cache strategies until theslow query log comes up clean.avoid PHP errors that occur within nested foreach loops atall costs.uninstall unused modules.turn on caching for Drupal core blocks and Views.
  13. 13. how to speedup drupal -database sideDrupal sites live or die by their database.make sure the tables are properlyindexed for faster searching.do not store unnecessary records, a 100node database will be always accessedfaster than a 3 million node database.change how/where you store your data
  14. 14. speed -shift of technologiesfrom Pentium 100MHz, 16MB RAM,200 MB HDD tomy cell phone: dual core 1GHz, 1GB RAM,32GB storageor maybe some cloud ser ver with 32+CPUs, few TB RAM, ...
  15. 15. our database technology
  16. 16. our database technology
  17. 17. our database technology1974 - Therelationaldatabase is created
  18. 18. sql - relational dbs
  19. 19. sql - relational dbs1979
  20. 20. sql - relational dbs1979 1982-1996
  21. 21. sql - relational dbs1979 1982-1996 1995
  22. 22. simplicity?relational database model for eCommerce app
  23. 23. simplicity?relational database model for eCommerce app
  24. 24. simplicity?* joins* joins* joins relational database model for eCommerce app
  25. 25. real life examplesell groceriesProduct {General Productid: attributesUPC:brand:description:MSRP:price:in-stock:...PLU: 4011unit of measure: lbItem Specicorigin:BC attributesseasonal:yes...
  26. 26. real life example - but we also sell booksProduct {id:General ProductUPC: attributes staybrand:description: the sameMSRP:price:in-stock:...author: Isaac Asimov Book Specictitle:Foudations Edge attributes arebinding:Paperbackpublication date: 1982 differentpublisher name: Spectranumber of pages:480ISBN: 0553293389
  27. 27. real life example -ops, we want moreProduct {General Productid: attributes stay theUPC:samebrand:description:MSRP:price:in-stock:... Clothing specicbrand: Leeattributes aregender:Mens totally different ...make:Vintagestyle: Straight Cut and not consistentlength:34 across brands &width: 42 makecolor: Blackmaterial:Cotton...
  28. 28. Now were screwed
  29. 29. Now were screwed
  30. 30. shift of technologies -db solutionsfrom well-established relational databases to NoSQLtechnologies.NoSQL was first introduced as concept in 1998, it reallywasnt until 2009 that it emerged as a real trend.NoSQL solutions arent replacements traditionalsolutions, but rather address a specific need in additionto what one might get from traditional offerings.In 90% of the time youll probably implement a hybridsystem.put simply, NoSQL is about being open and aware ofalternative, existing and additional patterns and toolsfor managing your data.
  31. 31. shift is happening now few years ago (and still now) MySQL was the undisputed king of the open-source database hill. It is still growing with great speed (40% compound annual grow rate)but There are some competitors that are emerging and grow even faster.
  32. 32. shift is happening now
  33. 33. shift is happening now
  34. 34. shift is happening now451 Research notes:"NoSQL database technologies are largely being adopted fornew projects that require additional scalability,performance, relaxed consistency and agility."
  35. 35. shift is happening now451 Research notes:"NoSQL database technologies are largely being adopted fornew projects that require additional scalability,in other words:performance, relaxed consistency and agility."web :-)
  36. 36. the NoSQL ecosystem
  37. 37. what is Not Only SQL?
  38. 38. what is Not Only SQL?Non-Relational Schema-FreeDistributedReplication SupportOpen-SourceSimple APIHorizontally Eventually ScalableConsistent
  39. 39. mongoDBagile and scalableDB designed for todayMongoDB (from "humongous") is ascalable, high-performance, open sourceNoSQL database.
  40. 40. what is mongoApplicationDocument OrientedHigh { author: vladimir, date: new Date(), text: drupal-MongoDB...,Performancetags: [tech, database]} Fully Consistent Horizontally Scalable