Skip to content

Blog post describing updates to Valkey Modules Rust SDK #250

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

dmitrypol
Copy link
Contributor

Description

Blog post describing updates to Valkey Modules Rust SDK

Issues Resolved

Check List

  • Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is made under the terms of the BSD-3-Clause License.

Copy link
Member

@stockholmux stockholmux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is lots of good stuff here.

It feels a little like release notes in the current state, especially towards the end.

What would make it a good blog post is a few paragraphs that tie together why these changes are important (is it just keeping up with changes in Valkey? does it fill in the SKD gaps?, etc.).

At the end it goes into bullet point mode rather than narrative too. Maybe make the ideas for further development into a paragraph and the list of contributions into a sentence.

It needs a conclusion paragraph as well.

I also left some specific wording and grammar notes.


In an earlier [article](/blog/modules-101/) we discussed the process of building Valkey Modules.
Modules allow adding extra features (such as new commands and data types) to Valkey without making changes to the core code.
We briefly touched on how to use [Valkey Modules Rust SDK](https://github.com/valkey-io/valkeymodule-rs) to build a simple module.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

grammar: needs definite article. 'how to use the Valkey Modules SDK'

Copy link
Contributor Author

@dmitrypol dmitrypol May 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated

Modules allow adding extra features (such as new commands and data types) to Valkey without making changes to the core code.
We briefly touched on how to use [Valkey Modules Rust SDK](https://github.com/valkey-io/valkeymodule-rs) to build a simple module.
In this article we will expand on this topic and discuss some of the new features added to the SDK over the last year.
SDK itself also provides examples on how to use these new features but this article summarizes them below.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you can drop this sentence.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

In this article we will expand on this topic and discuss some of the new features added to the SDK over the last year.
SDK itself also provides examples on how to use these new features but this article summarizes them below.

## What is Valkey Modules Rust SDK?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

grammar: definite article

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated

## What is Valkey Modules Rust SDK?

The SDK is based on [Redis Modules Rust SDK](https://github.com/RedisLabsModules/redismodule-rs) and provides abstraction APIs on top of Valkey Modules own API.
For those familiar with Rust development the SDK is a regular Rust crate that can be added to Cargo.toml file like any other Rust dependency.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cargo.toml in backticks (e.g. inline source code styling)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is a 'regular Rust crate' - is there another way of saying that? Do you need 'regular'?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated


The SDK is based on [Redis Modules Rust SDK](https://github.com/RedisLabsModules/redismodule-rs) and provides abstraction APIs on top of Valkey Modules own API.
For those familiar with Rust development the SDK is a regular Rust crate that can be added to Cargo.toml file like any other Rust dependency.
It requires functionality to be present in the underlying Valkey version but allows writing Valkey modules in Rust, without needing to use raw pointers or unsafe code.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'It requires functionality to be present in the underlying Valkey version' -> I really don't understand what that means. What functionality are you talking about?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rephrased as It requires the underlying Valkey version to have appropriate module APIs


## Redis support

There is a new feature flag in case module needs to run on Valkey and Redis. Specify `use-redismodule-api` so that module used RedisModule API Initialization for backwards compatibility.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'There is a new feature flag in case module needs to run on Valkey and Redis.' -> 'There is a new feature flag if your module needs to run on both Valkey and Redis.'

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated


## Unit tests and memory allocation

This feature flag supports running unit tests outside of Valkey or Redis. As the result it cannot use Vakey Allocator and instead relies on the System Allocator instead. The core logis is present in `alloc.rs` but developers only need to specify this in the module Cargo.toml.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cargo.toml in back ticks to make it inline code

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated

categories= "modules"
+++

## What are Valkey modules?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't need a heading to start a blog post - just go into the paragraph.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated

cargo test --features enable-system-alloc
```

## Ideas for future development
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are there issues for these ideas?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some are logged, will log others


## List of contributors

Below are the Github handles of the developers who contibuted to the SDK in the past year
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

link their github profiles.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated

@dmitrypol
Copy link
Contributor Author

agree on the release notes style. Will add some more content around it

@dmitrypol dmitrypol force-pushed the main branch 3 times, most recently from 8254955 to 80f5e10 Compare May 6, 2025 16:26
madolson and others added 4 commits May 6, 2025 09:32
…alkey-io#249)

The documentation tiles on the homepage were stacking awkwardly at
screen widths between 768px and 1090px. Modified the grid layout to
create a more natural 2x2 layout at these intermediate screen sizes,
ensuring consistent spacing and better visual organization.

<img width="1023" alt="Screenshot 2025-04-24 at 4 53 59 PM"
src="https://github.com/user-attachments/assets/237bce45-1cec-46ad-925a-766d0627fd93"
/>

<img width="480" alt="Screenshot 2025-04-24 at 4 54 13 PM"
src="https://github.com/user-attachments/assets/ee8e564a-44d1-45f4-914b-248787ae9340"
/>

Signed-off-by: Daniel Phillips <[email protected]>
Signed-off-by: Dmitry Polyakovsky <[email protected]>
Signed-off-by: dmitrypol <[email protected]>
Signed-off-by: Dmitry Polyakovsky <[email protected]>
Signed-off-by: Dmitry Polyakovsky <[email protected]>
@dmitrypol dmitrypol force-pushed the main branch 8 times, most recently from 1b2f526 to 978870c Compare May 7, 2025 13:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants