Partnership with TheMS Manufacture Boutique
Recently TFM formed a new partnership with TheMS Manufacture. Some might wonder why a tech company considered a fashion business as a partner . The answers are simple. First because they need our help. Secondly technical challenges to build this project are big. For TFM this is a good opportunity to prove that some bleeding edge technology can be used safely in production.
We played with this bleeding edge technologies around in TFM Labs for some time now so it was just about time to see them in production environment.
On the first look the requests were simple enough. “We want a woocommerce website that will be stable, fast and kept up to date and with good reliability”. You might think ok … what’s the big deal with a wordpress website ? Probably you think that a cheap VPS will get things done ( install apache / php / mysql , then install wp and woocommerce load a theme and load products ). In theory nobody will stop you from doing that. But that approach is plain wrong.
Why ? Let’s see:
- Solution is not scalable ( So if you use a VPS good luck with scaling it up )
- Secure ? Hard to achieve (Automatic updates every hour … This is not an easy task especially on VPS )
- Database scalability ? ( On one machine ? Nope. Simply not possible )
- Static files separation ? ( How many wordpresses out there are hacked on daily basis by uploading and executing code ? )
- Logging / monitoring ? ( Maybe if your shared hosting is powerful enough )
So enough reasons why a shared hosting was / is not good enough.
So we decided to tackle each problem individually.
-
Provisioning:
- We do automatic provisioning of Vm’s on our proxmox’es cluster using ansible. ( A patch for ansible was submitted by Mihai to ansible dev tree )
- This allows us to deploy / redeploy and scale up / down the infrastructure as needed . If TheMS has a big fashion events and they expect high traffic we simply spawn rapidly new apache servers or nodes in the database.
- All provisioning and scaling up / down done via Jenkins.
-
Secure
- Automatic updates of the wp core / wp plugins / wp themes .
- We keep the customizations separately as plugins in a git
- Automatic OS updates. Updates on canary, test the canary, put the canary in cluster kill the old vm
-
Database scalability .
- We decided to use Percona XtraDB Cluster with proxysql and VRRP .
- This way we achieved a setup without any single point of failure. We will post tutorial on how to do this on our technical blog.
-
Static file separation
- This was a big challenge because :
- Uploaded files via admin should NOT be stored on apache VM’s ( obvious for security reasons )
- Static files should be served as fast as possible keeping in mind that the business can be in multiple countries ( in future )
- This was achieved by using a minio cluster ( Also details about this on our technical blog ) but basically when a file is uploaded it is stored on minio cluster and served from there directly.
- And using minio allowed us to have a cdn like distribution .
- This was a big challenge because :
-
Logging and monitoring :
- Logs are shipped for now to a central logging server where we can analyze them and produce some nice reports
- Monitoring is done with zabbix and alerting on Telegram.
In the end we obtained a very nice system that simply works. And TheMS is quite happy about the results.
And almost forgot about one thing. Epiphany wanted online payment. And we did that. We coded a woocommerce payment gateway plugin using PayU payment provider. If you are interested in this plugin you can buy it from https://shop.tfm.ro