Skip to content

Commit 88b9469

Browse files
liorsvemadolson
andauthored
Adds a clients overview page (#166)
### Description Adds a client page to docs on the website. The page is added to the top nav docs, called "Client Libraries", and its url is top level `valkey.io/clients `. This PR is dependent on the [complimentary docs PR](valkey-io/valkey-doc#164) being merged. #### How it works - - The `init-topics.sh` script was modified to expect the path to the clients docs folder as its second argument. It creates a symlink to it, called `build-clients`. The clients folder in docs holds json files specifying each client's details and features. - `content/clients/_index.md` has in its frontmatter the list of paths to the clients appearing in this page. This list is used by the `client-list.html` template to render the specified clients' data. This template also includes the `client-feature-table.html` template that renders the same json files to produce a table comparing which features each client implements. ### Issues Resolved [#161](valkey-io/valkey-doc#161) Dependent on this PR being merged - [#164](valkey-io/valkey-doc#164) ### Check List - [x] 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. --------- Signed-off-by: lior sventitzky <[email protected]> Signed-off-by: Lior Sventitzky <[email protected]> Co-authored-by: Madelyn Olson <[email protected]>
1 parent f93e979 commit 88b9469

File tree

13 files changed

+362
-12
lines changed

13 files changed

+362
-12
lines changed

.github/workflows/zola-deploy.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@ jobs:
3434
repository: valkey-io/valkey
3535
path: valkey
3636

37-
- name: Init commands and topics
37+
- name: Init commands, topics and clients
3838
run: |
3939
cd website
40-
./build/init-topics.sh ../valkey-doc/topics
40+
./build/init-topics-and-clients.sh ../valkey-doc/topics ../valkey-doc/clients
4141
./build/init-commands.sh ../valkey-doc/commands ../valkey/src/commands
4242
- name: Build only
4343
uses: shalzz/[email protected]

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ public
33
build-command-docs
44
build-command-json
55
build-topics
6+
build-clients
67
content/commands/*
78
!content/commands/_index.md
89
content/topics/*

README.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,17 @@ Changes to external content (command reference, documentation topics) require a
2828

2929
## Building additional content
3030

31-
**By default, the site will build without documentation topics nor command reference.**
32-
This content is stored within the `valkey-io/valkey-doc` and `valkey-io/valkey` repos respectively.
31+
**By default, the site will build without documentation topics, command reference, or the clients page.**
32+
The content for documentation topics and the clients page are stored within the `valkey-io/valkey-doc` repo.
33+
The content for the command reference page is in the `valkey-io/valkey` repo.
3334

3435
If you want to build the site with this content, you'll need to have a local copy of `valkey-io/valkey-doc` and `valkey-io/valkey` _outside_ of this repo.
35-
Then follow the instructions to [build the documentation topics](#building-the-documentation-topics) and/or [build the command reference](#building-the-command-reference).
36+
Then follow the instructions to [build the documentation topics and clients](#building-the-documentation-topics-and-clients-page) and/or [build the command reference](#building-the-command-reference).
3637
The instructions show how to use scripts that create symbolic links to the `valkey-io/valkey-doc` and `valkey-io/valkey` repos as well as create a series of empty stub files that tell Zola to create pages.
3738

38-
### Building the documentation topics
39+
### Building the documentation topics and clients page
3940

40-
Documentation 'topics' (i.e. `/topics/keyspace/`, `/topics/encryption/`, `/topics/transactions/`) sources content from `valkey-io/valkey-doc`.
41+
Documentation 'topics' (i.e. `/topics/keyspace/`, `/topics/encryption/`, `/topics/transactions/`) and the client libraries' data (i.e. `/client-page-clients/nodejs/valkey-glide`, `/client-page-clients/python/valkey-py`) sources content from `valkey-io/valkey-doc`.
4142

4243
```mermaid
4344
flowchart TD
@@ -51,12 +52,12 @@ First, stop the `zola serve` process if you're running it.
5152
From the root directory of this repo run:
5253

5354
```shell
54-
# You should only need to run this once or when you add a new topic.
55-
./build/init-topics.sh ../valkey-doc/topics
55+
# You should only need to run this once or when you add a new topic/client.
56+
./build/init-topics-and-clients.sh ../valkey-doc/topics ../valkey-doc/clients
5657
```
5758

5859
Then, restart Zola.
59-
Point your browser at `http://127.0.0.1:1111/topics/` and you should see the fully populated list of topics.
60+
Point your browser at `http://127.0.0.1:1111/topics/` and you should see the fully populated list of topics and clients.
6061
All files created in this process are ignored by git.
6162
Commit your changes to your local copy of `valkey-io/valkey-doc`.
6263

build/init-topics.sh renamed to build/init-topics-and-clients.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,22 @@ if [ -z "$1" ]; then
88
exit 1
99
fi
1010

11+
if [ -z "$2" ]; then
12+
echo "You must supply a path to the clients directory as the first argument"
13+
exit 1
14+
fi
15+
1116
# check for validity of these agruments as paths
1217
if [ ! -d "$1" ]; then
1318
echo "The topics directory must exist and be a valid path"
1419
exit 1
1520
fi
1621

22+
if [ ! -d "$2" ]; then
23+
echo "The clients directory must exist and be a valid path"
24+
exit 1
25+
fi
26+
1727
# check for old style /docs/topics
1828
if [ -e "content/docs/topics" ]; then
1929
echo "Documentation topic files have moved. Delete content/docs/topics before proceeding."
@@ -55,3 +65,11 @@ do
5565
cp ${fname} ./content/topics/${base}
5666
done
5767
echo "Copied images to topics directory."
68+
69+
70+
#create symlink to clients, expect if it already exists
71+
if [ ! -L build-clients -o "$(readlink build-clients)" != "$2" ]; then
72+
ln -s $2 ./build-clients
73+
fi
74+
echo "Symlink to clients has been created at ./build-clients "
75+

config.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ highlight_code = true
2121
[extra]
2222
command_description_path = "../build-command-docs/"
2323
command_json_path = "../build-command-json/"
24+
client_json_path = "../build-clients/"
2425
doc_topic_path = "../build-topics/"
2526

2627
review_list = [
@@ -46,4 +47,4 @@ publish_hold = [
4647
"/topics/internals-vm/",
4748
"/topics/internals/",
4849
"/topics/rdd/"
49-
]
50+
]

content/clients/_index.md

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
+++
2+
title = "Client Libraries"
3+
template = "client-list.html"
4+
[extra]
5+
recommended_clients_paths = [
6+
"/python/valkey-GLIDE.json",
7+
"/python/valkey-py.json",
8+
"/node.js/valkey-GLIDE.json",
9+
"/node.js/iovalkey.json",
10+
"/java/valkey-GLIDE.json",
11+
"/java/valkey-java.json",
12+
"/go/valkey-GLIDE.json",
13+
"/go/valkey-go.json",
14+
"/php/phpredis.json",
15+
"/php/predis.json",
16+
]
17+
18+
client_fields =[
19+
"name",
20+
"language",
21+
"read_from_replica",
22+
"smart_backoff_to_prevent_connection_storm",
23+
"pubsub_state_restoration",
24+
"cluster_scan",
25+
"latency_based_read_from_replica",
26+
"AZ_based_read_from_replica",
27+
"client_side_caching",
28+
"client_capa_redirect",
29+
"persistent_connection_pool"
30+
]
31+
32+
+++
33+
34+
This page offers an overview of recommended Valkey clients for various programming languages. A table of advanced features supported by the respective clients is provided, highlighting the unique advantages of one client over another.
35+
36+
This page includes only clients which are regularly tested and recommended. However, it's important to note that other clients that support Redis OSS version 7.2 are compatible with Valkey 7.2 and above. To add your client to the list, please refer to [this link.](https://github.com/valkey-io/valkey-doc/blob/main/clients/README.md)
37+
38+
<!-- split -->
39+
40+
Advanced Features Overview
41+
-----
42+
43+
1. **Read from Replica** - The ability to read data from a replica node, which can be useful for load balancing and reducing the load on the primary node. This feature is particularly important in read-heavy applications.
44+
45+
2. **Smart Backoff to Prevent Connection Storm** - A strategy used to prevent connection storms by progressively updating the wait time between retries when attempting to reconnect to a Valkey server. This helps to reduce the load on the server during topology updates, periods of high demand or network instability.
46+
47+
3. **PubSub State Restoration** - The ability to restore the state of Pub/Sub (publish/subscribe) channels after a client reconnects. This feature ensures that clients can continue receiving messages after disconnections or topology updates such as adding or removing shards, for both legacy Pub/Sub and sharded Pub/Sub. The client will automatically resubscribe the connections to the new node. The advantage is that the application code is simplified, and doesn’t have to take care of resubscribing to new nodes during reconnects.
48+
49+
4. **Cluster Scan** - This feature ensures that the user experience and guarantees for scanning a cluster are identical to those for scanning a single node. The SCAN function operates as a cursor-based iterator. With each command, the server provides an updated cursor, which must be used as the cursor argument in subsequent calls. A complete iteration with SCAN retrieves all elements present in the collection from start to finish. If an element exists in the collection at the beginning and remains until the end of the iteration, SCAN will return it. Conversely, any element removed before the iteration begins and not re-added during the process will not be returned by SCAN. A client supporting this feature ensures the scan iterator remains valid even during failovers or cluster scaling (in or out) during the SCAN operation.
50+
51+
5. **Latency-Based Read from Replica** - This feature enables reading data from the nearest replica, i.e., the replica that offers the best latency. It supports complex deployments where replicas are distributed across various distances, including different geographical regions, to ensure data is read from the closest replica, thereby minimizing latency.
52+
53+
6. **AZ-Based Read from Replica** - This feature enables reading data from replicas within the same Availability Zone (AZ). When running Valkey in a cloud environment across multiple AZs, it is preferable to keep traffic localized within an AZ to reduce costs and latency. By reading from replicas in the same AZ as the client, you can optimize performance and minimize cross-AZ data transfer charges. For more detailed information about this feature and its implementation, please refer to [this link.](https://github.com/valkey-io/valkey/pull/700)
54+
55+
7. **Client Side Caching** - Valkey client-side caching is a feature that allows clients to cache the results of Valkey queries on the client-side, reducing the need for frequent communication with the Valkey server. This can significantly improve application performance by lowering latency, reducing the network usage and cost and reducing the load on the Valkey server.
56+
57+
8. **`CLIENT CAPA redirect` Support** - The `CLIENT CAPA redirect` feature was introduced in Valkey 8 to facilitate seamless upgrades without causing errors in standalone mode. When enabled, this feature allows the replica to redirect data access commands (both read and write operations) to the primary instance. This ensures uninterrupted service during the upgrade process. For more detailed information about this feature, please refer to [this link.](https://github.com/valkey-io/valkey/pull/325)
58+
59+
9. **Persistent Connection Pool** - This feature enables the Valkey client to maintain a pool of persistent connections to the Valkey server, improving performance and reducing overhead. Instead of establishing a new connection for each request, the client can reuse existing connections from the pool, minimizing the time and resources required for connection setup.

content/docs/index.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,5 @@ body_class= "blocks-page"
99

1010
* [Command Reference](/commands/) A categorized listing of all Valkey commands
1111
* [Documentation by topic](/topics/) In-depth documentation covering a wide variety of operational and usage subjects
12+
* [Client Libraries](/clients/) An overview of recommended Valkey clients and their features.
13+

sass/_valkey.scss

Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -697,3 +697,145 @@ pre table {
697697

698698
border-top: 1px solid $grey-dk-100;
699699
}
700+
701+
.client-list {
702+
h2 {
703+
margin-top: 2rem;
704+
margin-bottom: 1rem;
705+
706+
}
707+
708+
709+
.language-clients {
710+
margin-bottom: 3rem;
711+
712+
.client-item {
713+
margin-bottom: 2rem;
714+
padding: 1rem;
715+
border: 1px solid #e0e0e0;
716+
border-radius: 4px;
717+
background-color: #fff;
718+
max-width: 1500px;
719+
width: 100%;
720+
721+
h3 {
722+
margin-top: 0;
723+
color: #222;
724+
}
725+
726+
ul {
727+
list-style-type: none;
728+
padding-left: 0;
729+
730+
> li {
731+
position: relative;
732+
padding-left: 1.5em;
733+
734+
&::before {
735+
content: "\2022";
736+
position: absolute;
737+
left: 0.5em;
738+
color: #000;
739+
}
740+
741+
> ul > li {
742+
padding-left: 1.5em;
743+
744+
&::before {
745+
content: "\25E6";
746+
position: absolute;
747+
left: 0.5em;
748+
color: #000;
749+
}
750+
}
751+
}
752+
}
753+
754+
code, pre {
755+
background-color: #f5f5f5;
756+
padding: 0.2rem 0.4rem;
757+
border-radius: 3px;
758+
width:850px
759+
}
760+
}
761+
}
762+
}
763+
764+
.feature-comparison-table {
765+
margin-top: 3rem;
766+
767+
.table-container {
768+
padding: 0;
769+
background-color: #fafafa;
770+
border: 1px solid #ddd;
771+
border-radius: 8px;
772+
overflow-x: auto;
773+
774+
table {
775+
width: 100%;
776+
border-collapse: collapse;
777+
th, td {
778+
padding: 8px 12px;
779+
text-align: center;
780+
border-right: 1px solid #e0e0e0;
781+
border-bottom: 1px solid #e0e0e0;
782+
}
783+
784+
th:first-child,
785+
td:first-child {
786+
position: sticky;
787+
left: 0;
788+
background-color: #fafafa;
789+
z-index: 2;
790+
}
791+
}
792+
793+
.table-header {
794+
background-color: #f4f4f4;
795+
font-weight: bold;
796+
797+
.table-header-cell {
798+
padding: 10px;
799+
color: #555;
800+
position: sticky;
801+
top: 0;
802+
z-index: 1;
803+
background-color: #f4f4f4;
804+
}
805+
806+
.table-header-cell:first-child {
807+
z-index: 3;
808+
}
809+
}
810+
811+
.table-row {
812+
&.even-row {
813+
background-color: #f9f9f9;
814+
}
815+
&.odd-row {
816+
background-color: #fff;
817+
}
818+
819+
.table-cell {
820+
color: #444;
821+
white-space: normal;
822+
word-wrap: break-word;
823+
824+
&:first-child {
825+
font-weight: bold;
826+
color: #555;
827+
}
828+
}
829+
}
830+
}
831+
}
832+
833+
.checkmark-true {
834+
color: green;
835+
font-weight: bold;
836+
}
837+
838+
.checkmark-false {
839+
color: rgb(190, 9, 9);
840+
font-weight: bold;
841+
}

templates/client-feature-table.html

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{% import "macros/docs.html" as docs %}
2+
3+
{% block main_content %}
4+
<hr/>
5+
<h2 >Feature Comparison Table</h2>
6+
7+
<div class="table-container">
8+
<table >
9+
<thead>
10+
<tr class="table-header">
11+
{% for header in client_fields %}
12+
<th class="table-header-cell">{{ header | replace(from="_", to=" ") | title | replace (from= "Az", to= "AZ") }}</th>
13+
{% endfor %}
14+
</tr>
15+
</thead>
16+
<tbody>
17+
{%- for path in client_paths %}
18+
{% set json_data = load_data(path = docs::client_json_path(client_path= path), format="json") %}
19+
<tr class="table-row {% if loop.index is even %}even-row{% else %}odd-row{% endif %}">
20+
{% for field in client_fields %}
21+
<td class="table-cell">
22+
{% if field not in ["name", "language"] %}
23+
{{ docs::boolean_to_checkmark(value=json_data[field]) }}
24+
{% else %}
25+
{{ json_data[field] }}
26+
{% endif %}
27+
</td>
28+
{% endfor %}
29+
</tr>
30+
{%- endfor %}
31+
</tbody>
32+
</table>
33+
</div>
34+
{% endblock main_content %}

0 commit comments

Comments
 (0)