# Switchover and Failover Processes

## Switchover process

For administrative reasons, automatic switchovers happen in a controlled, planned manner during the scheduled maintenance. However, data is preserved during a switchover.

During a switchover, the IP address of the primary server is moved to the promoted replica server. Meanwhile, the client is signaled about the switchover by closing the TCP connection on the server. The client automatically closes the connection and reconnects to the In-Memory DB instance.

## Failover process

<code class="expression">space.vars.ionos\_cloud</code> DBaaS for In-Memory DB has an automatic failover enabled by default. A failover can occur when the primary node fails. As a result, one of the replicas is chosen and promoted to be the new primary node. When the old primary node returns, it is added as a replica of the instance.

{% hint style="info" %}
**Note:** You may lose the data if it is not replicated but only committed to the primary node.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.ionos.com/cloud/databases/in-memory-db/overview/switchover-failover.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
