![Page 1: Enterprise-level EE - Vector Media Group...1. run Docker containers from pre-built images 2. git clone 3. composer install --no-dev 4. configure Apache to set environment variables](https://reader034.vdocuments.us/reader034/viewer/2022051903/5ff4cc0728e0350e8f5a6b81/html5/thumbnails/1.jpg)
Enterprise-level EE:Uptime, Speed, and Scale
![Page 2: Enterprise-level EE - Vector Media Group...1. run Docker containers from pre-built images 2. git clone 3. composer install --no-dev 4. configure Apache to set environment variables](https://reader034.vdocuments.us/reader034/viewer/2022051903/5ff4cc0728e0350e8f5a6b81/html5/thumbnails/2.jpg)
Reaching beyond EEtools and techniques to service
enterprise clients
![Page 3: Enterprise-level EE - Vector Media Group...1. run Docker containers from pre-built images 2. git clone 3. composer install --no-dev 4. configure Apache to set environment variables](https://reader034.vdocuments.us/reader034/viewer/2022051903/5ff4cc0728e0350e8f5a6b81/html5/thumbnails/3.jpg)
1. Intro
2. In-memory Caching
3. Load Balancing
4. Multi-environment setup with Docker
5. Scaling MySQL Tables
6. Monitoring / Logging
![Page 4: Enterprise-level EE - Vector Media Group...1. run Docker containers from pre-built images 2. git clone 3. composer install --no-dev 4. configure Apache to set environment variables](https://reader034.vdocuments.us/reader034/viewer/2022051903/5ff4cc0728e0350e8f5a6b81/html5/thumbnails/4.jpg)
vectormediagroup.com/blog
@VectorNYC
![Page 5: Enterprise-level EE - Vector Media Group...1. run Docker containers from pre-built images 2. git clone 3. composer install --no-dev 4. configure Apache to set environment variables](https://reader034.vdocuments.us/reader034/viewer/2022051903/5ff4cc0728e0350e8f5a6b81/html5/thumbnails/5.jpg)
![Page 6: Enterprise-level EE - Vector Media Group...1. run Docker containers from pre-built images 2. git clone 3. composer install --no-dev 4. configure Apache to set environment variables](https://reader034.vdocuments.us/reader034/viewer/2022051903/5ff4cc0728e0350e8f5a6b81/html5/thumbnails/6.jpg)
@aBenjaminSmithbenjaminsmith.com
![Page 7: Enterprise-level EE - Vector Media Group...1. run Docker containers from pre-built images 2. git clone 3. composer install --no-dev 4. configure Apache to set environment variables](https://reader034.vdocuments.us/reader034/viewer/2022051903/5ff4cc0728e0350e8f5a6b81/html5/thumbnails/7.jpg)
1. Intro
2. In-memory Caching
3. Load Balancing
4. Multi-environment setup with Docker
5. Scaling MySQL Tables
6. Monitoring / Logging
![Page 8: Enterprise-level EE - Vector Media Group...1. run Docker containers from pre-built images 2. git clone 3. composer install --no-dev 4. configure Apache to set environment variables](https://reader034.vdocuments.us/reader034/viewer/2022051903/5ff4cc0728e0350e8f5a6b81/html5/thumbnails/8.jpg)
Caching:Lowest-hanging fruit
on the tree of optimization
![Page 9: Enterprise-level EE - Vector Media Group...1. run Docker containers from pre-built images 2. git clone 3. composer install --no-dev 4. configure Apache to set environment variables](https://reader034.vdocuments.us/reader034/viewer/2022051903/5ff4cc0728e0350e8f5a6b81/html5/thumbnails/9.jpg)
Caching» Tag caching caching
» Template caching
» Query caching
» HTTP proxy/accelerator
![Page 10: Enterprise-level EE - Vector Media Group...1. run Docker containers from pre-built images 2. git clone 3. composer install --no-dev 4. configure Apache to set environment variables](https://reader034.vdocuments.us/reader034/viewer/2022051903/5ff4cc0728e0350e8f5a6b81/html5/thumbnails/10.jpg)
EE without reverse-proxy cache
» Standard LAMP setup
![Page 11: Enterprise-level EE - Vector Media Group...1. run Docker containers from pre-built images 2. git clone 3. composer install --no-dev 4. configure Apache to set environment variables](https://reader034.vdocuments.us/reader034/viewer/2022051903/5ff4cc0728e0350e8f5a6b81/html5/thumbnails/11.jpg)
EE with Varnish Cache
» Sits between users and EE
» Passes through requests to EE
![Page 12: Enterprise-level EE - Vector Media Group...1. run Docker containers from pre-built images 2. git clone 3. composer install --no-dev 4. configure Apache to set environment variables](https://reader034.vdocuments.us/reader034/viewer/2022051903/5ff4cc0728e0350e8f5a6b81/html5/thumbnails/12.jpg)
EE with Varnish Cache
» Sits between users and EE
» Passes through requests to EE
» Serves from memory if cached
![Page 13: Enterprise-level EE - Vector Media Group...1. run Docker containers from pre-built images 2. git clone 3. composer install --no-dev 4. configure Apache to set environment variables](https://reader034.vdocuments.us/reader034/viewer/2022051903/5ff4cc0728e0350e8f5a6b81/html5/thumbnails/13.jpg)
1. Intro
2. In-memory Caching
3. Load Balancing
4. Multi-environment setup with Docker
5. Scaling MySQL Tables
6. Monitoring / Logging
![Page 14: Enterprise-level EE - Vector Media Group...1. run Docker containers from pre-built images 2. git clone 3. composer install --no-dev 4. configure Apache to set environment variables](https://reader034.vdocuments.us/reader034/viewer/2022051903/5ff4cc0728e0350e8f5a6b81/html5/thumbnails/14.jpg)
Load Balancingexample.com served by multiple
web servers
![Page 15: Enterprise-level EE - Vector Media Group...1. run Docker containers from pre-built images 2. git clone 3. composer install --no-dev 4. configure Apache to set environment variables](https://reader034.vdocuments.us/reader034/viewer/2022051903/5ff4cc0728e0350e8f5a6b81/html5/thumbnails/15.jpg)
No Load Balancing
![Page 16: Enterprise-level EE - Vector Media Group...1. run Docker containers from pre-built images 2. git clone 3. composer install --no-dev 4. configure Apache to set environment variables](https://reader034.vdocuments.us/reader034/viewer/2022051903/5ff4cc0728e0350e8f5a6b81/html5/thumbnails/16.jpg)
Varnish Load Balancing
![Page 17: Enterprise-level EE - Vector Media Group...1. run Docker containers from pre-built images 2. git clone 3. composer install --no-dev 4. configure Apache to set environment variables](https://reader034.vdocuments.us/reader034/viewer/2022051903/5ff4cc0728e0350e8f5a6b81/html5/thumbnails/17.jpg)
1. Intro
2. In-memory Caching
3. Load Balancing
4. Multi-environment setup with Docker
5. Scaling MySQL Tables
6. Monitoring / Logging
![Page 18: Enterprise-level EE - Vector Media Group...1. run Docker containers from pre-built images 2. git clone 3. composer install --no-dev 4. configure Apache to set environment variables](https://reader034.vdocuments.us/reader034/viewer/2022051903/5ff4cc0728e0350e8f5a6b81/html5/thumbnails/18.jpg)
Multiple Environments» Local/development
» Staging
» QA
» Production
![Page 19: Enterprise-level EE - Vector Media Group...1. run Docker containers from pre-built images 2. git clone 3. composer install --no-dev 4. configure Apache to set environment variables](https://reader034.vdocuments.us/reader034/viewer/2022051903/5ff4cc0728e0350e8f5a6b81/html5/thumbnails/19.jpg)
The old way...1. Checkout new branch from master
2. <do something amazing with code>
3. Add new fields to your local EE instance
4. Merge into staging branch
5. Deploy to staging server
6. Add new fields to your staging EE instance
7. Email the client for them to review!
![Page 20: Enterprise-level EE - Vector Media Group...1. run Docker containers from pre-built images 2. git clone 3. composer install --no-dev 4. configure Apache to set environment variables](https://reader034.vdocuments.us/reader034/viewer/2022051903/5ff4cc0728e0350e8f5a6b81/html5/thumbnails/20.jpg)
Boo that» How to stage multiple WIP features at once?
» Field ID conflicts
» Which features are currently staged?
» Stale data on Staging/QA servers
![Page 21: Enterprise-level EE - Vector Media Group...1. run Docker containers from pre-built images 2. git clone 3. composer install --no-dev 4. configure Apache to set environment variables](https://reader034.vdocuments.us/reader034/viewer/2022051903/5ff4cc0728e0350e8f5a6b81/html5/thumbnails/21.jpg)
![Page 22: Enterprise-level EE - Vector Media Group...1. run Docker containers from pre-built images 2. git clone 3. composer install --no-dev 4. configure Apache to set environment variables](https://reader034.vdocuments.us/reader034/viewer/2022051903/5ff4cc0728e0350e8f5a6b81/html5/thumbnails/22.jpg)
DockerDocker containers wrap up a piece of software in a complete filesystem that contains everything it needs to run
» consistent and reproducible
» isolated software
» lightweight
![Page 23: Enterprise-level EE - Vector Media Group...1. run Docker containers from pre-built images 2. git clone 3. composer install --no-dev 4. configure Apache to set environment variables](https://reader034.vdocuments.us/reader034/viewer/2022051903/5ff4cc0728e0350e8f5a6b81/html5/thumbnails/23.jpg)
The new way...vmg stage ProjectA feature-new-modal
1. Deploys feature to feature-new-modal.projecta.vmg.com
2. DB is latest snapshot from live site (< 1 day old)
3. Runs tests
4. Send notifcations to HipChat
![Page 24: Enterprise-level EE - Vector Media Group...1. run Docker containers from pre-built images 2. git clone 3. composer install --no-dev 4. configure Apache to set environment variables](https://reader034.vdocuments.us/reader034/viewer/2022051903/5ff4cc0728e0350e8f5a6b81/html5/thumbnails/24.jpg)
How is this possible?» Docker images built nightly from live site data
» Wildcard DNS
» Docker volume persistance
» Environment variable configuration (phpdotenv)
$db['default']['database'] = getenv('DB_NAME');$db['default']['username'] = getenv('DB_USER');$db['default']['hostname'] = getenv('DB_HOST');$db['default']['password'] = getenv('DB_PASS');$db['default']['db_debug'] = getenv('DB_DEBUG');
![Page 25: Enterprise-level EE - Vector Media Group...1. run Docker containers from pre-built images 2. git clone 3. composer install --no-dev 4. configure Apache to set environment variables](https://reader034.vdocuments.us/reader034/viewer/2022051903/5ff4cc0728e0350e8f5a6b81/html5/thumbnails/25.jpg)
Build the database!
» Nightly script runs uploads MySQL dump to Amazon S3
» Docker run command pulls in latest DB nightly and builds MySQL container image
» Image is accessible from same machine as Docker LAMP stack
./run.sh build-db clientName
![Page 26: Enterprise-level EE - Vector Media Group...1. run Docker containers from pre-built images 2. git clone 3. composer install --no-dev 4. configure Apache to set environment variables](https://reader034.vdocuments.us/reader034/viewer/2022051903/5ff4cc0728e0350e8f5a6b81/html5/thumbnails/26.jpg)
What we have now» Docker image with runnable custom MySQL server and latest
DB snapshot
» Can be "run" in milliseconds
![Page 27: Enterprise-level EE - Vector Media Group...1. run Docker containers from pre-built images 2. git clone 3. composer install --no-dev 4. configure Apache to set environment variables](https://reader034.vdocuments.us/reader034/viewer/2022051903/5ff4cc0728e0350e8f5a6b81/html5/thumbnails/27.jpg)
Stage a feature!» Project name: "clientName"
» Git branch: "feature-new-modal"
./run.sh stage clientName feature-new-modal
![Page 28: Enterprise-level EE - Vector Media Group...1. run Docker containers from pre-built images 2. git clone 3. composer install --no-dev 4. configure Apache to set environment variables](https://reader034.vdocuments.us/reader034/viewer/2022051903/5ff4cc0728e0350e8f5a6b81/html5/thumbnails/28.jpg)
Stage a feature!
1. run Docker containers from pre-built images
2. git clone
3. composer install --no-dev
4. configure Apache to set environment variables
5. dynamic .htaccess config
6. set file/dir permissions
7. let proxy server know we're here!
![Page 29: Enterprise-level EE - Vector Media Group...1. run Docker containers from pre-built images 2. git clone 3. composer install --no-dev 4. configure Apache to set environment variables](https://reader034.vdocuments.us/reader034/viewer/2022051903/5ff4cc0728e0350e8f5a6b81/html5/thumbnails/29.jpg)
Proxy server» Listens on port 80/443
» Docker web servers, listening on random port
» new Docker images tell proxy server the port assignment
github.com/jwilder/nginx-proxy
![Page 30: Enterprise-level EE - Vector Media Group...1. run Docker containers from pre-built images 2. git clone 3. composer install --no-dev 4. configure Apache to set environment variables](https://reader034.vdocuments.us/reader034/viewer/2022051903/5ff4cc0728e0350e8f5a6b81/html5/thumbnails/30.jpg)
1. Intro
2. In-memory Caching
3. Load Balancing
4. Multi-environment setup with Docker
5. Scaling MySQL Tables
6. Monitoring / Logging
![Page 31: Enterprise-level EE - Vector Media Group...1. run Docker containers from pre-built images 2. git clone 3. composer install --no-dev 4. configure Apache to set environment variables](https://reader034.vdocuments.us/reader034/viewer/2022051903/5ff4cc0728e0350e8f5a6b81/html5/thumbnails/31.jpg)
Basic MySQL optimizations» MySQL schema tweaks
» indices
» column types
» MySQL 5.6+ (Percona)
» InnoDB
» Adding new channel fields?
![Page 32: Enterprise-level EE - Vector Media Group...1. run Docker containers from pre-built images 2. git clone 3. composer install --no-dev 4. configure Apache to set environment variables](https://reader034.vdocuments.us/reader034/viewer/2022051903/5ff4cc0728e0350e8f5a6b81/html5/thumbnails/32.jpg)
MySQL doesn't like to
ALTER
![Page 33: Enterprise-level EE - Vector Media Group...1. run Docker containers from pre-built images 2. git clone 3. composer install --no-dev 4. configure Apache to set environment variables](https://reader034.vdocuments.us/reader034/viewer/2022051903/5ff4cc0728e0350e8f5a6b81/html5/thumbnails/33.jpg)
ALTERing tables leads tolocking and downtime
![Page 34: Enterprise-level EE - Vector Media Group...1. run Docker containers from pre-built images 2. git clone 3. composer install --no-dev 4. configure Apache to set environment variables](https://reader034.vdocuments.us/reader034/viewer/2022051903/5ff4cc0728e0350e8f5a6b81/html5/thumbnails/34.jpg)
pt-online-schema-changealters a table’s structure without blocking reads or writes
![Page 35: Enterprise-level EE - Vector Media Group...1. run Docker containers from pre-built images 2. git clone 3. composer install --no-dev 4. configure Apache to set environment variables](https://reader034.vdocuments.us/reader034/viewer/2022051903/5ff4cc0728e0350e8f5a6b81/html5/thumbnails/35.jpg)
pt-online-schema-change
1. create an empty copy of the table to alter
2. ALTER the new table
3. copy rows from the original table into the new table
4. moves away the original table and replaces it with the new one
5. drops the original table
![Page 36: Enterprise-level EE - Vector Media Group...1. run Docker containers from pre-built images 2. git clone 3. composer install --no-dev 4. configure Apache to set environment variables](https://reader034.vdocuments.us/reader034/viewer/2022051903/5ff4cc0728e0350e8f5a6b81/html5/thumbnails/36.jpg)
build it!
![Page 37: Enterprise-level EE - Vector Media Group...1. run Docker containers from pre-built images 2. git clone 3. composer install --no-dev 4. configure Apache to set environment variables](https://reader034.vdocuments.us/reader034/viewer/2022051903/5ff4cc0728e0350e8f5a6b81/html5/thumbnails/37.jpg)
./ee-schema-change eefield add
![Page 38: Enterprise-level EE - Vector Media Group...1. run Docker containers from pre-built images 2. git clone 3. composer install --no-dev 4. configure Apache to set environment variables](https://reader034.vdocuments.us/reader034/viewer/2022051903/5ff4cc0728e0350e8f5a6b81/html5/thumbnails/38.jpg)
./ee-schema-change eefield add
1. Run the command!
» Adds 2 new columns exp_channel_data
» Adds 1 row to exp_channel_fields
2. Configure the field as needed in the ExpressionEngine CP
![Page 39: Enterprise-level EE - Vector Media Group...1. run Docker containers from pre-built images 2. git clone 3. composer install --no-dev 4. configure Apache to set environment variables](https://reader034.vdocuments.us/reader034/viewer/2022051903/5ff4cc0728e0350e8f5a6b81/html5/thumbnails/39.jpg)
1. Intro
2. In-memory Caching
3. Load Balancing
4. Multi-environment setup with Docker
5. Scaling MySQL Tables
6. Monitoring / Logging
![Page 40: Enterprise-level EE - Vector Media Group...1. run Docker containers from pre-built images 2. git clone 3. composer install --no-dev 4. configure Apache to set environment variables](https://reader034.vdocuments.us/reader034/viewer/2022051903/5ff4cc0728e0350e8f5a6b81/html5/thumbnails/40.jpg)
EE as a componentin a larger application
![Page 41: Enterprise-level EE - Vector Media Group...1. run Docker containers from pre-built images 2. git clone 3. composer install --no-dev 4. configure Apache to set environment variables](https://reader034.vdocuments.us/reader034/viewer/2022051903/5ff4cc0728e0350e8f5a6b81/html5/thumbnails/41.jpg)
» ExpressionEngine CMS/framework
» MySQL database
» Cron jobs (backup scripts)
» Elasticsearch cluster
» Worker queues
» Cache invalidation
» Data integrations/importing (CRM, ERP, API)
![Page 42: Enterprise-level EE - Vector Media Group...1. run Docker containers from pre-built images 2. git clone 3. composer install --no-dev 4. configure Apache to set environment variables](https://reader034.vdocuments.us/reader034/viewer/2022051903/5ff4cc0728e0350e8f5a6b81/html5/thumbnails/42.jpg)
The old way...Scanning log files is not enough
» Which server do they live on?
» How to search? Grep/tail?
» Standardized format?
![Page 43: Enterprise-level EE - Vector Media Group...1. run Docker containers from pre-built images 2. git clone 3. composer install --no-dev 4. configure Apache to set environment variables](https://reader034.vdocuments.us/reader034/viewer/2022051903/5ff4cc0728e0350e8f5a6b81/html5/thumbnails/43.jpg)
The new way...
![Page 44: Enterprise-level EE - Vector Media Group...1. run Docker containers from pre-built images 2. git clone 3. composer install --no-dev 4. configure Apache to set environment variables](https://reader034.vdocuments.us/reader034/viewer/2022051903/5ff4cc0728e0350e8f5a6b81/html5/thumbnails/44.jpg)
The new way...Decentralized logging
for log shipping
for storage/access/high-availability
for visualzation / reporting
![Page 45: Enterprise-level EE - Vector Media Group...1. run Docker containers from pre-built images 2. git clone 3. composer install --no-dev 4. configure Apache to set environment variables](https://reader034.vdocuments.us/reader034/viewer/2022051903/5ff4cc0728e0350e8f5a6b81/html5/thumbnails/45.jpg)
THANK YOU.— Ben