redis
glitchdetected
TRIALOP

a year ago

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

Solved

92 Replies

glitchdetected
TRIALOP

a year ago

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


glitchdetected
TRIALOP

a year ago

and also


glitchdetected
TRIALOP

a year ago

REDISURL="redis://default:${{REDISPASSWORD}}@${{RAILWAYPRIVATEDOMAIN}}:6379"


a year 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

a year ago

where do i get the password and private domain


glitchdetected
TRIALOP

a year ago

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

a year 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

a year ago

?


glitchdetected
TRIALOP

a year ago

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


a year ago

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


a year ago

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


glitchdetected
TRIALOP

a year ago

uh


glitchdetected
TRIALOP

a year ago

redis.railway.internal


glitchdetected
TRIALOP

a year ago

?


a year ago

yes


glitchdetected
TRIALOP

a year ago

the one saying Private Networking right>


glitchdetected
TRIALOP

a year ago

?


a year ago

correct


glitchdetected
TRIALOP

a year ago

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

glitchdetected
TRIALOP

a year ago

like this ?


a year ago

that looks about right (assuming pass is your password)


a year ago

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


a year ago

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

glitchdetected
TRIALOP

a year ago

how much storage does railway give you in redis


a year ago

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


glitchdetected
TRIALOP

a year ago

by 0.5gb do you mean 500 megabytes?


a year ago

yup


glitchdetected
TRIALOP

a year ago

and also


glitchdetected
TRIALOP

a year ago

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


glitchdetected
TRIALOP

a year ago

because my home server cpu cant run modern code


a year ago

yes, your bot will run 24/7 on Railway


glitchdetected
TRIALOP

a year ago

damn


glitchdetected
TRIALOP

a year ago

i can deploy everything to railway


glitchdetected
TRIALOP

a year ago

how many projects can i have


a year ago

true!!


a year 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


a year ago

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


glitchdetected
TRIALOP

a year ago

railway uses docker right


a year ago

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


a year ago

yea, your app is deployed into a docker container


glitchdetected
TRIALOP

a year ago

i have a few website running on my web server


glitchdetected
TRIALOP

a year ago

@Fragly i got Add PostgreSQL Error


glitchdetected
TRIALOP

a year ago

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


a year ago

how many services do you currently have?


glitchdetected
TRIALOP

a year ago

projects?


glitchdetected
TRIALOP

a year ago

wdym by services


a year ago

Here's a rundown of Railway's terminology

1330637093227200800


glitchdetected
TRIALOP

a year ago

i have 2 services


glitchdetected
TRIALOP

a year ago

mongodb and redis


a year ago

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


a year 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


a year ago

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


glitchdetected
TRIALOP

a year ago

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


a year 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

a year ago

the problem is its on an internal ip


a year ago

then your actual code can stay on Railway


glitchdetected
TRIALOP

a year ago

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


a year ago

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


a year ago

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


glitchdetected
TRIALOP

a year ago

i got home services on the ip so thats a problem


a year ago

oh fair


glitchdetected
TRIALOP

a year ago

or im getting a synology nas


glitchdetected
TRIALOP

a year ago

ok i just found this


glitchdetected
TRIALOP

a year 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.


a year ago

what's that in reference to?


glitchdetected
TRIALOP

a year ago

found it here



a year ago

why do you want to make a template?


glitchdetected
TRIALOP

a year ago

prob read that incorrectly my bad


glitchdetected
TRIALOP

a year ago

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


glitchdetected
TRIALOP

a year ago

nevermind i fixed it


glitchdetected
TRIALOP

a year ago

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


a year ago

sorry I was eating a hotdog


a year 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


a year ago

going to bed will check back when I wake up


glitchdetected
TRIALOP

a year ago

i ate a whole ass whale


glitchdetected
TRIALOP

a year ago

cya


a year ago

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


glitchdetected
TRIALOP

a year ago

how do i delete a table in postgresql (railway


glitchdetected
TRIALOP

a year ago

i dont seem to find the delete button for it anywhere


a year ago

Use a proper database client like dbgate


glitchdetected
TRIALOP

a year ago

whats that


a year ago

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


glitchdetected
TRIALOP

a year ago

already did and downloaded it


glitchdetected
TRIALOP

a year ago

so how do i delete a table on it


a year ago

Again, google it.


a year ago

Both Railway and dbgate have docs you can read


a year ago

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


glitchdetected
TRIALOP

a year ago

in 2090


a year ago

<:whyy2:820544722572673045>


a year ago

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


a year ago

!s


Status changed to Solved dev about 1 year ago


Loading...