By hashedout
Hello, My production app is running on a 80USD server. My tech stack is: MongoDB+Redis NodeJS+PM2 Nginx
This is everything on 1 server. I receive no traffic in the night and hence it’s not the most efficient architecture.
However, most of the things are stateless/or need minimal changes.
I was reading about Kubernetes, which basically autoscales containers. So I want to know if I can decrease my cost by using K8s.
I can run 10USD nodes which can automatically scale up/down lowering my “computational costs”. But how does the same work for my database? Can Redis and mongo be put on K8s nodes? If yes, where is the main database stored? If yes, how is the Redis memory shared between the NodeJS nodes?
Will this architecture increase my costs? Do you have any other advices?
Also, I’m thinking about switching to Postgres in the future as my database in structured, and I use mongoose for joins which is, again, not the efficient method. So, as mongo includes an inbuilt sharding feature, please advise me if the same architecture can be followed with a different database?
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.