Skip to content

Quick Start

Actionbase Quick Start Demo
  • Docker
Terminal window
docker run -it ghcr.io/kakao/actionbase:standalone

This runs the server in the background (port 8080) and the CLI in the foreground.

actionbase>

Load sample data using a preset (at actionbase> prompt):

load preset likes

This creates a likes database/table and inserts 3 edges:

│ 3 edges inserted
│ - Alice → Phone
│ - Bob → Phone
│ - Bob → Laptop
Alice --- likes ----> +--------+
| Phone |
Bob ----- likes ----> +--------+
|
| +--------+
+-- likes ----> | Laptop |
+--------+

At write time, Actionbase precomputes everything for reads—counts, indexes, ordering for both directions. This means you can instantly query:

“What did Bob like?” (direction: OUT)

“Who liked Phone?” (direction: IN)

Counts and indexes ready at write time—no computation at query time.

REST API equivalent

To use curl, run with -p 8080:8080 and use another terminal:

Terminal window
docker run -it -p 8080:8080 ghcr.io/kakao/actionbase:standalone

Create service (database)

Terminal window
curl -X POST "http://localhost:8080/graph/v2/service/likes" \
-H "Content-Type: application/json" \
-d '{"desc":"Likes"}'

Create label (table)

Terminal window
curl -X POST "http://localhost:8080/graph/v2/service/likes/label/likes" \
-H "Content-Type: application/json" \
-d '{
"desc":"Like",
"type":"INDEXED",
"schema":{
"src":{"type":"STRING"},
"tgt":{"type":"STRING"},
"fields":[{"name":"created_at","type":"LONG","nullable":false}]
},
"dirType":"BOTH",
"storage":"datastore://likes/likes",
"indices":[{"name":"recent","fields":[{"name":"created_at","order":"DESC"}]}]
}'

Insert edges

Terminal window
curl -X POST "http://localhost:8080/graph/v3/databases/likes/tables/likes/edges" \
-H "Content-Type: application/json" \
-d '{
"mutations":[
{"type":"INSERT","edge":{"version":1737377177245,"source":"Alice","target":"Phone","properties":{"created_at":1737377177245}}},
{"type":"INSERT","edge":{"version":1737377177297,"source":"Bob","target":"Phone","properties":{"created_at":1737377177297}}},
{"type":"INSERT","edge":{"version":1737377177350,"source":"Bob","target":"Laptop","properties":{"created_at":1737377177350}}}
]
}'

Check if a specific edge exists:

get --source Alice --target Phone
│ The edge is found: [Alice -> Phone]
│ |---------------|--------|--------|---------------------------|
│ | VERSION | SOURCE | TARGET | PROPERTIES |
│ |---------------|--------|--------|---------------------------|
│ | 1737377177245 | Alice | Phone | created_at: 1737377177245 |
│ |---------------|--------|--------|---------------------------|
REST API equivalent
Terminal window
curl "http://localhost:8080/graph/v3/databases/likes/tables/likes/edges/get?source=Alice&target=Phone"

What did Bob like? (direction: OUT)

scan --index recent --start Bob --direction OUT
│ The 2 edges found (offset: -, hasNext: false)
│ |---|---------------|--------|--------|---------------------------|
│ | # | VERSION | SOURCE | TARGET | PROPERTIES |
│ |---|---------------|--------|--------|---------------------------|
│ | 1 | 1737377177350 | Bob | Laptop | created_at: 1737377177350 |
│ | 2 | 1737377177297 | Bob | Phone | created_at: 1737377177297 |
│ |---|---------------|--------|--------|---------------------------|

Who liked Phone? (direction: IN)

scan --index recent --start Phone --direction IN
│ The 2 edges found (offset: -, hasNext: false)
│ |---|---------------|--------|--------|---------------------------|
│ | # | VERSION | SOURCE | TARGET | PROPERTIES |
│ |---|---------------|--------|--------|---------------------------|
│ | 1 | 1737377177297 | Bob | Phone | created_at: 1737377177297 |
│ | 2 | 1737377177245 | Alice | Phone | created_at: 1737377177245 |
│ |---|---------------|--------|--------|---------------------------|
REST API equivalent
Terminal window
# OUT
curl "http://localhost:8080/graph/v3/databases/likes/tables/likes/edges/scan/recent?start=Bob&direction=OUT"
# IN
curl "http://localhost:8080/graph/v3/databases/likes/tables/likes/edges/scan/recent?start=Phone&direction=IN"

How many items did Alice like? (direction: OUT)

count --start Alice --direction OUT
│ |-------|-----------|-------|
│ | START | DIRECTION | COUNT |
│ |-------|-----------|-------|
│ | Alice | OUT | 1 |
│ |-------|-----------|-------|

How many users liked Phone? (direction: IN)

count --start Phone --direction IN
│ |-------|-----------|-------|
│ | START | DIRECTION | COUNT |
│ |-------|-----------|-------|
│ | Phone | IN | 2 |
│ |-------|-----------|-------|
REST API equivalent
Terminal window
# OUT
curl "http://localhost:8080/graph/v3/databases/likes/tables/likes/edges/count?start=Alice&direction=OUT"
# IN
curl "http://localhost:8080/graph/v3/databases/likes/tables/likes/edges/count?start=Phone&direction=IN"