SlicingDice Documentation

SlicingDice - The All-in-One Solution Documentation

Welcome to the SlicingDice documentation. You'll find comprehensive guides and documentation to help you start working with SlicingDice as quickly as possible, as well as support if you get stuck. Let's jump right in!

Get Started    Guides

3. Database Creation, Update & Deletion

On this page, we present how to create, update and delete databases using the API, although it's also possible to create and delete databases using the Control Panel.

Different from most of the API endpoints, the database creations and deletions uses the Team Key, not the Database Key. You can read more about the Team Key on this page.

Creating a database using the /database endpoint

You can create a database through the POST /database API endpoint. To create a database you'll just need to create command like the following example:

curl -X POST https://api.slicingdice.com/v1/database \
    -H 'Authorization: TEAM_API_KEY' \
    -H 'Content-Type: application/json' \
    -d '{
    	"database": {
      		"name": "UsersDB",
      		"description": "Database to store users data",
      		"type": "test",
      		"pricing-model": "pay-per-column",
      		"labels": ["financialdb", "technicaldb"],
      		"query-load": "normal",
      		"insertion-load": "high",
          "cloud_provider": "ovh",
          "cloud_area": "global"
    		},
    	"addresses-whitelist": ["192.168.0.1", "192.168.0.2"]
}'

Request parameters

The following parameters apply to the database creation request:

  • database (required)
    The database parameter will contain the basic configuration of your database like name, description, is-test, pricing-model, query-load and insertion-load that will be explained below.

  • name (required)
    Defines the database name as it'll show in control panel, up to 64 characters. All ASCII characters are allowed, except ', " and

  • description (optional)
    Describes what this database is about. Useful when the name may introduce ambiguity.

  • type (required)
    Defines if this database will be a test database (free of charges but your data will be deleted after 7 days) or an official production database.

  • pricing-model (required)
    This parameter defines what will be the pricing model for your production database. You can choose between "pay-per-column" or "pay-per-gigabyte" model. Before choosing the best option for you, read more about our pricing models.
    The pricing model parameter is ignored if you are creating a test database

  • labels (optional)
    Possible labels to attach to this database.

  • query-load (required)
    The query load defines the quantity of queries requests that you'll be limited to execute per minute. You can choose:

    • Normal - Up to 60 Queries Per Minute
    • High - Up to 300 Queries Per Minute
    • Ultra - Up to 600 Queries Per Minute
    • Mega - Up to 6000 Queries Per Minute
  • insertion-load (required)
    The insertion load defines the number of insertions (rows) that you'll be limited to execute per minute. You can choose:

    • Normal - up to 10 million Insertions (and Updates) per Day
    • High - up to 100 million Insertions (and Updates) per Day
    • Ultra - up to 500 million Insertions (and Updates) per Day
    • Mega - up to 1 billion Insertions (and Updates) per Day
  • cloud_provider (optional)
    The cloud where your database will be stored. The default value is "ovh" (with cloud_area "global").

  • cloud_area (optional)
    The area where your database will be stored. The default value is "global" (with cloud_provider "ovh")

  • addresses-whitelist (optional)
    This parameter defines a list of IP addresses or website domains that can use this custom key to access a database.

Request response to database creation

The column creation POST request above will result in this response below:

{
    "status": "success",
    "database-name": [
        "UserDB"
    ]
}

Response elements:

  • status - Request status, informing whether it was successful or not.
  • name - The name of the created database.

Cloud providers and areas

SlicingDice can be stored in many cloud platforms. We run the instance in the cloud providers, and only selected areas that have at least 3 availability zones.
Below is a table that shows the cloud provider's codes and its available cloud areas.

cloud_provider
cloud_area

alibaba-cloud

cn-beijing
cn-hangzhou
cn-shanghai
cn-shenzhen
ap-southeast-1

google-cloud

asia-east1
asia-east2
asia-northeast1
asia-south1
asia-southeast1
australia-southeast1
europe-north1
europe-west1
europe-west2
europe-west3
europe-west4
northamerica-northeast1 southamerica-east1
us-central1
us-east1
us-east4
us-west1
us-west2

aws

us-east1
us-east2
us-west1
us-west2
ap-southeast-1
ap-southeast-2
ap-northeast-1
eu-central-1
eu-west-1
eu-west-2
eu-west-3
eu-north-1
sa-east-1

azure

us-central
us-east2
fr-central
eu-north
ap-southeast-1
eu-west
us-west2

ovh

global (Canada, Germany, and France)


Updating a database using the /database endpoint

You can update a database through the PUT /database API endpoint. To update a database you just need to create a command like the following example:

curl -X PUT https://api.slicingdice.com/v1/database \
    -H 'Authorization: TEAM_API_KEY' \
    -H 'Content-Type: application/json' \
    -d '{
    	"database": {
      		"name": "UsersDB",
          "new-database-name": "NewUserDB",
      		"description": "Database to store users data",
      		"type": "test",
      		"pricing-model": "pay-per-column",
      		"labels": ["financialdb", "technicaldb"]
      		"query-load": "normal",
      		"insertion-load": "high"
    		},
    	"addresses-whitelist": ["192.168.0.1", "192.168.0.2"]
}'

Deleting a database using /database endpoint

You can delete a database through the /database API endpoint. You can do it providing the database name in your request, such as the following example:

curl -X DELETE https://api.slicingdice.com/v1/database \
    -H 'Authorization: TEAM_API_KEY' \
    -H 'Content-Type: application/json' \
    -d '{
         "database": {
        		"name": "UsersDB"
    		}
      }'

Request parameters

The following parameters apply to the database creation request:

  • database (required)
    Contain the name parameter of the database that will be deleted.

  • name (required)
    Database name that will be deleted from your account. It should be a valid database name (this database must exist in your account)

Prevent Database Deletion

For security reasons, you can configure the Team Key to do not allow database deletion using the API, on the Control Panel.