a year ago
Hey i had a mongodb replica set - the payment for my account failed for some reason and the applications stopped - when i made the payment all my data is missing need help.
47 Replies
a year ago
did you start the mongodb services back up again?
a year ago
mind sending a screenshot of them?
a year ago
interesting, did you deploy Railway's official MongoDB replica set?
a year ago
alright, thank you
a year ago
and how long was the period between you missing payment and then paying?
I am not 100% sure - as this account is linked to the clients email - the services were down i realised it yesterday and when they made the payment today there's no data
Hey let mek now if you find something please - i also need your help with some cost optimisation on this
a year ago
yea sorry for the delay I was getting some food, I'll ask a team member about this when he wakes up
a year ago
which plan are you on btw?
For this client it's on Hobby currently as we are not yet ready to launch and being beta tested
Would you be able to help me with the cost optimistation part ?
Basically i am using prisma transactions which requires the database to have replicas - but seems like having 3 mongodb instances is costing us too much like no usage and we're already at ~3$ so can we delete on replica will that help - or do you think this cost is not because of the mongodb but something else?
a year ago
It's definitely MongoDB, MongoDB (and MySQL) are expensive databases to run, from my experience a single idle MongoDB service costs 3 usd a month
You can theoretically have a single-node replica-set though if you must have transactions, or just don't use transactions in the first place
of course this does damage redundancy and storage security but if cost is a big issue and you can't afford to host 3 mongo nodes then i don't really see another way to go about it
a year ago
(sorry for taking so long to respond, I'm sick so I was taking a nap)
a year ago
Btw, I did some thinking and I have a theory, I'm going to test it tomorrow (it's 9pm for me)
Hey thanks a ton, really appreciate you helping out even when you're not doing well.
Yes i think i will have to take an alternative route for the replicas this might not be sustainable given small scale of the project.
Sure please try it out and make any changed would be great if i can have my data back and a way to not lose it again incase of the serverices stopping.
Thanks Again!
a year ago
just gonna pop in here to say that if you don't have a backup, that data would be gone
a year ago
but i'll let fragly continue the investigation from here when hes better
Oh no!
But like the data getting deleted didn't expect that, i hope whatever Fragly tries works 🙂
I have used the backup i had from earlier for now to get things running - is there a way/template to migrate mongoDB data to postgres?
Maybe that would be a way to avoid using replicas and not have unncesarry costs
a year ago
hey sorry I'm still testing, I'll give you a rundown of what my testing reveals when I've confirmed everything
a year ago
I'm not sure to be honest, I'm doubtful because MongoDB and Postgres are very different, literally apples and pears (NoSQL and SQL)
it'd be hard automatically transferring bjson-like data over to SQL-like data cause the structure of the bjson data can vary a lot naturally
I think easiest solution would be just writing a quick script to migrate the data over, can't be too hard
a year ago
@Darth Vader I did a lot of testing, and I found that I could replicate the data-loss, it seems that the MongoDB replica-set template didn't mount the volumes on the correct location causing no data to be saved in the first place, I've notified Railway about this mistake and the template has been updated with a fix
Unfortunately the data was never saved in the volume and so recovery would be impossible 😔
Thanks a ton - Fragly i really really appreciate you deeply looking into it - i have manually added all the data from an old backup i hope it doesn;t happen again.
And thanks for your insights on the migration as well.
Thanks sir :))
a year ago
have you updated the volume mounts?
Hey sorry missed the message - when i restored my data i deleted one of the relpica.
Thats is all i did
10 months ago
right but you havent updated the mount path, you will lose data on the next redeploy
10 months ago
the correct mount path is /data/db
10 months ago
yes update both
10 months ago
yes you will
10 months ago
nope
10 months ago
take a backup
10 months ago
!s
Status changed to Solved brody • 11 months ago


