Deploying any Machine Learning Model to production involves certain challenges which include:

  1. Concept Drift & Data Drift:** Concept Drift is basically when the relationship between the training variable & the target output changes, whereas data drift is the change in the distribution of the data over time. Both can lead to a decline in the model's performance.

  2. Software Engineering Issues: When we are deploying an ML Model there are certain factors that we need to think about, for example, the latency & the throughput needed, whether to have real-time or batch predictions. How to log the results for monitoring & maintaining the security & privacy of data.

When we train Machine Learning using a specific algorithm, the best way to deploy the model in production depends on a number of factors:

  1. The acceptable downtime of our Machine Learning Solution.

  2. The operation cost & the human involvement in deploying the model.

  3. The ease with which we can roll back the model in case of a drift.

  4. Whether there is a need to test with production traffic or not.

Now that we have understood what the different challenges in deploying a Model are, let's take a look at the different deployment strategies.

ML Model Deployment Strategies

Recreate Deployment

Shadow Deployment

Gradual Ramp-Up with Monitoring

The next 2 deployment strategies involve releasing the model for a certain % of users & then based on the performance monitoring, making it available to 100% of users.

Canary Deployment

A/B Testing Deployment


Blue-Green Deployment


Below is a brief table of differences based on the explanation of each method and the four main considerations we mentioned above for picking a deployment strategy. I hope this article helps you select the right deployment strategy for your Machine Learning applications.

Recreate

Shadow

Canary

A/B Testing

Blue/Green

Leads to Downtime

Yes

No

No

No

No

Possibility of Rollback

Yes but with downtime

No need for a rollback

Yes, fast

Yes, fast

Yes, very fast

Testing with Production Traffic

No

Yes

Yes

Yes

No

Extra costs of Deployment

No

Yes, for testing the new model with production data

No

No

Yes, need to maintain two separate environments



Also published here.