What the Fork?

Forking is a term used a lot in the technical community and it means to make a copy of a codebase in order to make changes.

To put it a different way, forking a service means making a copy of your current service under a different name (it can also be in a different cloud or even on a different plan). Nothing happens to your original service, it just means you now have an independent replica of it running as well.

When you do fork, the following things are copied into the new service:

  • configuration

  • databases

  • service users

  • connection pools

But not Service Integrations!

Why the Fork?

Why would you want this? Great question and there are many, many reasons:

  • To create a Development copy of your Production database

  • To create a snapshot of your service at a point in time to analyse a bug or issue

  • To create instances of the same database in different geographical locations

  • To test upgrading to a newer version before upgrading your production service

How the Fork?

Forking is supported for the following Aiven services:

  1. PostgreSQL

  2. MySQL

  3. Redis

  4. Cassandra (Note: No forking to a lower amount of nodes currently)

  5. Elasticsearch

  6. InfluxDB

  7. M3DB

  8. Grafana

To fork one of these services, use the Web Console, our API, our CLI or Terraform Provider.

For services with Point in Time Recovery (PITR) available, you can either fork using the latest transaction or you can select a point in the past to restore to.

Forking in the Aiven Console

  1. Go to Service Overview.

  2. Click New database fork.

  3. Select a region and a plan.

Forking in the Aiven CLI

To create a fork using the Aiven Command Line Client:

  1. Create a new service.

  2. Add service_to_fork_from to the config arguments.

For example, let's say we want to fork our Postgres service forker to a new service forked.

avn service create forked -t pg --plan business-4 -c service_to_fork_from=forker

More about forking

For extra reading, you can see how forking across projects works or read up on restoring from a backup using a fork.

Did this answer your question?