CogDB Cloud
CogDB Cloud is a managed graph database you connect to with an API key. No local storage, no server setup. Just pip install cogdb and connect.
Get an API Key
- Go to the CogDB Cloud console and sign in with Google.
- Click Generate API Key, pick a region, and give the key a label.
- Copy the key. You won't see it again.
Regions
CogDB Cloud runs in two independent regions. Your graph data lives in exactly one region, chosen when you create your API key, and never leaves it.
| Region | Endpoint | Infrastructure |
|---|---|---|
us (United States) | https://us.api.cogdb.io | AWS |
eu (European Union) | https://eu.api.cogdb.io | Hetzner (Falkenstein, Germany) |
An API key only works against its own region's endpoint. Requests to any other region return 401. Always pair the key with the endpoint shown when it was created.
In the EU region, graph data, the write-ahead log, and encrypted backups all stay on Hetzner infrastructure in Germany. API traffic goes directly to the node with no US CDN or proxy in the data path. Account sign-in and billing run on a US-based control plane that stores account identity and key hashes only. Graph data never touches it.
Connect to CogDB Cloud
Point the client at your key's region, then pass the API key when creating a graph:
from cog import config
config.CLOUD_URL = "https://eu.api.cogdb.io" # your key's region endpoint
from cog.torque import Graph
g = Graph("movies", api_key="cog_8ab0bc8e8271413d95997fc543f6ffd2")That's it. All put, get, and traversal operations now run against CogDB Cloud.
Example
from cog.torque import Graph
g = Graph("movies", api_key="cog_8ab0bc8e8271413d95997fc543f6ffd2")
# Add data
g.put("inception", "type", "film")
g.put("inception", "directed_by", "nolan")
g.put("inception", "year", "2010")
g.put("inception", "genre", "sci-fi")
g.put("inception", "stars", "dicaprio")
g.put("inception", "stars", "hardy")
g.put("interstellar", "type", "film")
g.put("interstellar", "directed_by", "nolan")
g.put("interstellar", "year", "2014")
g.put("interstellar", "genre", "sci-fi")
g.put("interstellar", "stars", "mcconaughey")
g.put("interstellar", "stars", "hathaway")
g.put("dark_knight", "type", "film")
g.put("dark_knight", "directed_by", "nolan")
g.put("dark_knight", "genre", "action")
g.put("dark_knight", "stars", "bale")
g.put("dark_knight", "stars", "ledger")
g.put("dicaprio", "type", "actor")
g.put("hardy", "type", "actor")
g.put("nolan", "type", "director")
# All films Nolan directed
g.v("nolan").inc("directed_by").all()
# → {'result': [{'id': 'inception'}, {'id': 'interstellar'}, {'id': 'dark_knight'}]}
# All actors in Inception
g.v("inception").out("stars").all()
# → {'result': [{'id': 'dicaprio'}, {'id': 'hardy'}]}
# 2-hop: Who directed the films DiCaprio is in?
g.v("dicaprio").inc("stars").out("directed_by").all()
# → {'result': [{'id': 'nolan'}]}
# All sci-fi films
g.v().has("genre", "sci-fi").all()
# → {'result': [{'id': 'inception'}, {'id': 'interstellar'}]}Cloud vs Local
| Local | Cloud | |
|---|---|---|
| Setup | Graph("name") | Graph("name", api_key="cog_...") |
| Storage | Local filesystem | CogDB Cloud |
| API | Same Torque API | Same Torque API |
| Use case | Prototyping, embedded apps | Production, shared access, multi-client |
The Torque query API is identical in both modes. Switching from local to cloud means adding the api_key parameter. Nothing else changes.
Managing API Keys
Visit the Cloud console to:
- Generate new API keys with custom labels
- View all your active keys
- Delete keys you no longer need
Each key is shown masked (cog_...last8chars) after creation. The full key is only displayed once, at generation time. Store it somewhere safe.