Use Redis for ActiveJob and ActionCable #2004
Reference in New Issue
Block a user
Delete Branch "zachgoll/use-redis-for-jobs-and-cable"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Self hosters: BREAKING CHANGES
This PR introduces breaking changes and action is required to keep your self hosted app working and receiving updates
What are the changes?
Why the changes?
As we introduce our new AI chat feature and continue to iterate on our background data syncs, we believe that moving away from a database-backed job backend is advantageous for the long-term quality of the app.
How to migrate
Choose the migration guide below based on which hosting platform you are using.
Docker Compose
Below are the steps to migrate your docker compose setup to use the new Maybe stack.
How this impacts you
Required migration steps
Step 1: Backup your database
While the following changes should not affect your database, it is always good to backup your database when making significant changes to a Docker compose setup.
You can make a quick backup locally by:
compose.ymlfile is indocker compose exec postgres pg_dump -U maybe_user maybe_production > backup_$(date +%Y%m%d).sqlwherepostgresrepresents the name of the database service in yourcompose.ymlfile.Step 2: Stop your service
Step 3: Replace your
compose.ymlfile with the new example fileThe new
compose.example.ymlfile has been refactored to use the new services and should work with your existing.envfile. You can simply copy/paste the new file found here:https://github.com/maybe-finance/maybe/blob/main/compose.example.yml
Step 3: Start your service
As noted in the official guide, you can pull the latest updates and start the service per usual:
If at any point you get stuck, you can always reference our Docker guide, which takes you step-by-step to getting the Maybe app running:
https://github.com/maybe-finance/maybe/blob/main/docs/hosting/docker.md
Render
Note: your services will not be deleted or altered by this change
How this impacts you
Required migration steps
noeviction (recommended for queues/persistence)REDIS_URLin both the main Rails "web" service and the new background worker you just createdIf you get stuck at any point, Render has an excellent guide explaining how to setup Rails, Sidekiq, and Redis together. The Maybe app's setup is very "standard" and this guide is highly applicable:
https://render.com/docs/deploy-rails-sidekiq
@@ -0,0 +34,4 @@x-rails-env: &rails_env<<: *db_envSECRET_KEY_BASE: ${SECRET_KEY_BASE:-a7523c3d0ae56415046ad8abae168d71074a79534a7062258f8d1d51ac2f76d3c3bc86d86b6b0b307df30d9a6a90a2066a3fa9e67c5e6f374dbd7dd4e0778e13}Purely for example purposes (to make the compose setup work without any config). Users should set this in their environment.
@zachgoll could you please mention this in the release notes somewhere?
Some note about breaking changes for self hosters would be good to have there. Otherwise people will break their instances when updating.
@al-lac good call, will get a note added.
I am using the following docker compose and still have synchronization problems.
Do I need to add other parameters? Currently I set maybe in unraid
services:
maybe:
image: ghcr.io/maybe-finance/maybe:latest
container_name: Maybe
network_mode: bridge
volumes:
- /mnt/user/appdata/maybe/data:/rails/storage
ports:
- 3000:3000
restart: unless-stopped
environment:
SECRET_KEY_BASE:
DB_HOST: IP
DB_PORT: 5432
POSTGRES_USER:
POSTGRES_PASSWORD:
POSTGRES_DB: maybe_production
OPENAI_ACCESS_TOKEN:
REDIS_URL: redis://IP:6379/8
RAILS_FORCE_SSL: true
RAILS_ASSUME_SSL: true
SELF_HOSTED: true
APP_DOMAIN: https://maybe.domain.com
labels:
net.unraid.docker.webui: http://[IP]:[PORT:3000]
net.unraid.docker.icon: https://raw.githubusercontent.com/nwithan8/unraid_templates/master/images/maybe-icon.png
traefik.enable: true
traefik.http.routers.pfm.rule: Host(
maybe.domain.com)Are there any Railway users who have managed to get this upgrade working?
I'm using this template, and have no idea what I should add/remove: https://railway.com/template/_mFlP4
It's been stuck on "Syncing accounts data" for the last two days:

Hey @candideu! I've made an updated template for Railway here: https://railway.com/template/dFsiOp?referralCode=vOnDKx. Feel free to check it out :)
@@ -0,0 +34,4 @@x-rails-env: &rails_env<<: *db_envSECRET_KEY_BASE: ${SECRET_KEY_BASE:-a7523c3d0ae56415046ad8abae168d71074a79534a7062258f8d1d51ac2f76d3c3bc86d86b6b0b307df30d9a6a90a2066a3fa9e67c5e6f374dbd7dd4e0778e13}Does the
SECRET_KEY_BASEenvironment shared between thewebandSidekiqservice?Or both the service needs to have separate (unique) secret keys.
Hi @Joelute : Unfortunately, the Maybe service crashed in Railway when I tried to deploy your template...