Skip to content

Commit 332d525

Browse files
authored
Update decission tree for Redis persistence (#592)
1 parent 1ff29ea commit 332d525

File tree

3 files changed

+29
-17
lines changed

3 files changed

+29
-17
lines changed

docs/persistence/README.md

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ Choose wisely.
3333

3434
```mermaid
3535
graph TD
36+
F[I need caching!] --> REDIS[Redis]
3637
A[I got data!] --> B[Is it structured?]
3738
B --> |Yes| C[Is it events?]
3839
B --> |No| D[Is it files?]
@@ -43,6 +44,7 @@ graph TD
4344
E --> |Yes| GBQ[BigQuery]
4445
E --> |No| GCSQL[Cloud SQL]
4546
47+
click REDIS "#redis"
4648
click GBQ "#bigquery"
4749
click GCS "#cloud-storage-buckets"
4850
click GCSQL "#cloud-sql"
@@ -55,15 +57,15 @@ graph TD
5557
Below is a list of the different storage options available to you.
5658

5759
| Name | Type | Recommendation | Availability | Backup |
58-
|---------------------------------|-------------|:--------------:|:------------:|:------:|
60+
| ------------------------------- | ----------- | :------------: | :----------: | :----: |
5961
| [Kafka](#kafka) | Streaming || All | Yes* |
6062
| [Cloud Storage](#cloud-storage) | Object || GCP | Yes* |
6163
| [Cloud SQL](#cloud-sql) | Relational || GCP | Yes |
6264
| [BigQuery](#bigquery) | Relational || GCP | Yes* |
63-
| [OpenSearch](#opensearch) | Document || All | Yes |
64-
| [Redis](#redis) | Key/Value || All | Yes |
65-
| [InfluxDB](#influxdb) | Time Series | | All | Yes |
66-
| [IBM MQ](#ibm-mq) | Message | ⚠️ | All | Yes* |
65+
| [OpenSearch](#opensearch) | Document || GCP | Yes |
66+
| [Redis](#redis) | Key/Value || GCP | Yes |
67+
| [InfluxDB](#influxdb) | Time Series | ⚠️ | All | Yes |
68+
| [IBM MQ](#ibm-mq) | Message | ⚠️ | All | Yes* |
6769

6870
\* Data is highly available and fault-tolerant but not backed up if deleted by
6971
mistake.
@@ -111,12 +113,17 @@ OpenSearch offers a drop-in replacement for Elasticsearch.
111113
## Redis
112114

113115
Redis is a key value database that is used for storing and querying data. It is
114-
a good choice for storing data that is not relational in nature.
116+
a good choice for storing data that is not relational in nature and often used
117+
for caching.
115118

116119
[:octicons-arrow-right-24: Getting started with Redis](./redis.md)
117120

118121
## InfluxDB
119122

123+
!!! warning "Outdated"
124+
125+
Aiven has informed us that they will no longer support InfluxDB in the future. We are currently looking into alternatives.
126+
120127
InfluxDB is a time series database that is used for storing and querying data.
121128
It is a good choice for storing data that is not relational in nature.
122129

docs/persistence/kafka/README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
---
2+
description: >-
3+
Kafka is a distributed streaming platform that can be used to publish and
4+
subscribe to streams of records. It is a good alternative to synchronous
5+
communication between services if you need to decouple services.
6+
---
17
# Kafka
28

39
NAV uses Aiven hosted Kafka.
@@ -17,7 +23,7 @@ To get started, see [accessing topics from an application](manage_topics.md#acce
1723
Kafka as a system is highly durable, and is designed to be able to keep your data safe in the event of a failure.
1824
This requires a properly configured replication factor for your topic, and that your clients use the appropriate strategy when sending messages and committing offsets.
1925
Even so, our recommendation is that Kafka should not be the master of your data, and you should have the ability to restore your data from some other system.
20-
26+
2127

2228
## Status and roadmap
2329

docs/persistence/redis.md

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ The environment variables use a fixed prefix, and the instance name uppercased a
4242
Example for the sessions instance used above:
4343

4444
| Key | Value |
45-
|-------------------------|----------------------------------------------------------------------------------------------------------------------------------------------|
45+
| ----------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
4646
| REDIS_URI_SESSIONS | The URI for the Redis instance, typically with a `rediss` scheme. <br/>Example: `rediss://redis-team-sessions-nav-dev.aivencloud.com:26483` |
4747
| REDIS_USERNAME_SESSIONS | The username to use when connecting. |
4848
| REDIS_PASSWORD_SESSIONS | The password to use when connecting. |
@@ -58,7 +58,7 @@ We recommend creating your Redis instances in their own workflow for more contro
5858
Creating a Redis instance is done by adding a Redis resource to your namespace with detailed configuration.
5959
Some configuration is enforced by the nais platform, while the rest is up to the users.
6060

61-
Earlier we talked about the "instance name".
61+
Earlier we talked about the "instance name".
6262
In reality, the actual name of the redis instance will be `redis-<team name>-<instance name>` (where `team name` is the same as the namespace your application resides in).
6363
The resource needs to have this full name in order to be accepted.
6464

@@ -81,8 +81,8 @@ spec:
8181
A minimal Redis resource only requires `plan` and `project`.
8282

8383
* `project` should match your nais tenant (`nav`, `mtpilot`, `ssb` or `fhi`) and the environment you are running in (ex. `dev`, `prod`), with a dash (`-`) in between.
84-
* `plan` is the Aiven plan for your Redis instance.
85-
See Aivens list of [possible plan values](https://aiven.io/pricing?product=redis).
84+
* `plan` is the Aiven plan for your Redis instance.
85+
See Aivens list of [possible plan values](https://aiven.io/pricing?product=redis).
8686
The values are lowercased.
8787
Make sure you understand the differences between the plans before selecting the one you need.
8888
Examples: `startup-4`, `startup-56`, `business-4`, `premium-14`.
@@ -102,23 +102,22 @@ Business plans are backed up every 12 hours, keeping 3 days of backups available
102102

103103
Once the resource is added to the cluster, some additional fields are filled in by the platform and should be left alone unless you have a good reason:
104104

105-
| field | |
106-
|-------------------------|-------------------------------------------------------------------------------------------------------|
105+
| field | |
106+
| ----------------------- | ----------------------------------------------------------------------------------------------------- |
107107
| `projectVpcId` | Ensures the instance is connected to the correct project VPC and is not available on public internet. |
108108
| `tags` | Adds tags to the instance used for tracking billing in Aiven. |
109-
| `cloudName` | Where the Redis instance should run. |
109+
| `cloudName` | Where the Redis instance should run. |
110110
| `terminationProtection` | Protects the instance against unintended termination. Must be set to `false` before deletion. |
111111

112112
There are some fields available that should not be used:
113113

114114
| field | |
115-
|------------------------|-------------------------------------------------------------------------------------------------|
115+
| ---------------------- | ----------------------------------------------------------------------------------------------- |
116116
| `authSecretRef` | Reference to a secret containing an Aiven API token. Provided via other mechanisms. |
117117
| `connInfoSecretTarget` | Name of secret to put connection info in, not used as nais provides these via other mechanisms. |
118118
| `projectVPCRef` | Not used since we use `projectVpcId`. |
119119
| `serviceIntegrations` | Not used at this time. |
120120

121-
122121
# Legacy Redis documentation
123122

124123
This is the documentation for how you could run Redis on NAIS yourself, kept here for reference for those teams that continue to run Redis this way.
@@ -272,7 +271,7 @@ An example Redis setup looks like this:
272271
rules:
273272
- application: ${appname}-redisexporter
274273
envFrom:
275-
- secret: ${secret-name}
274+
- secret: ${secret-name}
276275
---
277276
apiVersion: "nais.io/v1alpha1"
278277
kind: "Application"

0 commit comments

Comments
 (0)