That is a demo of Tarantool application. It uses Tarantool Cartridge
and crud
module to provide CRUD API over distributed cluster and exposes a part of its API via HTTP interface - see OpenAPI
.
To build application and setup topology:
cartridge build
cartridge start -d
cartridge replicasets setup --bootstrap-vshard
Now you can visit http://localhost:8081 and see your application's Admin Web UI.
CRUD API could be accessed on instances with app.custom.router
role enabled.
Note, that application stateboard is always started by default.
See .cartridge.yml
file to change this behavior.
To configure database scheme - refer to Cartridge documentation
and DDL docs
.
For the purposes of the demo you can just proceed to Code
tab in Web UI and uncomment example schema.
Application entry point is init.lua
file.
It configures Cartridge, initializes admin functions and exposes metrics endpoints.
Before requiring cartridge
module package_compat.cfg()
is called.
It configures package search path to correctly start application on production
(e.g. using systemd
).
Application has 2 simple role, app.roles.router
and app.roles.storage
.
Those implements simplified CRUD API over HTTP.
Router has a builtin HTTP server exposing a few endpoints - see OpenAPI
. That roles "routes" requests to storages to retrive data according to sharding keys that is so external client does not care about cluster topology and sharding mechanics at all.
Storage is role for instances that actually stores data.
Also, Cartridge roles are registered
(vshard-storage
, vshard-router
and metrics
).
You can add your own role, but don't forget to register in using
cartridge.cfg
call.
Configuration of instances that can be used to start application
locally is places in instances.yml.
It is used by cartridge start
.
Topology configuration is described in replicasets.yml
.
It is used by cartridge replicasets setup
.