0
0
MLOpsdevops~15 mins

Why scaling requires different strategies in MLOps - See It in Action

Choose your learning style9 modes available
Why Scaling Requires Different Strategies
📖 Scenario: You are working in a team that manages machine learning models in production. As the number of users grows, you notice that the current setup struggles to handle the load. You need to understand why scaling your system requires different strategies depending on the situation.
🎯 Goal: Build a simple Python program that models different scaling strategies and shows how they affect system capacity. This will help you understand why one size does not fit all when scaling machine learning systems.
📋 What You'll Learn
Create a dictionary called systems with three keys: 'single_node', 'horizontal_scaling', and 'vertical_scaling' with values 1, 5, and 2 respectively.
Create a variable called load and set it to 7.
Use a for loop with variables strategy and capacity to iterate over systems.items() and create a new dictionary can_handle_load where each key is the strategy and the value is true if capacity is greater than or equal to load, otherwise false.
Print the can_handle_load dictionary to show which strategies can handle the load.
💡 Why This Matters
🌍 Real World
In real machine learning operations, systems must scale to handle more users or data. Different scaling strategies like adding more machines (horizontal) or upgrading a machine (vertical) have different limits and costs.
💼 Career
Understanding scaling strategies is key for MLOps engineers to keep machine learning models running smoothly as demand grows.
Progress0 / 4 steps
1
Create the initial system capacities
Create a dictionary called systems with these exact entries: 'single_node': 1, 'horizontal_scaling': 5, and 'vertical_scaling': 2.
MLOps
Need a hint?

Use curly braces to create a dictionary with the exact keys and values.

2
Set the current load value
Create a variable called load and set it to 7.
MLOps
Need a hint?

Just assign the number 7 to the variable named load.

3
Determine which strategies can handle the load
Use a for loop with variables strategy and capacity to iterate over systems.items(). Inside the loop, create a dictionary called can_handle_load where each key is the strategy and the value is true if capacity is greater than or equal to load, otherwise false.
MLOps
Need a hint?

Start with an empty dictionary can_handle_load = {}. Then use a for loop to fill it.

4
Print the results
Write print(can_handle_load) to display which scaling strategies can handle the load.
MLOps
Need a hint?

Use the print function to show the dictionary.