You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
And set Solid Cache as your application's cache store backend manually, in your environment config:
@@ -59,6 +91,8 @@ And set Solid Cache as your application's cache store backend manually, in your
59
91
config.cache_store =:solid_cache_store
60
92
```
61
93
94
+
#### Run migrations
95
+
62
96
Finally, you need to run the migrations:
63
97
64
98
```bash
@@ -168,46 +202,6 @@ Only triggering expiry when we write means that if the cache is idle, the backgr
168
202
169
203
If you want the cache expiry to be run in a background job instead of a thread, you can set `expiry_method` to `:job`. This will enqueue a `SolidCache::ExpiryJob`.
170
204
171
-
### Using a dedicated cache database
172
-
173
-
Add database configuration to database.yml, e.g.:
174
-
175
-
```
176
-
development:
177
-
cache:
178
-
database: cache_development
179
-
host: 127.0.0.1
180
-
migrations_paths: "db/cache/migrate"
181
-
```
182
-
183
-
Create database:
184
-
```
185
-
$ bin/rails db:create
186
-
```
187
-
188
-
Install migrations:
189
-
```
190
-
$ bin/rails solid_cache:install:migrations
191
-
```
192
-
193
-
Move migrations to custom migrations folder:
194
-
```
195
-
$ mkdir -p db/cache/migrate
196
-
$ mv db/migrate/*.solid_cache.rb db/cache/migrate
197
-
```
198
-
199
-
Set the engine configuration to point to the new database:
200
-
```yaml
201
-
# config/solid_cache.yml
202
-
production:
203
-
database: cache
204
-
```
205
-
206
-
Run migrations:
207
-
```
208
-
$ bin/rails db:migrate
209
-
```
210
-
211
205
### Sharding the cache
212
206
213
207
Solid Cache uses the [Maglev](https://static.googleusercontent.com/media/research.google.com/en//pubs/archive/44824.pdf) consistent hashing scheme to shard the cache across multiple databases.
0 commit comments