ScyllaDB University LIVE, FREE Virtual Training Event | March 21
Register for Free
ScyllaDB Documentation Logo Documentation
  • Server
  • Cloud
  • Tools
    • ScyllaDB Manager
    • ScyllaDB Monitoring Stack
    • ScyllaDB Operator
  • Drivers
    • CQL Drivers
    • DynamoDB Drivers
  • Resources
    • ScyllaDB University
    • Community Forum
    • Tutorials
Download
ScyllaDB Docs ScyllaDB Open Source ScyllaDB for Developers ScyllaDB Features Scylla Enterprise Features Workload Prioritization

Caution

You're viewing documentation for a previous version. Switch to the latest stable version.

Workload Prioritization¶

ScyllaDB Enterprise

In a typical database there are numerous workloads running at the same time. Each workload type dictates a different acceptable level of latency and throughput. For example, consider the following two workloads:

  • OLTP ( Online Transaction Processing) - backend database for your application

    • High volume of requests

    • Fast processing

    • In essence - Latency sensitive

  • OLAP (Online Analytical Processing ) - performs data analytics in the background

    • High volume of data

    • Slow queries

    • In essence - Latency agnostic

Using Service Level CQL commands, database administrators (working on Scylla Enterprise) can set different workload prioritization levels (levels of service) for each workload without sacrificing latency or throughput. By assigning each service level to the different roles within your organization, DBAs ensure that each role receives the level of service the role requires.

Prerequisites¶

To create a level of service and assign it to a role, you need:

  • An authenticated and authorized user

  • At least one role created.

Work by Example¶

To follow the examples in this document, create the roles spark and web. You can assign permissions to these roles later, if needed.

Procedure

Run the following:

CREATE ROLE Spark;
CREATE ROLE Web;

Workload Prioritization Workflow¶

  1. Create a Service Level

  2. Assign a Service Level to a Role

Service Level Management¶

These commands set, list, and edit the level of service.

Create a Service Level¶

When you create a service level, you allocate a percentage of resources to the service level. Remember to use the correct naming convention to name your service level. If you decide to use Reserved Keywords, enclose them in either single or double quotes (for example 'primary').

Syntax

CREATE SERVICE_LEVEL [IF NOT EXISTS] <service_level_name> [WITH SHARES = <shares_number>];

Where:

  • service_level_name - Specifies the name of the service you’re creating. This can be any string without spaces. The name should be meaningful, such as class names (silver, gold, diamond, platinum), or categories (OLAP or OLTP), etc.

  • shares_number - The number of shares of the resources you’re granting to the service level name. You can use any number within the range from 1 to 1000. Default : 1000

Example¶

There are 3 service levels (OLAP, OLTP, Default) where: (the percentage of resources = (Assigned Shares / Total Shares) x 100). Total Shares in this case is the total of all allocated shares + the Default SLA (1000). The percentage of resources would be:

Service Level Name

Shares

Percentage of Resources

OLAP

100

4%

OLTP

1000

48%

Default

1000

48%

Total

2100

100%

Procedure

  1. To create these service levels, run the following CQL commands:

CREATE SERVICE_LEVEL IF NOT EXISTS OLAP WITH SHARES = 100;
CREATE SERVICE_LEVEL IF NOT EXISTS OLTP WITH SHARES = 1000;
  1. Confirm the service level change reflects the new service level allocations:

LIST ALL SERVICE_LEVELS;

service_level | shares
--------------+-------
         olap |    100
--------------+-------
         oltp |   1000
(2 rows)

Change Resource Allocation for a Service Level¶

You can change resource allocation for a given service level. If you don’t specify the number the shares, the default setting (1000) is used.

Syntax

ALTER SERVICE_LEVEL <service_level_name>
     WITH SHARES = <shares_number>;

Where:

  • service_level_name - Specifies the name of the service level you created. See Create a Service Level.

  • shares_number - The number of shares in the CPU that you’re granting to the service level name. You can use any number within the range from 1 to 1000. Default : 1000

Example¶

Analysts are complaining that they don’t have enough resources. To increase the resources, you change the service level attributes for the OLAP service level.

Procedure

  1. Run the following:

ALTER SERVICE_LEVEL OLAP WITH SHARES = 500;
  1. Confirm the service level change reflects the new service level allocation:

LIST SERVICE_LEVEL OLAP;

service_level | shares
--------------+-------
         olap |    500
(1 rows)
  1. To change it back to the original setting (or to remain consistent for the examples that follow) change the shares amount back to the original.

ALTER SERVICE_LEVEL OLAP WITH SHARES = 100;

Display Specified Service Level Parameters¶

Lists the specified service level with its class parameters. If the service level is attached to a role it does not appear in this list.

Syntax

LIST SERVICE_LEVEL <service_level_name>;

Where:

  • service_level_name - Specifies the name of the service level you created. See Create a Service Level.

Example¶

In this example you list the service level parameters for OLTP.

Procedure

Run the following:

LIST SERVICE_LEVEL OLTP;

service_level | shares
--------------+-------
         oltp |   1000
(1 rows)

Display All Service Levels and Parameters¶

Lists all service levels with their class parameters. This list contains all service levels including those which are assigned to roles.

Syntax

LIST ALL SERVICE_LEVELS;

Example¶

In this example, you list all service levels and their parameters.

Procedure

Run the following:

LIST ALL SERVICE_LEVELS;

service_level  | shares
---------------+--------
          olap |     100
          oltp |    1000
(2 rows)

Delete a Service Level¶

Permanently removes the service level. Any role attached to this service level is automatically assigned to the Default SLA if there is no other service level attached to the role.

Syntax

DROP SERVICE_LEVEL IF EXISTS <service_level_name>;

Where:

  • service_level_name - Specifies the name of the service level you created. See Create a Service Level.

  • IF EXISTS - If the service level does not exist and IF EXISTS is not used an error is returned.

Example¶

In this example you drop the OLTP service level.

Procedure

Run the following:

DROP SERVICE_LEVEL IF EXISTS OLTP;

Manage Roles with Service Levels¶

Once you have created roles and service levels you can attach and remove the service levels from the roles and list which roles are attached to which service levels.

Assign a Service Level to a Role¶

If you have created a role and a service level, you can attach the service level to the role.

Note

A role can only be assigned one service level. However, the same service level can be attached to many roles. If a role inherits a service level from another role, the highest level of service from all the roles wins.

Syntax

ATTACH SERVICE_LEVEL <service_level_name> TO <role_name>;

Where:

  • service_level_name - Specifies the name of the service level you created. See Create a Service Level.

  • role_name - Specifies the role that you want to use the service level on. This is the role you created with create role.

Note

Any role which does not have an SLA attached to it, receives the default SLA.

Example¶

Continuing from the example in Create a Service Level, you can attach the service levels that you created to different roles in your organization as follows:

Service Level Name

Role Name

OLAP

Spark

OLTP

Web

Procedure

To assign these service levels to the roles, run the following CQL commands:

ATTACH SERVICE_LEVEL OLAP TO Spark;
ATTACH SERVICE_LEVEL OLTP TO Web;

List All Attached Service Levels for All Roles¶

Lists all directly attached service levels for all roles. This does not include any service level which the role inherits from other roles.

Syntax

LIST ALL ATTACHED SERVICE_LEVELS;

Example¶

In this example you list all service levels attached to any role.

Procedure

Run the following:

LIST ALL ATTACHED SERVICE_LEVELS;

role   | service_level
-------+---------------
spark  |          olap
-------+---------------
  web  |          oltp

(2 rows)

List the Roles Assigned to a Specific Service Level¶

Lists all roles directly attached to a service level. This does not include any service level which the role inherits from other roles.

Syntax

LIST ATTACHED SERVICE_LEVEL OF <role_name>;

Where:

  • role_name - Specifies the role that you want to use the service level on. This is the role you created with create role.

Example¶

In this example, you list all of Roles which are assigned to the OLAP Service Level.

Procedure

Run the following:

LIST ATTACHED SERVICE_LEVEL OF Spark;

role   | service_level
-------+---------------
spark  |  olap

(1 rows)

Remove a Service Level from a Role¶

Removes a service level from a specified role. Once the service level is removed from a role, if there are other service levels attached to roles which that role inherits, the service level in the hierarchy with the most amount of shares wins.

Syntax

DETACH SERVICE_LEVEL FROM <role_name>;

Where:

  • role_name - Specifies the role that you want to use the service level on. This is the role you created with create role.

Example¶

In this example, you re-assign the Spark to a different level of service by detaching it from one level of service and attaching it to another.

Procedure

Run the following:

DETACH SERVICE_LEVEL FROM Spark;

At this point, the Spark role receives the Default SLA, until it is assigned another service level. You assign a new service level to this role using Assign a Service Level to a Role.

Using Workload Prioritization with your Application¶

In order for workload prioritization to take effect, application users need to be assigned to a relevant role. In addition, each role you create needs to be assigned to a specific Service Level. Any user that signs into the application without a role is automatically assigned the Default service level. This is always be the case with users who sign in anonymously.

Limits¶

Scylla Enterprise is limited to 8 service levels, including the default one; this means you can create up to 7 service levels.

Additional References¶

OLAP or OLTP? Why Not Both? Session by Glauber Costa from Scylla Summit 2018

Scylla University: Workload Prioritization lesson - The lesson covers:

  • The evolving requirements for operational (OLTP) and analytics (OLAP) workloads in the modern datacenter

  • How Scylla provides built-in control over workload priority and makes it easy for administrators to configure workload priorities

  • The impact of minimizing integrations and maintenance tasks, while also shrinking the datacenter footprint and maximizing utilization

  • Test results of how it performs in real-world settings

Was this page helpful?

PREVIOUS
Scylla Enterprise Features
NEXT
Scylla in-memory tables
  • Create an issue
  • Edit this page

On this page

  • Workload Prioritization
    • Prerequisites
      • Work by Example
    • Workload Prioritization Workflow
    • Service Level Management
      • Create a Service Level
        • Example
      • Change Resource Allocation for a Service Level
        • Example
      • Display Specified Service Level Parameters
        • Example
      • Display All Service Levels and Parameters
        • Example
      • Delete a Service Level
        • Example
    • Manage Roles with Service Levels
      • Assign a Service Level to a Role
        • Example
      • List All Attached Service Levels for All Roles
        • Example
      • List the Roles Assigned to a Specific Service Level
        • Example
      • Remove a Service Level from a Role
        • Example
    • Using Workload Prioritization with your Application
    • Limits
    • Additional References
ScyllaDB Open Source
  • 5.2
    • master
    • 6.2
    • 6.1
    • 6.0
    • 5.4
    • 5.2
    • 5.1
  • Getting Started
    • Install ScyllaDB
      • ScyllaDB Web Installer for Linux
      • ScyllaDB Unified Installer (relocatable executable)
      • Air-gapped Server Installation
      • What is in each RPM
      • ScyllaDB Housekeeping and how to disable it
      • ScyllaDB Developer Mode
      • ScyllaDB Configuration Reference
    • Configure ScyllaDB
    • ScyllaDB Requirements
      • System Requirements
      • OS Support by Linux Distributions and Version
      • ScyllaDB in a Shared Environment
    • Migrate to ScyllaDB
      • Migration Process from Cassandra to Scylla
      • Scylla and Apache Cassandra Compatibility
      • Migration Tools Overview
    • Integration Solutions
      • Integrate Scylla with Spark
      • Integrate Scylla with KairosDB
      • Integrate Scylla with Presto
      • Integrate Scylla with Elasticsearch
      • Integrate Scylla with Kubernetes
      • Integrate Scylla with the JanusGraph Graph Data System
      • Integrate Scylla with DataDog
      • Integrate Scylla with Kafka
      • Integrate Scylla with IOTA Chronicle
      • Integrate Scylla with Spring
      • Shard-Aware Kafka Connector for Scylla
      • Install Scylla with Ansible
      • Integrate Scylla with Databricks
    • Tutorials
  • ScyllaDB for Administrators
    • Administration Guide
    • Procedures
      • Cluster Management
      • Backup & Restore
      • Change Configuration
      • Maintenance
      • Best Practices
      • Benchmarking Scylla
      • Migrate from Cassandra to Scylla
      • Disable Housekeeping
    • Security
      • ScyllaDB Security Checklist
      • Enable Authentication
      • Enable and Disable Authentication Without Downtime
      • Generate a cqlshrc File
      • Reset Authenticator Password
      • Enable Authorization
      • Grant Authorization CQL Reference
      • Role Based Access Control (RBAC)
      • ScyllaDB Auditing Guide
      • Encryption: Data in Transit Client to Node
      • Encryption: Data in Transit Node to Node
      • Generating a self-signed Certificate Chain Using openssl
      • Encryption at Rest
      • LDAP Authentication
      • LDAP Authorization (Role Management)
    • Admin Tools
      • Nodetool Reference
      • CQLSh
      • REST
      • Tracing
      • Scylla SStable
      • Scylla Types
      • SSTableLoader
      • cassandra-stress
      • SSTabledump
      • SSTable2json
      • Scylla Logs
      • Seastar Perftune
      • Virtual Tables
    • ScyllaDB Monitoring Stack
    • ScyllaDB Operator
    • ScyllaDB Manager
    • Upgrade Procedures
      • ScyllaDB Open Source Upgrade
      • ScyllaDB Open Source to ScyllaDB Enterprise Upgrade
      • ScyllaDB Image
      • ScyllaDB Enterprise
    • System Configuration
      • System Configuration Guide
      • scylla.yaml
      • ScyllaDB Snitches
    • Benchmarking ScyllaDB
  • ScyllaDB for Developers
    • Learn To Use ScyllaDB
      • Scylla University
      • Course catalog
      • Scylla Essentials
      • Basic Data Modeling
      • Advanced Data Modeling
      • MMS - Learn by Example
      • Care-Pet an IoT Use Case and Example
    • Scylla Alternator
    • Scylla Features
      • Scylla Open Source Features
      • Scylla Enterprise Features
    • Scylla Drivers
      • Scylla CQL Drivers
      • Scylla DynamoDB Drivers
    • Workload Attributes
  • CQL Reference
    • CQLSh: the CQL shell
    • Appendices
    • Compaction
    • Consistency Levels
    • Consistency Level Calculator
    • Data Definition
    • Data Manipulation
    • Data Types
    • Definitions
    • Global Secondary Indexes
    • Additional Information
    • Expiring Data with Time to Live (TTL)
    • Additional Information
    • Functions
    • JSON Support
    • Materialized Views
    • Non-Reserved CQL Keywords
    • Reserved CQL Keywords
    • ScyllaDB CQL Extensions
  • ScyllaDB Architecture
    • ScyllaDB Ring Architecture
    • ScyllaDB Fault Tolerance
    • Consistency Level Console Demo
    • ScyllaDB Anti-Entropy
      • Scylla Hinted Handoff
      • Scylla Read Repair
      • Scylla Repair
    • SSTable
      • ScyllaDB SSTable - 2.x
      • ScyllaDB SSTable - 3.x
    • Compaction Strategies
    • Raft Consensus Algorithm in ScyllaDB
  • Troubleshooting ScyllaDB
    • Errors and Support
      • Report a Scylla problem
      • Error Messages
      • Change Log Level
    • ScyllaDB Startup
      • Ownership Problems
      • Scylla will not Start
      • Scylla Python Script broken
    • Upgrade
      • Inaccessible configuration files after ScyllaDB upgrade
    • Cluster and Node
      • Failed Decommission Problem
      • Cluster Timeouts
      • Node Joined With No Data
      • SocketTimeoutException
      • NullPointerException
    • Data Modeling
      • Scylla Large Partitions Table
      • Scylla Large Rows and Cells Table
      • Large Partitions Hunting
    • Data Storage and SSTables
      • Space Utilization Increasing
      • Disk Space is not Reclaimed
      • SSTable Corruption Problem
      • Pointless Compactions
      • Limiting Compaction
    • CQL
      • Time Range Query Fails
      • COPY FROM Fails
      • CQL Connection Table
      • Reverse queries fail
    • ScyllaDB Monitor and Manager
      • Manager and Monitoring integration
      • Manager lists healthy nodes as down
  • Knowledge Base
    • Upgrading from experimental CDC
    • Compaction
    • Counting all rows in a table is slow
    • CQL Query Does Not Display Entire Result Set
    • When CQLSh query returns partial results with followed by “More”
    • Run Scylla and supporting services as a custom user:group
    • Decoding Stack Traces
    • Snapshots and Disk Utilization
    • DPDK mode
    • Debug your database with Flame Graphs
    • How to Change gc_grace_seconds for a Table
    • Gossip in Scylla
    • Increase Permission Cache to Avoid Non-paged Queries
    • How does Scylla LWT Differ from Apache Cassandra ?
    • Map CPUs to Scylla Shards
    • Scylla Memory Usage
    • NTP Configuration for Scylla
    • Updating the Mode in perftune.yaml After a ScyllaDB Upgrade
    • POSIX networking for Scylla
    • Scylla consistency quiz for administrators
    • Recreate RAID devices
    • How to Safely Increase the Replication Factor
    • Scylla and Spark integration
    • Increase Scylla resource limits over systemd
    • Scylla Seed Nodes
    • How to Set up a Swap Space
    • Scylla Snapshots
    • Scylla payload sent duplicated static columns
    • Stopping a local repair
    • System Limits
    • How to flush old tombstones from a table
    • Time to Live (TTL) and Compaction
    • Scylla Nodes are Unresponsive
    • Update a Primary Key
    • Using the perf utility with Scylla
    • Configure Scylla Networking with Multiple NIC/IP Combinations
  • ScyllaDB FAQ
  • Contribute to ScyllaDB
  • Glossary
  • Alternator: DynamoDB API in Scylla
    • Getting Started With ScyllaDB Alternator
    • ScyllaDB Alternator for DynamoDB users
Docs Tutorials University Contact Us About Us
© 2025, ScyllaDB. All rights reserved. | Terms of Service | Privacy Policy | ScyllaDB, and ScyllaDB Cloud, are registered trademarks of ScyllaDB, Inc.
Last updated on 08 May 2025.
Powered by Sphinx 7.4.7 & ScyllaDB Theme 1.8.6