Question about mongoDB in railway
magicmike123
HOBBYOP

2 years ago

So, can I just create a mongoDB railway and actually get charged only by usage, unlike mongoDB atlas paid plans? If so, isnt this basically cheaper than mongoDB atlas? (I have never used anything else for mongoDB other than mongoDB atlas)

Solved

71 Replies

magicmike123
HOBBYOP

2 years ago

N/A


2 years ago

you always only pay for what you use, it depends how much ram, cpu your database are using 😁


magicmike123
HOBBYOP

2 years ago

right, so its basically saving costs if I barely use it? I was thinking of a project where I would just send some KB each day to the mongoDB, but mongoDB atlas wants to charge me like, per hour and such, like all the time. this is cheaper I believe, for my case at least


maddsua
HOBBY

2 years ago

Exactly, you only pay for resource usage and not stuff like requests or whatever


maddsua
HOBBY

2 years ago

Problem is, mongo eats quite a lot of ram even when not doing anything at all


maddsua
HOBBY

2 years ago

IIRC it's around 300mb when idling


magicmike123
HOBBYOP

2 years ago

I would imagine mongoDB atlas would be the cheapest thing for hosting mongoDB databases, since its their own stuff. But maybe thats why they can also charge more?


magicmike123
HOBBYOP

2 years ago

300mb RAM idling? holy sht


maddsua
HOBBY

2 years ago

Ye just use postgres


2 years ago

postgres on top


maddsua
HOBBY

2 years ago

The actual database and not that soy shit


maddsua
HOBBY

2 years ago

You'd have to learn sql for that, sure, but it's worth it


magicmike123
HOBBYOP

2 years ago

i mean free version of mongoDB amazing I guess but holy sht, I just checked on railway and 350 mb idle you are right! thats crazy


magicmike123
HOBBYOP

2 years ago

and postgres is 60 MB only!

1338488785318576233


maddsua
HOBBY

2 years ago

Mongo is ass, what can I say


maddsua
HOBBY

2 years ago

Even less actually


maddsua
HOBBY

2 years ago

My pg instance only uses like 35 mb


maddsua
HOBBY

2 years ago

And its with the workload


magicmike123
HOBBYOP

2 years ago

but I barely been using this postgres db


maddsua
HOBBY

2 years ago

(it only really reads a few entries tho)


maddsua
HOBBY

2 years ago

It will go down after some time


magicmike123
HOBBYOP

2 years ago

like I added like 3 tables and have no data on them anyways


magicmike123
HOBBYOP

2 years ago

ah okey


maddsua
HOBBY

2 years ago

Dw pg won't skyrocket


magicmike123
HOBBYOP

2 years ago

I mean still you know compared to mongoDB


magicmike123
HOBBYOP

2 years ago

and 0.0 CPU postgress vs 0.6 CPU mongoDB


maddsua
HOBBY

2 years ago

Actually I lied, I'm also using the same instance to store grafana's data


magicmike123
HOBBYOP

2 years ago

nice


maddsua
HOBBY

2 years ago

So it's not a few records xD


magicmike123
HOBBYOP

2 years ago

man I got one question now, which confuses me


maddsua
HOBBY

2 years ago

It's A FUCK TON OF STUFF


magicmike123
HOBBYOP

2 years ago

so I like mongoDB with node because you can use mongoose easy, for creating models directly in the DB right away etc, not have to use this migration sht that I saw on some course, is there a way to do this with PostgreSQL, with some ORM? I love this idea of create db model with mongoose then start server and collections create right away basically


magicmike123
HOBBYOP

2 years ago

there has to be something, right?


maddsua
HOBBY

2 years ago

Ehhh probably


maddsua
HOBBY

2 years ago

I'm not using node <:kekw:788259314607325204>


magicmike123
HOBBYOP

2 years ago

what you using?


magicmike123
HOBBYOP

2 years ago

I was learning Rust too


maddsua
HOBBY

2 years ago

I mean there definitely are orms for node


magicmike123
HOBBYOP

2 years ago

but i dont know what Im doing at it so yeah


maddsua
HOBBY

2 years ago

Go and C++ πŸ’€


magicmike123
HOBBYOP

2 years ago

right, I just dont know if this thing is mongoDB specific, or I could do also this in PostgreSQL


magicmike123
HOBBYOP

2 years ago

I dont even know, you ever done this on Go or C++? where database creates tables automatically based on your code models?


magicmike123
HOBBYOP

2 years ago

like do you do migrations in your code? @maddsua


maddsua
HOBBY

2 years ago

I'm using gomigrate personally


maddsua
HOBBY

2 years ago

@ThallesComH bro I'm pretty sure you know a few orms for node


magicmike123
HOBBYOP

2 years ago

so I have to learn this migration sht right, theres no escape? xd


magicmike123
HOBBYOP

2 years ago

1338490986979917895


magicmike123
HOBBYOP

2 years ago

chatGPT spiting facts i think


magicmike123
HOBBYOP

2 years ago

xd


magicmike123
HOBBYOP

2 years ago

can be possible it seems


maddsua
HOBBY

2 years ago

You either depend on proprietary stuff or you learn the tools. Yes, there is no escape


2 years ago

Good ones include TypeORM and Prisma. Pick TypeORM if you value performance, Prisma if you value developer experience


maddsua
HOBBY

2 years ago

sqlc+gomigrate if you're a real man <:kekw:788259314607325204>


2 years ago

There's also Drizzle which is its own thing and doesn't use any external stuff. Prisma is annoying because it force ships specific engines for the environment, and TypeORM uses pg under the hood


2 years ago

Sqlc on top for go developers >>


2 years ago

Cc: @Script


2 years ago

Also, I should mention that these ORMS work better with typescript rather than vanilla Js, so if you are currently not using typescript it would be wise to start doing so


magicmike123
HOBBYOP

2 years ago

nice, well Im mostly now interested in the fact that at least, this is possible


magicmike123
HOBBYOP

2 years ago

and I was trying to learn Rust so, I wonder if its possible this with Rust


2 years ago

There are ORMS for rust too, but truthfully the good ones are only for SQL databases..


magicmike123
HOBBYOP

2 years ago

yeah, I meant this on Rust with PostgreSQL


maddsua
HOBBY

2 years ago

If you want to lose your mind, rust or c++ are the languages of choice


magicmike123
HOBBYOP

2 years ago

well thats how we learn to become better programmers with complicated stuff sometimes


maddsua
HOBBY

2 years ago

Valid


magicmike123
HOBBYOP

2 years ago

big learning time βœ… have lot to learn now

1338493796786110546


2 years ago

I think we’re good to call this thread solved! lmk if I can close


2 years ago

@Script forget about TypeORM, its not in a good state for a while.

I would go with Prisma or Drizzle, Prisma is the easiest so I recommend that.


magicmike123
HOBBYOP

2 years ago

yes


magicmike123
HOBBYOP

2 years ago

can close


magicmike123
HOBBYOP

2 years ago

okey thanks for info πŸ™‚


2 years ago

!s


Status changed to Solved adam β€’ over 1 year ago


Welcome!

Sign in to your Railway account to join the conversation.

Loading...