TFM partnership with TheMS Manufacture Boutique

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:

  1. Solution is not scalable ( So if you use a VPS good luck with scaling it up )
  2. Secure ? Hard to achieve (Automatic updates every hour … This is not an easy task especially on VPS )
  3. Database scalability ? ( On one machine ? Nope. Simply not possible )
  4. Static files separation ? ( How many wordpresses out there are hacked on daily basis  by uploading and executing code ?  )
  5. 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.

  1. Provisioning:

    1. 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 )
    2. 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.
    3. All provisioning  and scaling up / down done via Jenkins.
  2. Secure

    1. Automatic updates of the wp core / wp plugins / wp themes .
    2. We keep the customizations separately as plugins in a git
    3. Automatic OS updates. Updates on canary, test the canary, put the canary in cluster kill the old vm
  3. Database scalability .

    1. We decided to use Percona XtraDB Cluster with proxysql and VRRP .
    2. 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.
  4.  Static file separation

    1. This was a big challenge because :
      1. Uploaded files via admin should NOT be stored on apache VM’s ( obvious for security reasons )
      2. Static files should be served as fast as possible keeping in mind that the business can be in multiple countries ( in future )
    2. 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.
    3. And using minio allowed us to have a cdn like distribution .
  5.  Logging and monitoring :

    1. Logs are shipped for now to a central logging server where we can analyze them and produce some nice reports
    2. 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

Posted in Uncategorized.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.