As developers and operations teams strive to optimize the performance and efficiency of modern applications, database and application management has become crucial area of focus. To support these demands, Speedb has introduced a new feature that allows for changing mutable options in real time, providing developers with a powerful tool to fine-tune their application and database configurations on the fly.
Speedb is revolutionizing how developers approach operational management and supporting real-time capabilities is core to this objective. In this post, we'll delve into the specifics of what this feature entails, how it works, and what benefits it can offer to developers and operations teams alike.
Speedb - enhancing RocksDB known capabilities
Speedb is a 100% compatible drop-in replacement for RocksDB, with additional benefits such as enhanced performance stabilization and memory management, as well as an improved developer experience. With a myriad of settings, changing the configuration in RocksDB can be a bit of a headache, but with the right tools and planning, you can get the job done efficiently and minimize any potential downtime. The new Live Configuration Changes feature to be presented here, will resolve this specific downtime problem.
Mutable vs. immutable options
In RocksDB and Speedb, there are two types of settings: mutable and immutable. Mutable options can be modified during runtime and affect the behavior and performance of the database. Examples of mutable options include the write buffer size and compression type. These options can be changed dynamically through the RocksDB API.
In contrast, immutable options are set at database creation and cannot be modified thereafter. These options control the fundamental behavior of the database, such as the key and value comparators and file systems used for storing data. The advantage of immutable options is that they provide a stable and predictable environment for the database to run in, reducing the risk of unexpected changes in behavior due to configuration modifications.
While RocksDB is the industry’s most popular key-value storage engine, Speedb enhances the performance of RocksDB for certain workloads by providing performance optimizations, generally resulting in faster reads and writes. Further, to build on these benefits, Speedb's use of immutable options provides added stability and predictability for production systems.
Understanding the differences between mutable and immutable settings is essential for tuning your database to meet specific requirements. By carefully selecting and tuning options, you can optimize performance while ensuring stability and predictability in your production environment.
The current challenge - how to change configuration with RocksDB?
Changing the configuration in RocksDB can be a tricky task. To modify mutable options, you usually have to use functions like SetOptions() or SetDBOptions, which can be time-consuming and require additional programs to run, and more importantly need to be thought of and designed during the development phase and not during deployment. If you'd rather not write extra code, you can always stop the application or database, change the configuration, and then start it up again. However, this option is unattractive as it involves scheduling a maintenance window, which will cause downtime for your production environment.
It's also worth noting that RocksDB isn't a standalone component, rather, it’s an embedded storage engine, so tuning it requires the involvement of the entire application. This means that any downtime could potentially affect other parts of your system, so it's important to plan accordingly.
New live configuration change with Speedb
Speedb, a modern key-value storage engine, is a 100% compatible, drop-in RocksDB library replacement with added production-ready improvements and capabilities. Recently, Speedb has introduced a new capability, Live Configuration Changes, which you’ll find on our GitHub page that allows for changing mutable options in real-time. These mutable options include compression algorithm, data integrity checksum, merge operator, and more. Providing an enterprise-ready and seamless RocksDB replacement, Speedb allows the application or database to stay up and running while making changes without requiring additional code. The new feature enables you to change any mutable DB option, ColumnFamilyOption, and mutable TableOptions.
To make these changes, you need only to create an option file that contains the required modifications and specify the path for Speedb to look for the file using refresh_options_file. Additionally, you can set the refresh frequency (refresh_options_sec) for the file scan. Once you've done this, Speedb will load the new options into the current options file, and the changes will take effect immediately. This feature is supported by any platform that currently uses RocksDB, such as Kafka streams or Apache Flink. A simple library swap to upgrade to Speedb enables Live Configuration Changes and all the other benefits provided, which you can find here. Overall, this new capability in Speedb 2.3.0 simplifies and streamlines the process of making changes to mutable options, but now without forced downtime.
Let’s say you would like to increase the cache size to gain better read performance.
The block_cache parameter should be changed. Create a new options file “options.new” and locate it on the path you defined.
The file should include the following:
table_options.block_cache = x;
The system will load the new configuration according to the refresh rate you defined in the refresh_options_sec parameter.
RocksDB has been a top choice for developers due to its impressive performance and scalability. Speedb, with a simple and seamless library swap, offers a new range of advanced features not available in RocksDB, so worth the investigation.
Whether you're seeking to optimize performance, increase efficiency, or explore new alternatives in application and database management, Speedb is a particularly valid option for mission-critical and production environments. With its modular and customizable design, Speedb represents a promising new frontier in the world of embedded key-value stores.
More details and a live demo session can be found here: https://youtu.be/UHjXaY5LFws
Check out the Speedb open source code and documentation, and join the Speedb community in Discord for more information and active discussion.
Speedb Hive at Discord: https://discord.com/invite/5fVUUtM2cG
Love this feature?
Our engineering team would appreciate your support,
Star us on GitHub!: https://github.com/speedb-io/speedb