

WordPress on Heroku - tiefenb
https://github.com/xyu/heroku-wp

======
hashtree
Where content is semi-static (e.g. blogs, informational sites like WebMD,
sites in which the information updates infrequently on a per-page level), we
have flipped the approach/architecture and it has proven to be a HUGE boon for
us. With the approach, we get performance that is essentially unmatched via
any traditional server setup, nearly unlimited read scalability, vastly
reduced infrastructure costs, improved usability for end users with direct
benefits to engagement and SEO, and much more. It certainly is not a fit for
every site. For instance, Twitter could not work at all this way. But, for
semi-static sites it works like a charm:

    
    
      - Host all content via CDNs, which is dynamically managed via backend servers (see
      below).
    
      - Allow user interactivity via events being pushed to pub/sub event servers. On the
      other side, in other DCs entirely, are the more traditional servers
      which await said events. Said events are processed, aggregated, and then pushed back
      up, via CDN APIs, to the CDN servers.
    
      - Use eventual consistency concepts to simulate real-time interactivity for users.
      For instance, when a user posts a review/comment we show it client-side to them,
      knowing that the CDN update should be coming momentarily.
    

Besides the pub/sub servers, servers can be housed just about anywhere across
the globe (latency isn't a huge issue any longer). If you are based in the US,
you might be surprised to find out just how competitive/cheap the European
market is for servers. Previously, it would have been insane to consider them,
but now we can leverage them for a large reduction in costs. For example,
compare Rackspace dedicated servers to OVH dedicated servers. It is roughly
one order of magnitude less costly.

~~~
anonymousDan
This sounds interesting. What are you using for your pubsub servers might I
ask? And what are the scalability and fault-tolerance requirements on them?
Are pub/sub servers in different data centres essentially independent with
consistency handled by other servers colocated in an origin datacenter?

------
jsmoov
An alternative that worked well for me and seems a bit more streamlined to
install: [http://mchung.github.io/heroku-buildpack-
wordpress/](http://mchung.github.io/heroku-buildpack-wordpress/)

~~~
fjcaetano
I'm also using it and it works perfectly for me:
[http://blog.flaviocaetano.com](http://blog.flaviocaetano.com) (no spam
intended)

------
dangoldin
Another suggestion is to use Varnish. It's extremely easy to set up and just
put in front of your Wordpress install, regardless of whether you're using
Nginx/Apache.

~~~
cheald
Unlike most technologies which promise it, Varnish _is_ magical webscale
sauce. It's awesome.

~~~
dangoldin
Definitely. Only thing I wish is being able to use logic other than regex to
handle which urls get cached and which don't.

------
aalamir
For easier experimentation, I have created a Terminal.com snapshot with this
setup.

[https://atharwat.wordpress.com/2014/07/26/wordpress-on-
termi...](https://atharwat.wordpress.com/2014/07/26/wordpress-on-terminal-
com/)

~~~
ljlolel
No credit card required!

------
javipas
So Heroku makes the setup pretty automatic, right? Otherwise you'd have to
setup and configure each of those elements one by one, right?

------
matthijs_
A credit card entered @ Heroku is required in order to do this. It won't be
billed if you follow the readme.

~~~
ihuman
For which parts would you need to enter a credit card? The addons? I've used
Heroku for some assorted Ruby and Python programs, but I have not had to enter
a credit card. However, what I have done has only scratched the surface of
what Heroku offers, so I am not surprised if I missed the the parts that
require credit card info.

~~~
matthijs_
When I tried to add cleardb, it said I had to fill in the CC information

------
drunkcatsdgaf
you could always use heroku's postgres instead of mysql, avoiding having to
put in a CC.

------
dylanlacom
Where is the wp-admin directory and the files in wp-includes?

~~~
andrewryno
It's installed through Composer. In composer.json it sets up a custom
repository to download the latest version of WordPress, and then uses the
"extra" section to install it to a custom directory (in this case the public
directory).

~~~
dylanlacom
ah I see. Thanks andrewryno.

------
thisisdallas
Why not add MariaDB to that also?

------
sirji
Will this work on the Free plan

~~~
tiefenb
yes, I think so

------
andreash
pros and cons vs wpengine.com?

~~~
swombat
One obvious con will be that you have to set it up yourself while WPEngine is
hands-off.

~~~
thenomad
Also, WP Engine do all the updates for you, which is not the case for this
setup.

That's one of the major reasons I run most of my WP sites on a managed service
- I'm a bit too busy to keep on top of all the updates that come out.

------
gottarts
any performance comparison?

~~~
tiefenb
yup here vs. LAMP: [http://www.xyu.io/2014/06/wordpress-on-nginx-hhvm-with-
herok...](http://www.xyu.io/2014/06/wordpress-on-nginx-hhvm-with-heroku-
buildpacks/)

~~~
gottarts
Nice article, thx

