More details here: http://bigeng.io/
I recently gave this talk for the SydPHP Laravel group here at the BigCommerce office in Sydney, AU.
Here I talk about some of the concepts we use at BigCommerce to run data at scale.
Who am I ?
Manager, Site Reliability Engineering @
BigCommerce
Over 17 years scaling big web infrastructure:
- BigCommerce
- Fairfax Media - smh.com.au, theage.com.au
- BBC - bbc.co.uk - BBC iPlayer
Now:
- Geek
- Pirate
- Fire Fighter with the RFS
https://www.linkedin.com/in/bisscuitt
@bisscuitt
PHP from an Operational
point of view
- PHP in production
- Getting Requests to the hosts
- Asset storage at scale
- Database sharding
- Caching, caching, caching
- Load Balancing
- Service Discovery
Files, Images
& Templates
L4 Load Balancers and
Caching Layer
Application Servers
Store Config
and Caching
Orders and
Product Metadata
L3 Load Balancers
LVS
Database
Servers
Asset and File
Storage
Configuration and
Caching Service
Persistent Redis
- Many single threaded instances of redis run on
each redis hosts
- Instances configured in master -> slave pairs
- All Redis sentinels monitor the state of the redis
instances.
- Redis Sentinels keep state and form a quorum
- Apps connect to redis sentinel to request
address of current master
- App then connects directly to redis instance
Permanent Redis Servers
Redis Sentinels
Redis Master Redis Slave
Replication
Sentinel 2 Sentinel 3
Sentinel 1
Healthchecks
require 'Predis/Autoloader.php';
PredisAutoloader::register();
$sentinels = ['tcp://10.0.0.1', 'tcp://10.0.0.2', 'tcp://10.0.0.3'];
$options = ['replication' => 'sentinel', 'service' => 'mymaster'];
$client = new PredisClient($sentinels, $options);
L4 Load Balancing
LUA
Asset
Cache
Client Request
Store
Config
Lookups
GenerateConfig
Service Status Sync
CDN
Asset Request
Asset Storage
Fetch uncached Assets
ssl_certificate_by_lua
App Servers