Installing Drupal Globally - DrupalCamp Stockholm 2014


Published on

How to install Drupal to serve global audiences.

Published in: Technology
1 Like
  • Be the first to comment

No Downloads
Total Views
On Slideshare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

Installing Drupal Globally - DrupalCamp Stockholm 2014

  1. 1. Installing Drupal globally Kalle Varisvirta Technology Director Exove @kvirta
  2. 2. Prerequisites? Moderate knowledge of Drupal and its architecture Moderate understanding of PHP, MySQL, Varnish and hosting of this software
  3. 3. What you’ll learn in this session? Why do you need to serve the whole world with a single Drupal installation? How can it be done? What are the pros and cons of each method?
  4. 4. Why distribute? Isn’t the internet already, like, global?
  5. 5. HTTP GET
  6. 6. Traveling around the world takes time
  7. 7. 200 OK ...but the data has to come back, too
  8. 8. Scandinavia - Japan 350 - 400 ms US - India 250 - 300 ms UK - Australia 300 - 350 ms Network latencyICMP round-trip
  9. 9. Why is latency bad? ICMP (ping) round-trip isn’t the whole truth Over 300 milliseconds of network latency will make your lightning-fast website seem sluggish All continents your site is in business with should be served with a local server
  10. 10. Anonymous traffic onto a Drupal site? Easy.
  11. 11. Anonymous traffic Use a CDN to cache your site No CDN? Install a local Varnish on all continents, use GeoDNS for directing traffic to the local copy Don’t replicate data if you’re just focusing on anonymous. Totally not worth it.
  12. 12. Master CDN edge CDN edge CDN edge CDN edge Writes to master One master with CDN
  13. 13. Does everybody do it? host is an alias for is an alias for has address has address
  14. 14. Drupal-driven community site with a lot of write traffic? You’re in for some configuration, installation and tuning.
  15. 15. It’s always about the MySQL
  16. 16. Syndicating Drupal / write traffic Two options: Write to master, replicate to local Write to local, synchronize the world
  17. 17. Write to master, replicate to local PHP can read-write split MySQL traffic Not problem-free on Drupal, needing a tiny hack to core Files can be synced with rsync, as long as writing only happens towards the master
  18. 18. Master Slave Slave Writes to master One master, replicated slaves, read/write split on database level
  19. 19. Write to master, replicate to local Cons Writes take quite a while, so posting comments might seem very slow Surprisingly many things in Drupal write to the database Due to replication lag, the sites might be slightly out of date every once in a while
  20. 20. Write traffic Two options: Write to master, replicate to local Write to local, synchronize the world
  21. 21. Write to local, synchronize the world Writing to local and synchronizing the world has been very hard to accomplish Master-master replications have been usually third- party systems, like Galera In MySQL 5.6 there’s a new possibility, MySQL GTID- based replication ring with multiple masters
  22. 22. Write to local, synchronize the world GTIDs are Global Transaction Identifiers and with them, we can create a multi-master replication ring topology In replication ring topology, all MySQL nodes work as slaves to the previous nodes, adding local writes to the transaction log stream, thus being master for the next node With GTIDs in place, multiple masters have their own ids in the transaction log and the transaction items won’t collide
  23. 23. Write to local, synchronize the world Replication ring allows fast writes to local and fast read from local For Drupal, this is invisible Only change needed is to make MySQL ignore collisions in the cache table
  24. 24. Master Master Master Multi-master MySQL ring topology (GTID)
  25. 25. Write to local, synchronize the world Files can be synced with file syncing filesystems, like GlusterFS We’ve found Unison to be most robust and giving the least overhead to the filesystem Unison is just a piece of software syncing filesystems on disk - not a filesystem itself
  26. 26. But, hey. I only have couple of things to syndicate.
  27. 27. Application level syndication Distribute content via Drupal’s own syndication methods Works for some content, but not nearly everything All sites are separate and have to be configured separately Works for, say, country sites wanting to show the corporate news, ie. partial content
  28. 28. Application level syndication Feeds can be used to both feed and import Services can be also used, but requires either queuing or both servers up at all times HTTP connections over the world can be surprisingly unreliable
  29. 29. Recap
  30. 30. Recap Distribute if you serve the world There are no tricks to fool the speed of light
  31. 31. Recap For anonymous, use a CDN For logged in users, choose the right solution for the task For a lot of writes, you need to write locally and synchronize the world If you do that, MySQL GTID multi-master ring topology works
  32. 32. Recap Application level integration between the Drupals can be done Just don’t try to syndicate everything Make sure you don’t try to syndicate too much at a time Feeds works, Services works
  33. 33. Thank you!
  34. 34. Questions? Thank you!