More information: http://bit.ly/2gtFMNW
WordPress has grown from blogging tool, to flexible CMS to an application platform. As the web development world embraces micro-services, how does WordPress, which is normally implemented as a monolithic solution fit in and evolve? In this talk, I will look at what makes WordPress a good choice for application development, as well as where it is lacking. To put these questions in context, this talk will be framed around a case-study of a hybrid web app, built using WordPress and other tools including VueJS, Laravel and Amazon Web Services.
2. @Josh412
CalderaLabs.org
Hi I'm Josh
Lead Developer: Caldera Labs
Caldera Forms and Caldera Forms Pro
Caldera Learn
2 books about WordPress development
Core contributor to WordPress
Member of The WPCrowd
13. @Josh412
“
CalderaLabs.org
A monolithic application built as a single unit. The
server-side application will handle HTTP requests,
execute domain logic, retrieve and update data from
the database, and select and populate HTML views to
be sent to the browser.
- Martin Fowler
15. @Josh412
“
CalderaLabs.org
The microservice architectural style is an approach
to developing a single application as a suite of small
services, each running in its own process and
communicating with lightweight mechanisms, often
an HTTP resource API.
- Martin Fowler
16. @Josh412
“
CalderaLabs.org
[in microservice architecture] there is a bare
minimum of centralized management of these
services, which may be written in different
programming languages and use different data
storage technologies.
- Martin Fowler
17. @Josh412
One server for:
PHP
Database (MySQL/MariaDB/Percona)
Webserver (nGinx/Apache)
Object Cache (Memcached/ Redis)
Email and other tasks not suited to WordPress
WordPress Is Monolithic By Default
18. @Josh412
We Are Already Moving To Services
Transactional Email Services
Task Runners For WP-Cron
Separate Database Servers(s)
Media Library on s3
CDNs
Decoupled front-ends via REST API
Containerized Hosting Architecture
26. @Josh412
Business Needs
Case Study:
Caldera Forms Pro
Solve the WordPress contact form email
problem.
WordPress shouldn’t be used for emails.
Improve support
Stop asking questions about errors
Control our platform
Deliver all in one solutions.
36. @Josh412
APirate
Plugin to limit access to WordPress REST API
routes
Optional eCommerce via Easy Digital
Downloads
Could work with other eCommerce platforms
Pronounced “API Rate” or “A Pirate”
Gitlab.com/caldera-lab/apirtate
38. @Josh412
Transaction
(new
subscription
or update)
Find Account
CF Pro
Account
Exists?
Find by
wp_id
Create Key
Create
Account
Update Key
Update
Account
Store App Account
ID as wp_post_meta
CF Pro App
WordPress
(Taco)
WordPress
(EDD/Core/Etc)
APirate
Color Key
NO Yes
Plan One: eCommerce
41. @Josh412
Shortcomings Of Plan One
All requests go through WordPress
Double-blocking POST requests
Scaling challenges
No isolation
Crash one site, crash them all
42. @Josh412
Plan Two: Towards Microservices
WordPress
eCommerce
App Login
Marketing Automation
Docs
Main App
API Key Authentication
UI
SendGrid Proxy
PDF Generation
Resource Management (via s3)
45. @Josh412
Main App: Laravel
Laravel Blade to serve one view for SPA
Some additional ugly screens for admin
API for:
Key auth
Account management
Message handling (SendGrid proxy)
Taco
Assets to s3
46. @Josh412
App Front-end : VueJS
Single page web app
Webpack
Vuetify
Vue Router
Uses API Keys To Authenticate vs App
Cookies used to store key/token
47. @Josh412
Logging App
Connects to client plugin
Key auth via main app
Saves logs from client via Monolog and s3
No database
Unless you count Redis...
48. @Josh412
Client Plugin
Connects to Caldera Forms via Plugins API
Connects to main app via key auth
Connects to log app via key auth
Admin page uses VueJS and WordPress REST
API
49. @Josh412
CalderaLabs.org
App: eCommerce
CF Pro App
WordPress
(Taco)
WordPress
(EDD/Core/Etc)
Client Plugin
Color Key
Logging App
Transaction (new subscription or
update)
Find Account
CF Pro
Account Exists?
Find by wp_id
Create Account Update Account
Store App Account ID as wp_post_meta
50. @Josh412
CalderaLabs.org
App: Login
CF Pro App
WordPress
(Taco)
WordPress
(EDD/Core/Etc)
Client Plugin
Color Key
Logging App
Login wp-json
Get CF Pro
Account ID
Load App
JWT Auth
Plugin