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?
8. Scandinavia - Japan
350 - 400 ms
US - India
250 - 300 ms
UK - Australia
300 - 350 ms
Network latencyICMP round-trip
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
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.
13. Does everybody do it?
host www.heraldsun.com.au
www.heraldsun.com.au is an alias for
fw.heraldsun.com.au.edgesuite.net.
fw.heraldsun.com.au.edgesuite.net is an
alias for a1501.g.akamai.net.
a1501.g.akamai.net has address
184.85.223.139
a1501.g.akamai.net has address
14. Drupal-driven community site with
a lot of write traffic?
You’re in for some configuration,
installation and tuning.
16. Syndicating Drupal /
write traffic
Two options:
Write to master, replicate to local
Write to local, synchronize the world
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
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
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. 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. 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
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
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. 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
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. 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