Yandex Cloud
Search
Contact UsGet started
  • Blog
  • Pricing
  • Documentation
  • All Services
  • System Status
    • Featured
    • Infrastructure & Network
    • Data Platform
    • Containers
    • Developer tools
    • Serverless
    • Security
    • Monitoring & Resources
    • ML & AI
    • Business tools
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Customer Stories
    • Gateway to Russia
    • Cloud for Startups
    • Education and Science
  • Blog
  • Pricing
  • Documentation
Yandex project
© 2025 Yandex.Cloud LLC
Yandex Compute Cloud
  • Yandex Container Solution
    • Resource relationships
    • Graphics processing units (GPUs)
    • Images
      • Overview
      • Access
      • YAML specification
      • Instance template
      • Variables in an instance template
      • Scaling types
      • Instance health checks and automatic recovery
      • Integrating with network and L7 load balancers
      • Handling a stateful workload
      • Stopping and pausing an instance group
      • Sequentially restarting and recreating instances in a group
      • Statuses
    • Dedicated host
    • Encryption
    • Backups
    • Quotas and limits
  • Access management
  • Terraform reference
  • Monitoring metrics
  • Audit Trails events
  • Release notes

In this article:

  • Storing states on group instance disks
  • Storing states outside the instance group
  1. Concepts
  2. Instance groups
  3. Handling a stateful workload

Handling a stateful workload

Written by
Yandex Cloud
Updated at March 6, 2025
  • Storing states on group instance disks
  • Storing states outside the instance group

You can use instance groups to host applications with stateful, stateless, and combined workloads.

The difference between stateful and stateless workloads lies in whether the application saves data about its states and/or user interaction history:

  • Stateful: State data is stored. Examples: RESTless services, databases, message queues, monitoring servers, and log servers.
  • Stateless: State data is not stored. Examples: RESTful services and web application frontend.

Application states can be stored on secondary disks of the group instances or in the cloud resources independent of the instance group.

Storing states on group instance disksStoring states on group instance disks

Warning

We do not recommend storing states on instance boot disks. This significantly restricts operations with an instance group. For example, you cannot freely restart, delete, recreate, and scale an instance in such a group.

You can store application states on secondary disks of the group instances if you:

  • Do not decrease the group size.

  • Do not decrease the instance disk size.

  • Use the max_expansion parameter (the maximum number of instances by which you can exceed the target size of the group) set to 0 in the deployment policy.

  • Do not delete VM instances via instance group interfaces:

    • In the management console, on the Instance groups tab.
    • Using the CLI yc compute instance-group delete-instances command.
    • Using the InstanceGroupService/DeleteInstances gRPC API call.

    These actions will delete the secondary disk along with the VM. You can directly delete a VM in Compute Cloud without deleting its secondary disk.

If you meet these conditions, the instance group will not delete secondary disks, even if any VM needs to be recreated. The secondary disks will be saved and attached to the new VM.

Storing states outside the instance groupStoring states outside the instance group

To freely manage group instances with stateful workload applications running, save the application state to cloud resources independent of the instance group:

  • Managed databases
  • File storages (for more information, see Creating an instance group connected to a file storage).
  • Yandex Object Storage buckets (for more information, see Creating an instance group connected to Yandex Object Storage).

Was the article helpful?

Previous
Integrating with network and L7 load balancers
Next
Stopping and pausing an instance group
Yandex project
© 2025 Yandex.Cloud LLC