Bridgevine: High Availability Mautic on K8s
Bridgevine: High Availability Mautic on K8s
Bridgevine needed to migrate away from their previous email provider. Desiring to bring all technologies to a multi-technology Kubernetes deployment, Bridgevine sought Facet’s Mautic expertise for development oversight.
Facet provided Mautic consultation on configuration strategy and developed a Mautic Kubernetes distribution in parallel with Bridgevine’s needs.
Bridgevine came to Facet with a tight deadline. In order to migrate away from Silverpop (now Acoustic), they needed to be up on Mautic in 60 days.
Facet was originally hired to consult, but it quickly became apparent that Bridgevine needed hands-on Mautic and Symfony development experts to hit their deadline with a high certainty.
We initially ran into problems with deploying Mautic in a high availability configuration on Kubernetes—most of our work focused on making the application container stateless
Bridgevine was trying to replace a core service for their platform—email transactions—with an open source solution stack that would allow them to scale inexpensively with demand.
Replacing Silverpop presented an opportunity to drive deeper customer insights and business intelligence with each customer interaction. Controlling the full data pipeline was posed to allow for greater personalization, engagement, and conversion through Mautic.
Discovery and Product Planning
Initial onboarding with Bridgevine required Facet get a 360º picture of the desired solutions architecture. How Mautic would be used, the interfaces with marketing campaigns and transactional emails, and special requirements would all impact how Facet would support the Mautic development.
Mautic HA Configuration
Mautic does not ship with a ready-to-deploy high availability configuration. There are Mautic application limitations that make it difficult to separate stateful and stateless configurations—for example: Mautic requires the ability to write the config.php file in order to update settings.
Mautic also, for better or worse, doesn’t allow for management of plugin configuration via code. Database-only.
Despite the limitations with Mautic 2.x, to address all Mautic high availability issues we worked in parallel with Bridgevine to develop a mautic-k8s distribution, a complete rewrite of Mautic infrastructure as compared to mautic-docker.
Mautic Kubernetes (mautic-k8s)
Facet developed a Mautic Kubernetes distribution (soon to be published on GitHub) and addressed issues with making Mautic high availability within.
Mautic-k8s includes ability to:
Deploy a stateless Mautic PHP-FPM application server in the cluster.
Store persistent cache and media directories to a shared Persistent Volume Cache (PVC).
Stream logs off the pods to a separate Elastic Fluentd Kibana (EFK) stack, wherein the full set of logs can be easily parsed.
Deploy stateful RabbitMQ in a High Availability (HA) cluster format. Since RabbitMQ is responsible for the sequential processing of page hits, email opens, and link clicks, we want failure redundancy to be as high as possible.
Environment-variable injection of appropriate infrastructure configuration, parametrizing the deployment configuration appropriately to the config_local.php, parameters_local.php, and paths_local.php files.
Terraform deployment to AWS, assuming an AWS EKS - Managed Kubernetes back-end, and AWS RDS instance.
Mautic Setup Configuration
Maximizing ease-of-management with Mautic is not straightforward. To ensure Bridgevine wouldn’t be caught up by future campaign configurations and needs, we made sure the following elements were appropriately configured:
Custom Contact Properties. Mautic doesn’t ship with all of the necessary fields, it is important to customize fields based on relationships to other systems, and understand what parameters are necessary for personalization.
Custom Company Properties. Companies have different use cases for every organization, however in Bridgevine’s case we simply needed to associate a lead with a particular originator of the lead services.
Tagging Strategy. What was allowed to be used as tags. How these tags were going to be used in campaigns / segmentation.
Mautic Campaign Strategy
To simplify repeatable campaigns, Facet worked with Bridgevine to determine a solutions architecture that would work across their partner communication channels.
Mautic campaign templates were set up based on the referring party and the service desired. When setting up Mautic campaigns it is important to remember best practices like:
Tagging to prevent reprocessing of future campaign revisions
Mautic Transactional API Testing
Since Bridgevine was using Mautic as a clearinghouse for all email communications, we developed an API testing suite using Postman. This package only tested the transactional API endpoint and ensured that we would not come up short in the future if tokenization or other functionality somehow stopped working.