fly launch --no-deploy --org <org> --region <region> --copy-config --name <app-name>
fly volumes create corro_data -y -s 10 -r <region> -a <app-name>
fly deploy --dockerfile examples/fly/Dockerfile -a <app-name> -c examples/fly/fly.toml
fly machine clone -a <app-name> --region <other region> --select
fly machine clone -a <app-name> --region <yet another region> --select
The readable API surface for Corrosion-produced data is to use SQLite and read directly from the database.
Adding indexes either through the API or schema files is the way to go to improve read performance on application-specific queries.
The only way to write data that propagates through the Corrosion cluster is to go through its HTTP API.
Corrosion's HTTP API is rqlite-compatible. This is both meant as a shortcut and to have ready-made clients for it.
See: https://rqlite.io/docs/api/api/#writing-data
Corrosion-specific limitations:
- All requests are treated as if the
transaction
query param had been passed (everything runs in a transaction) - There's a limit to how many statements can be input at once to reduce changeset sizes (this shouldn't be the case for long)
Corrosion migrates schema changes automatically without the need for manual migration files. Each schema SQL file is expected to contain SQLite-compatible statements that create resources (e.g. CREATE TABLE
and CREATE INDEX
). ALTER
or DROP
statements are not supported. Destructive actions are ignored.
Configuring Corrosion with schema_paths
lets you define filesystem directories where .sql
files can be found. These files should, as a whole, represent the schema for your data.
You can add or modify schema files in known paths or even modify the schema_paths
and then send a SIGHUP signal to Corrosion to apply schema changes, without a restart.
This endpoint accepts the same type of body as the /v1/transactions
endpoint, except it will mutate Corrosion's schema.
One of Corrosion's most powerful features is the ability to subscribe to changes as they are applied to the local node.
This works via websockets for maximum compatibility.
(WIP)