# Workspaces and segments

URL: https://docs.folkways.io/docs/concepts/workspaces-and-segments

A workspace holds your package, team and billing; a segment is one isolated app inside it.

<Diagram name="hierarchy" alt="Your account owns or joins workspaces. A workspace has one package, billing, team members and Platform API keys, and holds segments. Each segment, such as Chat (production) and Chat (staging), has its own signing keys, publishable keys, topic rules, limits and topics. Tokens, topics and usage never cross segments." />

## Workspace [#workspace]

A workspace is your team's account. It has:

- **one package**, which sets the allowances for connections, messages, data transfer, topics and segments. Usage
  is **pooled** across all the workspace's segments;
- **team members**, each with a role (owner, admin, editor or viewer);
- **billing**, and **Platform API keys** for your servers.

Each person can own one Free workspace, and can be a member of any number of workspaces.

## Segment [#segment]

A segment is one app in one environment, for example "Chat (production)" or "Chat (staging)". It has its own:

- **signing keys and publishable keys**, so a token for one segment never works in another;
- **topic rules**, and the topics they allow;
- **settings**: which transports it accepts, whether anonymous visitors may connect, how many connections one user
  may hold, its own limits and its rate-limit preset.

Every token carries its segment's ID, and the Realtime API takes the segment only from the verified token. No
request names a segment any other way, so one segment's clients can never reach another's topics.

| Use a separate segment for | Why |
| --- | --- |
| Each environment | A staging token can't reach production data, and you can test new rules safely |
| Each independent app | Separate keys, rules and limits; usage shows per segment |

Topics in one segment are separate from same-named topics in another: `chat/lobby` in staging and `chat/lobby` in
production never meet.

## When a segment stops serving [#when-a-segment-stops-serving]

A segment refuses connections with `Suspended` when you turn it off in its settings, or when the workspace's
package is no longer active (for example, a cancelled subscription has ended). Open connections are closed with the
same code.

## Where to manage them [#where-to-manage-them]

- [Create a workspace and pick a package](/docs/get-started/console-setup#create-a-workspace)
- [Segments in the Console](/docs/console/segments)
- [Packages and billing](/docs/console/packages-and-billing)
