redis
glitchdetected
TRIALOP

2 years ago

how do i create a redis db in railway and use it for caching

Solved

92 Replies

glitchdetected
TRIALOP

2 years ago

0d7e110e-7656-445a-b563-506b47a395a0


glitchdetected
TRIALOP

2 years ago

and also


glitchdetected
TRIALOP

2 years ago

REDIS_URL="redis://default:${{REDIS_PASSWORD}}@${{RAILWAY_PRIVATE_DOMAIN}}:6379"


2 years ago

In your project, you can right click, click on Database, and click on Add Redis

From there you can connect to redis using the REDIS_URL variable which you can find in the Variables tab (you can set up a shared variable to directly link it into your service's variables)


glitchdetected
TRIALOP

2 years ago

where do i get the password and private domain


glitchdetected
TRIALOP

2 years ago

REDIS_URL="redis://default:${{REDIS_PASSWORD}}@${{RAILWAY_PRIVATE_DOMAIN}}:6379"
REDISHOST="${{RAILWAY_PRIVATE_DOMAIN}}"
REDISPASSWORD="${{REDIS_PASSWORD}}"
REDISPORT="6379"
REDISUSER="default"

2 years ago

check the REDIS_PASSWORD variable for the password and service settings for private domain

or click on the eye icon to see what the final value is


glitchdetected
TRIALOP

2 years ago

?


glitchdetected
TRIALOP

2 years ago

the one where it says smthing like viaduct.proxy.rlwy.net:50952?


2 years ago

that's the public domain, the private domain would be a railway.internal domain


2 years ago

it's much easier just clicking on the eye icon next to the variable to see the actual value though


glitchdetected
TRIALOP

2 years ago

uh


glitchdetected
TRIALOP

2 years ago

redis.railway.internal


glitchdetected
TRIALOP

2 years ago

?


2 years ago

yes


glitchdetected
TRIALOP

2 years ago

the one saying Private Networking right>


glitchdetected
TRIALOP

2 years ago

?


2 years ago

correct


glitchdetected
TRIALOP

2 years ago

REDIS_STRING="redis://default:pass@redis.railway.internal:6379"

glitchdetected
TRIALOP

2 years ago

like this ?


2 years ago

that looks about right (assuming pass is your password)


2 years ago

It's recommended you use reference variables instead of defining the variable manually (although doing it manually will still work)


2 years ago

REDIS_STRING="${{Redis.REDIS_URL}}"

glitchdetected
TRIALOP

2 years ago

how much storage does railway give you in redis


2 years ago

You get 0.5GB on trial, 5GB on hobby and up to like 250GB or something on pro


glitchdetected
TRIALOP

2 years ago

by 0.5gb do you mean 500 megabytes?


2 years ago

yup


glitchdetected
TRIALOP

2 years ago

and also


glitchdetected
TRIALOP

2 years ago

does railway let me host my discord bot 24/7?


glitchdetected
TRIALOP

2 years ago

because my home server cpu cant run modern code


2 years ago

yes, your bot will run 24/7 on Railway


glitchdetected
TRIALOP

2 years ago

damn


glitchdetected
TRIALOP

2 years ago

i can deploy everything to railway


glitchdetected
TRIALOP

2 years ago

how many projects can i have


2 years ago

true!!


2 years ago

well, idk if there's a limit on projects, projects are just a container for services so the real question is how many services


2 years ago

there isn't a service limit on hobby or pro (at least that I know of)


glitchdetected
TRIALOP

2 years ago

railway uses docker right


2 years ago

there is one on trial, I'm not exactly sure how many that is


2 years ago

yea, your app is deployed into a docker container


glitchdetected
TRIALOP

2 years ago

i have a few website running on my web server


glitchdetected
TRIALOP

2 years ago

@Fragly i got Add PostgreSQL Error


glitchdetected
TRIALOP

2 years ago

i was trying to add a postgresql database for my discord bot in railway


2 years ago

how many services do you currently have?


glitchdetected
TRIALOP

2 years ago

projects?


glitchdetected
TRIALOP

2 years ago

wdym by services


2 years ago

Here's a rundown of Railway's terminology

1330637093227200654


glitchdetected
TRIALOP

2 years ago

i have 2 services


glitchdetected
TRIALOP

2 years ago

mongodb and redis


2 years ago

yeaa 😬 it's likely you hit that service limit I mentioned earlier


2 years ago

My recommendation would be to host databases outside of Railway, MongoDB could go on MongoDB atlas for example

I used to do that and it worked very well, great for saving on costs too


2 years ago

that, or just upgrade to hobby plan, if you're a hobbyist developer then you probably won't regret it


glitchdetected
TRIALOP

2 years ago

my home server has postgresql but idk how to make it public


2 years ago

yea that's a whole can of worms, hosting your databases yourself could work perfectly for sure

although it's probably easier just finding free database hosting solutions online (e.g, atlas for mongodb)


glitchdetected
TRIALOP

2 years ago

the problem is its on an internal ip


2 years ago

then your actual code can stay on Railway


glitchdetected
TRIALOP

2 years ago

im planning on getting a rasp pi to host my bot too


2 years ago

yea, though exposing it is definitely possible but outside the scope of this help thread


2 years ago

my suggestion: find free database hosting solutions online and host your code on Railway


glitchdetected
TRIALOP

2 years ago

i got home services on the ip so thats a problem


2 years ago

oh fair


glitchdetected
TRIALOP

2 years ago

or im getting a synology nas


glitchdetected
TRIALOP

2 years ago

ok i just found this


glitchdetected
TRIALOP

2 years ago

You can create a template and add as many services as you'd like. All you need to do is give us a service name and a link to the GitHub URL where the code for the service is located. You can still configure service-level environment variables along with default values and descriptions for each variable.


2 years ago

what's that in reference to?


glitchdetected
TRIALOP

2 years ago

found it here



2 years ago

why do you want to make a template?


glitchdetected
TRIALOP

2 years ago

prob read that incorrectly my bad


glitchdetected
TRIALOP

2 years ago

Error: SequelizeConnectionError: password authentication failed for user "arrow" postgresql error in railway


glitchdetected
TRIALOP

2 years ago

nevermind i fixed it


glitchdetected
TRIALOP

2 years ago

@Fragly also do you know how i can stop my service from running?


2 years ago

sorry I was eating a hotdog


2 years ago

yes, you can go to the Deployments tab, click on the hamburger menu thingy and you'll see an option to remove the running deployment


2 years ago

going to bed will check back when I wake up


glitchdetected
TRIALOP

2 years ago

i ate a whole ass whale


glitchdetected
TRIALOP

2 years ago

cya


2 years ago

I'm back, was there anything else you needed help with or am I free to mark as solved?


glitchdetected
TRIALOP

2 years ago

how do i delete a table in postgresql (railway


glitchdetected
TRIALOP

2 years ago

i dont seem to find the delete button for it anywhere


2 years ago

Use a proper database client like dbgate


glitchdetected
TRIALOP

2 years ago

whats that


2 years ago

Google it! better you read the docs than trust everything we say


glitchdetected
TRIALOP

2 years ago

already did and downloaded it


glitchdetected
TRIALOP

2 years ago

so how do i delete a table on it


2 years ago

Again, google it.


2 years ago

Both Railway and dbgate have docs you can read


2 years ago

@glitchdetected1 can I finally mark this as solved <:PinkPlead:1033655200659026020>


glitchdetected
TRIALOP

2 years ago

in 2090


2 years ago

<:whyy2:820544722572673045>


2 years ago

I can't wait that long, marking as solved, feel free to open another one if you need more help


2 years ago

!s


Status changed to Solved dev • over 1 year ago


Welcome!

Sign in to your Railway account to join the conversation.

Loading...