Skip to content

Commit d32d4da

Browse files
Valkey Bundle Getting Started Guide (#314)
This is the getting started guide for Valkey Bundle. The commands will have to be updated once the name is changed from Valkey Extensions to Valkey Bundle. --------- Signed-off-by: Nikhil Manglore <[email protected]>
1 parent 125d8f3 commit d32d4da

File tree

3 files changed

+258
-0
lines changed

3 files changed

+258
-0
lines changed

topics/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ It's released under the
1212

1313
* What is Valkey? See [Introduction](introduction.md).
1414
* [Quick start](quickstart.md): Get started with Valkey.
15+
* [Valkey Bundle](valkey-bundle.md): Get started with Valkey Bundle.
1516
Programming with Valkey
1617
* [FAQ](faq.md): Frequently asked questions.
1718

topics/valkey-bundle.md

Lines changed: 251 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,251 @@
1+
## What is Valkey Bundle
2+
3+
Valkey Bundle is a pre-packaged, containerized version of Valkey that comes preloaded with a collection of supported modules.
4+
These modules enable advanced data structures and search capabilities to extend Valkey’s core functionality.
5+
The bundle is designed to help developers quickly get started with powerful Valkey features without needing to manually install or configure anything.
6+
Some of the modules included in the bundle are:
7+
8+
1. [Valkey JSON](/topics/valkey-json/) - Allows users to natively store, query, and modify JSON data structures using the JSONPath query language.
9+
2. [Valkey Bloom](/topics/bloomfilters/) - Provides space-efficient probabilistic data structures, such as Bloom filters, for adding elements and checking whether they exist in a set.
10+
3. [Valkey Search](/topics/search/) - Enables the creation of indexes and similarity searches through the use of complex filters.
11+
4. [Valkey LDAP](/topics/ldap/) - Handles user authentication against LDAP based identity providers.
12+
13+
# Quick Start to Using the Bundle
14+
15+
The fastest way to start using Valkey Bundle is by downloading the official image through [Docker Hub](https://hub.docker.com/r/valkey/valkey-bundle/). The following steps will guide you through launching and interacting with your first instance!
16+
17+
1. **Pull the image to get the latest public release**
18+
19+
```bash
20+
docker pull valkey/valkey-bundle
21+
```
22+
23+
This command downloads the most recent stable image of Valkey Bundle, which includes the Valkey server along with the preloaded modules.
24+
25+
The Valkey Bundle image also supports multiple tags, allowing you to control the specific version and operating system base. This allows for more control over the environment, whether you’re aiming for a reproducible build (using a version like 8.1-bookworm) or a minimal footprint (alpine variant).
26+
27+
Check out the [Valkey Bundle Docker Hub Tag](https://hub.docker.com/r/valkey/valkey-bundle/tags) section to view all available tags and example pull commands.
28+
29+
2. **Start a Valkey container**
30+
31+
```bash
32+
docker run --name my-valkey-bundle -d -p 6379:6379 valkey/valkey-bundle
33+
```
34+
35+
This command starts a container named my-valkey-bundle and maps Valkey’s default port 6379 to your local machine for external access. By default, it uses the latest available image. To run a specific version or variant, append the desired tag to the image name. For example:
36+
37+
```bash
38+
docker run --name my-valkey-bundle -d -p 6379:6379 valkey/valkey-bundle:8.1.0-alpine
39+
```
40+
41+
3. **Connect to the server using valkey-cli**
42+
43+
To interact with the server, use the Valkey command-line interface (valkey-cli). You can run the CLI directly inside the running container using the following command:
44+
45+
```bash
46+
docker exec -it my-valkey-bundle valkey-cli -h localhost -p 6379 -3
47+
```
48+
49+
This launches an interactive valkey-cli session within the container and connects to the server via localhost.
50+
51+
4. **Try some commands**
52+
53+
Check the available modules using the info command.
54+
```bash
55+
my-valkey-bundle:6379> INFO modules
56+
# Modules
57+
module:name=bf,ver=10000,api=1,filters=0,usedby=[],using=[],options=[]
58+
module:name=search,ver=10000,api=1,filters=0,usedby=[],using=[],options=[handle-io-errors|handle-repl-async-load|no-implicit-signal-modified]
59+
module:name=json,ver=10010,api=1,filters=0,usedby=[],using=[],options=[handle-io-errors]
60+
module:name=ldap,ver=16777471,api=1,filters=0,usedby=[],using=[],options=[]
61+
```
62+
63+
Use the Valkey JSON Module
64+
```bash
65+
> JSON.SET test $ '{"hello": "world"}'
66+
```
67+
```bash
68+
> JSON.GET test
69+
```
70+
71+
Use the Valkey Bloom Module
72+
```bash
73+
> BF.RESERVE test_bloom 0.01 1000
74+
```
75+
```bash
76+
> BF.ADD test_bloom "item1"
77+
```
78+
```bash
79+
> BF.EXISTS test_bloom "item1"
80+
```
81+
82+
Use the Valkey Search Module
83+
```bash
84+
> FT.CREATE idx SCHEMA description VECTOR HNSW 6 TYPE FLOAT32 DIM 3 DISTANCE_METRIC L2
85+
```
86+
```bash
87+
> HSET p1 description "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80?"
88+
> HSET p2 description "\x00\x00\x00\x00\x00\x00\x80?\x00\x00\x00\x00"
89+
> HSET p3 description "\x00\x00\x80?\x00\x00\x00\x00\x00\x00\x00\x00"
90+
```
91+
```bash
92+
> FT.SEARCH idx "*=>[KNN 3 @description $vec]" PARAMS 2 vec "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80?" DIALECT 2
93+
```
94+
95+
Use the Valkey LDAP Module
96+
```bash
97+
> CONFIG SET ldap.servers "ldap://ldap.valkey.io:389"
98+
OK
99+
100+
> CONFIG SET ldap.bind_dn_prefix "cn="
101+
OK
102+
103+
> CONFIG SET ldap.bind_dn_suffix ",ou=users,dc=valkey,dc=io"
104+
OK
105+
```
106+
```bash
107+
> AUTH valkey "ldap_password"
108+
OK
109+
```
110+
111+
Make sure to check out the full list of commands for all the bundle components:
112+
113+
1. [Valkey Commands](https://valkey.io/commands/)
114+
2. [Valkey JSON Commands](https://valkey.io/commands/#json)
115+
3. [Valkey Bloom Commands](https://valkey.io/commands/#bloom)
116+
4. [Valkey Search Commands](https://valkey.io/commands/#search)
117+
118+
Valkey Bundle supports more advanced setup options too including:
119+
120+
1. **Persistent storage**
121+
122+
Persistent storage allows you to save data snapshots locally. The command below is an example of how you can save a snapshot every 60 seconds if at least one write occurred.
123+
124+
```bash
125+
docker run --name my-valkey-bundle -d valkey/valkey-bundle valkey-server --save 60 1 --loglevel warning
126+
```
127+
128+
By default, Valkey logs are written to standard output and can be viewed using `docker logs`. Logs from all modules are included in the same stream since Valkey doesn't generate separate log files per module. If you prefer to log to a file, you can use the `--logfile` flag to specify a file path.
129+
130+
2. **Custom Flags with Environment Variable**
131+
132+
This allows you to pass additional Valkey flags at runtime using the VALKEY_EXTRA_FLAGS environment variable. It is a flexible way to customize behavior without needing to modify the existing image or use a custom configuration file.
133+
134+
```bash
135+
docker run --env VALKEY_EXTRA_FLAGS='--save 60 1 --loglevel warning' valkey/valkey-bundle
136+
```
137+
138+
In this example, the save flag enables data persistence while the loglevel warning flag limits log output to warnings and errors. You can include any [supported Valkey flags](https://github.com/valkey-io/valkey/blob/unstable/valkey.conf) in this variable to further tailor runtime behavior.
139+
140+
3. **Use a Custom Configuration File**
141+
142+
If you need full control over your Valkey settings, you can create a custom configuration file and use it inside the container.
143+
This allows you to override the default settings using your own valkey.conf file.
144+
145+
First, ensure you have a valkey.conf file located in a local directory, such as /myvalkey/conf/valkey.conf.
146+
The valkey.conf file can include any standard Valkey configuration directives such as memory limits, save intervals, logging levels, and more. The file has a very simple format:
147+
148+
```bash
149+
keyword arg1 arg2 ... argN
150+
```
151+
152+
Here is a sample configuration file that includes optimized settings for Valkey as well as the modules:
153+
154+
```bash
155+
# Valkey settings
156+
port 6379
157+
bind 127.0.0.1
158+
protected-mode yes
159+
requirepass "strong_password"
160+
161+
######################## JSON Module ########################
162+
# Maximum document size (in bytes, 0 = unlimited)
163+
json.max-document-size 1048576
164+
165+
# Maximum nesting depth for JSON documents
166+
json.max-path-limit 32
167+
168+
######################## Bloom Module ########################
169+
# Default initial capacity for new bloom filters
170+
bf.bloom-capacity 100000
171+
172+
# Default false positive rate
173+
bf.bloom-fp-rate 0.01
174+
175+
# Memory usage limit per bloom filter (in bytes)
176+
bf.bloom-memory-usage-limit 134217728 # 128MB
177+
178+
# Default expansion rate for scaling filters
179+
bf.bloom-expansion 2
180+
181+
######################## Search Module ########################
182+
# Thread configuration for search operations
183+
search.reader-threads 8
184+
search.writer-threads 4
185+
186+
# HNSW graph configuration
187+
search.hnsw-block-size 10000
188+
189+
# Enable cluster mode
190+
search.use-coordinator no
191+
192+
# Log level (debug, verbose, notice, warning)
193+
search.log-level notice
194+
195+
######################## LDAP Module ########################
196+
# LDAP server configuration
197+
ldap.servers "ldap://primary:389,ldap://backup:389"
198+
ldap.auth_mode "search+bind"
199+
200+
# TLS configuration
201+
ldap.use_starttls yes
202+
ldap.tls_ca_cert_path "/path/to/ca.crt"
203+
ldap.tls_cert_path "/path/to/client.crt"
204+
ldap.tls_key_path "/path/to/client.key"
205+
206+
# Search+bind mode settings
207+
ldap.search_base "ou=users,dc=valkey,dc=io"
208+
ldap.search_filter "objectClass=person"
209+
ldap.search_attribute "uid"
210+
ldap.search_bind_dn "cn=readonly,dc=valkey,dc=io"
211+
ldap.search_bind_passwd "readonly_password"
212+
213+
# Performance tuning
214+
ldap.connection_pool_size 5
215+
ldap.timeout_connection 5
216+
ldap.timeout_ldap_operation 3
217+
ldap.failure_detector_interval 1
218+
219+
######################## Common Settings ########################
220+
# Memory and performance
221+
maxmemory 4gb
222+
maxmemory-policy allkeys-lru
223+
224+
# Persistence
225+
save 900 1
226+
save 300 10
227+
save 60 10000
228+
229+
# Logging
230+
loglevel notice
231+
logfile "/var/log/valkey/valkey.log"
232+
```
233+
234+
Check out the [Configuration Documentation](/topics/valkey.conf/) to learn more.
235+
236+
After setting up the configuration file, run the container with a volume mount that maps your local directory into the container:
237+
238+
```bash
239+
docker run -v /myvalkey/conf:/usr/local/etc/valkey --name my-valkey-bundle valkey/valkey-bundle valkey-server /usr/local/etc/valkey/valkey.conf
240+
```
241+
242+
This command mounts your local configuration folder into the container and tells Valkey to start using your custom configuration file.
243+
244+
## Next Steps
245+
246+
Once you’ve set up the Valkey Bundle, it’s time to start exploring the modules. Check out the documentation for each one to learn what they can do and how to use them effectively.
247+
248+
1. [Valkey JSON Documentation](/topics/valkey-json/)
249+
2. [Valkey Bloom Documentation](/topics/bloomfilters/)
250+
3. [Valkey Search Documentation](/topics/search/)
251+
4. [Valkey LDAP Documentation](/topics/ldap/)

wordlist

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ codenamed
138138
Collina's
139139
commandstats
140140
commnad
141+
conf
141142
Config
142143
config
143144
config-file
@@ -529,10 +530,12 @@ Mrkris
529530
mset
530531
multisets
531532
mutex
533+
my-valkey-bundle
532534
mylist
533535
mymaster
534536
mystream
535537
myuser
538+
myvalkey
536539
myzset
537540
namespace
538541
namespacing
@@ -625,11 +628,13 @@ pre-configured
625628
pre-existing
626629
pre-imported
627630
pre-loaded
631+
pre-packaged
628632
pre-populated
629633
pre-sharding
630634
Predis
631635
prefetch
632636
prefetched
637+
preloaded
633638
prepend
634639
Prepend
635640
prepends
@@ -649,6 +654,7 @@ Programmability
649654
programmability
650655
programmatically
651656
programmatically-generated
657+
ps
652658
pseudorandom
653659
PSR-4
654660
Pubsub

0 commit comments

Comments
 (0)