We have just released a new version of immugw, v1.3.0. This release adds support to handle concurrent requests to multiple databases on the immudb server, enabling you to have a single proxy for interacting with immudb.
Before the release, a single immugw instance could only handle concurrent connections to a single database. Users who had their data sharded across multiple databases had to deploy one immugw instance per database to interact with multiple databases concurrently. With v1.3.0, immugw can now be deployed as a single proxy instance to interact with multiple databases on an immudb server.
Note:
This requires a major change in the API endpoints. As this release has a breaking change, users are advised to review the breaking change to determine whether configuration changes are needed when upgrading.
You can find the swagger schema here. If you want to run the Swagger UI, simply run the following Docker command after you cloned this repo:
docker run -it -p 8081:8080 --name swagger-immugw -v ${PWD}/swagger.json:/openapi.json -e SWAGGER_JSON=/openapi.json swaggerapi/swagger-ui
Following is an example of how you can interact with immugw.
You can find instructions to run immudb here
./immudb
You can find instructions to run immugw here
./immugw
curl --location --request POST '127.0.0.1:3323/login' \
--header 'Authorization;' \
--header 'Content-Type: application/json' \
--data-raw '{
"user": "aW1tdWRi",
"password": "aW1tdWRi"
}' | jq .token
Login
stepcurl --location --request GET '127.0.0.1:3323/db/use/defaultdb' \
--header 'Content-Type: application/json' \
--header 'Authorization: ' | jq .token
Use Database
stepcurl --location --request POST '127.0.0.1:3323/db/defaultdb/verified/set' \
--header 'Content-Type: application/json' \
--header 'Authorization: ' \
--data-raw '{
"setRequest": {
"KVs": [
{
"key": "a2V5MQ==",
"value": "dmFsMQ=="
}
]
}
}'
Use Database
stepcurl --location --request POST '127.0.0.1:3323/db/defaultdb/verified/get' \
--header 'Content-Type: application/json' \
--header 'Authorization: ' \
--data-raw '{
"keyRequest": {
"key": "a2V5MQ=="
}
}'