|
| 1 | +--- |
| 2 | +Title: When to use RDI |
| 3 | +alwaysopen: false |
| 4 | +categories: |
| 5 | +- docs |
| 6 | +- integrate |
| 7 | +- rs |
| 8 | +- rdi |
| 9 | +description: Understand when (and when not) to use RDI. |
| 10 | +group: di |
| 11 | +hideListLinks: false |
| 12 | +linkTitle: When to use RDI |
| 13 | +summary: Redis Data Integration keeps Redis in sync with the primary database in near |
| 14 | + real time. |
| 15 | +type: integration |
| 16 | +weight: 5 |
| 17 | +--- |
| 18 | + |
| 19 | +RDI is designed to support apps that must use a disk based database as the system of record |
| 20 | +but must also be fast and scalable. This is a common requirement for mobile and web |
| 21 | +apps with a rapidly-growing number of users; the performance of the main database is fine at first |
| 22 | +but it will soon struggle to handle the increasing demand without a cache. |
| 23 | + |
| 24 | +## When to use RDI |
| 25 | + |
| 26 | +You should use RDI when: |
| 27 | + |
| 28 | +- You must use a slow database as the system of record for the app. |
| 29 | +- The app must always *write* its data to the slow database. |
| 30 | +- You already intend to use Redis for the app cache. |
| 31 | +- The data changes frequently in small increments. |
| 32 | +- Your app can tolerate *eventual* consistency of data in the Redis cache. |
| 33 | +- RDI throughput during |
| 34 | + [full sync]({{< relref "/integrate/redis-data-integration/data-pipelines#pipeline-lifecycle" >}}) would not exceed 30K records per second and during |
| 35 | + [CDC]({{< relref "/integrate/redis-data-integration/data-pipelines#pipeline-lifecycle" >}}) |
| 36 | + would not exceed 10K records per second. |
| 37 | + |
| 38 | +## When not to use RDI |
| 39 | + |
| 40 | +You should *not* use RDI when: |
| 41 | + |
| 42 | +- You are migrating an existing data set into Redis only once. |
| 43 | +- Your app needs *immediate* cache consistency rather than *eventual* consistency. |
| 44 | +- The data is ingested from two replicas of Active-Active at the same time. |
| 45 | +- The app must *write* data to the Redis cache, which then updates the source database. |
| 46 | +- Your data set will only ever be small. |
| 47 | +- Your data is updated by some batch or ETL process with long and large transactions - RDI will fail |
| 48 | + processing these changes. |
| 49 | + |
| 50 | +## Decision tree for using RDI |
| 51 | + |
| 52 | +Use the decision tree below to determine whether RDI is a good fit for your architecture: |
| 53 | + |
| 54 | +```decision-tree {id="when-to-use-rdi"} |
| 55 | +id: when-to-use-rdi |
| 56 | +scope: rdi |
| 57 | +rootQuestion: systemOfRecord |
| 58 | +questions: |
| 59 | + systemOfRecord: |
| 60 | + text: | |
| 61 | + Does your app require a disk-based database as the system of record? |
| 62 | + whyAsk: | |
| 63 | + RDI is designed to keep Redis in sync with a primary database. If you don't need a primary database, RDI is not necessary. |
| 64 | + answers: |
| 65 | + yes: |
| 66 | + value: "Yes" |
| 67 | + nextQuestion: writeLocation |
| 68 | + no: |
| 69 | + value: "No" |
| 70 | + outcome: |
| 71 | + label: "RDI is not necessary for your use case" |
| 72 | + id: notNecessary |
| 73 | + writeLocation: |
| 74 | + text: | |
| 75 | + Does your app write data directly to the disk-based database? |
| 76 | + whyAsk: | |
| 77 | + RDI requires the primary database to be the system of record. If your app writes to Redis first, RDI won't work. |
| 78 | + answers: |
| 79 | + yes: |
| 80 | + value: "Yes" |
| 81 | + nextQuestion: consistency |
| 82 | + no: |
| 83 | + value: "No" |
| 84 | + outcome: |
| 85 | + label: "RDI won't work - your app must write to the primary database" |
| 86 | + id: wrongWritePattern |
| 87 | + consistency: |
| 88 | + text: | |
| 89 | + Can your app tolerate eventual consistency in the Redis cache? |
| 90 | + whyAsk: | |
| 91 | + RDI provides eventual consistency, not immediate consistency. If your app needs real-time cache consistency, RDI is not suitable. |
| 92 | + answers: |
| 93 | + yes: |
| 94 | + value: "Yes" |
| 95 | + nextQuestion: throughput |
| 96 | + no: |
| 97 | + value: "No" |
| 98 | + outcome: |
| 99 | + label: "RDI is not suitable - you need immediate cache consistency" |
| 100 | + id: needsImmediate |
| 101 | + throughput: |
| 102 | + text: | |
| 103 | + Will your throughput stay within RDI limits (≤30K records/sec during full sync, ≤10K records/sec during CDC)? |
| 104 | + whyAsk: | |
| 105 | + RDI has throughput limits. Exceeding these limits will cause processing failures and data loss. |
| 106 | + answers: |
| 107 | + yes: |
| 108 | + value: "Yes" |
| 109 | + nextQuestion: dataPattern |
| 110 | + no: |
| 111 | + value: "No" |
| 112 | + outcome: |
| 113 | + label: "RDI throughput limits will be exceeded" |
| 114 | + id: exceedsLimits |
| 115 | + dataPattern: |
| 116 | + text: | |
| 117 | + Is your data updated frequently in small increments (not by batch/ETL with large transactions)? |
| 118 | + whyAsk: | |
| 119 | + RDI captures changes from the database transaction log. Large batch transactions or ETL processes can cause RDI to fail. |
| 120 | + answers: |
| 121 | + yes: |
| 122 | + value: "Yes" |
| 123 | + nextQuestion: dataSize |
| 124 | + no: |
| 125 | + value: "No" |
| 126 | + outcome: |
| 127 | + label: "RDI will fail with batch/ETL processes and large transactions" |
| 128 | + id: batchProcessing |
| 129 | + dataSize: |
| 130 | + text: | |
| 131 | + Is your data set large enough to benefit from caching? |
| 132 | + whyAsk: | |
| 133 | + RDI adds operational complexity. If your data set is small, you may not need caching at all. |
| 134 | + answers: |
| 135 | + yes: |
| 136 | + value: "Yes" |
| 137 | + nextQuestion: dataSource |
| 138 | + no: |
| 139 | + value: "No" |
| 140 | + outcome: |
| 141 | + label: "RDI is not necessary - your data set is too small" |
| 142 | + id: tooSmall |
| 143 | + dataSource: |
| 144 | + text: | |
| 145 | + Is your data ingested from a single source (not from two Active-Active replicas simultaneously)? |
| 146 | + whyAsk: | |
| 147 | + RDI cannot handle data ingested from two Active-Active replicas at the same time, as this creates conflicting change events. |
| 148 | + answers: |
| 149 | + yes: |
| 150 | + value: "Yes" |
| 151 | + outcome: |
| 152 | + label: "✅ RDI is a good fit for your use case" |
| 153 | + id: goodFit |
| 154 | + no: |
| 155 | + value: "No" |
| 156 | + outcome: |
| 157 | + label: "RDI won't work with Active-Active replicas" |
| 158 | + id: activeActive |
| 159 | +``` |
| 160 | + |
| 161 | + |
0 commit comments