kvbox.cloud
Guides

Where your data lives

Say once where your boxes, databases and storage go, a country or a region, and what that does and does not cover.

A location is where a new thing is made: a box, a database, your object storage, your container registry, a Kubernetes cluster. You say it once for your account, or for an org, and everything made from then on goes there. Until you do, a new thing goes to whichever server has the most room, in whatever country that is.

kvbox location ls                        # the countries and regions with a server now
kvbox location set eu                    # from now on, everything you make goes to the EU
kvbox location                           # your default, and the countries it covers
kvbox new web                            # lands on a server in an EU country, or is refused

Countries and regions

A location is one of two things:

  • a country: where a server is. Write its two-letter code or its English name: DE, de, germany, romania.
  • a region: a named group of countries, the same for everyone. There are two:
RegionWhat it is
euThe 27 member states of the European Union. It is the Union, not the continent: a server in the United Kingdom, Switzerland or Norway is not in eu
usThe United States alone

A server is in a region because its country is. kvbox location ls lists what you can use today: a country or a region shows only while a server there is answering.

us in lower case is the region and US in upper case the country. They are the same servers today, so either works.

The default

Your account has one default location, and each org has its own. There is none per person inside an org.

kvbox location set DE                    # yours
kvbox location set eu --org acme         # acme's
kvbox location --org acme                # look at acme's
kvbox location unset                     # none again: any server, as before
  • You set your own. An org's is set by its owners; every member can see it.
  • No default: nothing changes, a new thing goes to any server.
  • A set changes nothing that exists. It decides only where new things go. See Moving something.

The web app has the same setting in your account's and each org's settings, and every create form starts on it.

One thing somewhere else

--location on a command that makes something wins over the default, for that one thing:

kvbox new edge --location us             # this box in the US; the default stays eu
kvbox pg create orders --location DE
kvbox redis create cache --location DE
kvbox bucket create uploads --location eu
kvbox registry create --location eu
kvbox k8s create prod --size m --location DE

What was made says where it landed: kvbox ls has a country per box, and kvbox pg info, kvbox registry info, kvbox bucket info and kvbox k8s ls show the place.

The rule

With a location, from the command or from the default, only servers in a country inside it are looked at.

Nothing is ever placed elsewhere. When no server inside has room, the command is refused, and the message names the location and the places that could take it:

no host in eu (European Union) has room for a 2 vCPU/4 GB box: … There is room in United States (--location)

--force skips the check for room, never the location.

Two flags name the server themselves, so the default does not apply to them:

  • --near <box> puts the new thing on that box's server;
  • kvbox new --from <snapshot> starts on the server that holds the snapshot.

They win over the default, and the answer says where the thing landed. Together with a --location on the same command that does not contain that server, the command is refused.

A box made from another box keeps its source's location: a fork (kvbox vm fork) has the location of the box it copies, and a box started from a snapshot, without a --location of its own, has the location of the box the snapshot was taken of. Its backups stay inside it like the source's.

Object storage and the container registry are one per account. The location counts when they are made (for storage, with your first bucket); a later bucket goes into the storage you have, wherever it is.

What stays inside by itself

Everything remembers the location it was made under, and what kvbox moves on its own stays inside it:

  • Backups. A backup of a thing made under eu is kept only on a backup store in eu: by hand or nightly, of a box, a database, the object storage, the registry or a cluster. When no store there has room the backup fails with no backup store in eu (European Union) has room, costs nothing, and is not sent anywhere else. A volume's backup goes by the box the volume is attached to.
  • Cluster pools. A cluster made under a location grows only onto servers inside it. A pool that cannot is refused with what fits.

A thing made under no location uses any store and any server, as before.

Moving something

There is no move command. A box changes location the way it changes server:

kvbox vm backup create web --wait        # 1. back it up
kvbox new web2 --from-backup <id> --location us   # 2. a new box from the backup, in the new place
kvbox rm web                             # 3. remove the old one

The new box is placed by the rule like any other. A database is the same with kvbox pg create <name> --from-backup <id> --location …. The backup itself stays on the store it was written to until it expires or you remove it.

What it does not cover

A location is about where your servers and their disks are. It is not a statement about everything kvbox holds or carries:

  • Account data is in one place for everyone. Names, emails, the list of your boxes and what they are called, usage and billing records are in the kvbox control plane's database, which is not in your location.
  • Traffic may pass through another country. A request to a *.kvbox.app name or a custom domain goes through kvbox's edge before it reaches your box. A server behind a home router is reached through a relay, for SSH and published ports too. The edge and a relay may be in another country than the box.
  • A server's country is what its operator said. It is set when the server joins; nothing checks it.
  • The S3 region is a different thing. --region on kvbox bucket create (de-center-1, ro-west-1) is the name S3 requests are signed with, see Object storage. It is not a location. Give both and a server must be in both.

From code

The TypeScript SDK has kvbox.locations.list(), kvbox.location.get() and set(), and location on each create. An API key obeys the default like a person does.

Not yet

  • A volume has no location of its own. Its backup follows the box it is attached to; a detached volume's goes to any store.
  • An org cannot yet turn its default into a rule its members cannot override, or allow several locations and nothing else.
  • No cities or zones inside a country, and no other regions than eu and us.

On this page