API Reference – Batch

The Batch endpoint saves up to 100 items in a single call.

Here is the URL to call the Batch endpoint.

PUT https://batch-[region].gyxi.com/[databaseId]/[type]/[partition]

[region] should be one of the available regions.

[databaseId] should be a guid of your choice and this is your database name and also your secret key.

[type] is the type of data you are saving, like a class name or table name.

[partition] is the key where you want to save the data – it could be the contents of a foreign key.[id] is the id of this specific item.

Example

For example, maybe your company is a European company headquartered in Germany, so you choose to save your data there. You are migrating your data from another system and now you want to save all 150 employees to your new Gyxi database.

The URL might look like this:

PUT https://batch-germany.gyxi.com/5fdf17c4-1a01-40f7-9236-234fefb1c6de/employee/london

The contents might look like this:

{
"27": {
"id": 27,
"name": "Paul McCartney",
"department": "London"
},
"28": {
"id": 28,
"name": "John Greengrass",
"department": "London"
},
"29": {
"id": 29,
"name": "Stig",
"department": "London"
}
// And 97 more
}

If more than 100 items are included in the call, then the call will be declined and you will get a 400 Bad Request back.

If you receive 200 OK then the items were saved. The average response time is about 100m but it may vary and it might vary more than other endpoints as this endpoint does not follow the same performance targets as the other endpoints. It is designed for migrations and variable performance is OK during a migration.

Additionally, if you have any Views associated with the data, then those Views may take a bit longer to update. If you add a million items, expect that it may take an hour for all Views to be fully updated.