#mkdb - Spin up free Postgres databases in one CLI command

63 messages · Page 1 of 1 (latest)

serene nimbus
#

My favorite free Postgres service, ElephantSQL, is shutting down in January, so I'm building a replacement for my fellow cheap / poor people 😂

https://mkdb.sh

You can create a new database as easily as making a directory with mkdir:

npx mkdb my_new_project

I'm using Prisma with Neon Postgres for keeping track of users, their databases, etc. The platform's data isn't currently hosted on mkdb itself, didn't want to be Icarus flying to close to the sun on that one 🙃

Would really love any feedback you guys have about what could use work. Definitely in the early stages, so could use all the help I can get.

mkdb

Free Postgres hosting, as simple as mkdir

#

Currently, there's only one server for databases in US East, so for anyone in India, the East, etc, it might be rough to use for the time being. Definitely working to get up more database deployment locations ASAP.

formal stratus
serene nimbus
#

Haha, thanks @formal stratus
Let me know if you’re able to try it out at all and if it gives you any trouble

limber bronze
#

nice project man!

#

are you running on demand docker containers inside ec2 ?

bronze citrus
#

How will this work costs wise?

#

What's your road to sustainability? Or do you have a sponsor or something

serene nimbus
#

@limber bronze thanks!

are you running on demand docker containers inside ec2 ?

My original PoC used dynamically spawned docker containers, but I pivoted to using the same architecture of ElephantSql, which is just a Postgres server with child databases and a new role / permissions for each DB.

This ended up being a lot simpler to manage, and should scale much better, which will hopefully allow me to support far more free users than I otherwise would have been able to if everyone got their own docker container.

#

What's your road to sustainability? Or do you have a sponsor or something

@bronze citrus Funding it out of pocket right now, but with the current architecture, I could comfortably support thousands of users without needing revenue.

Kind of on theme with my other comment, I'm building this with sustainability in mind. Really want to ensure there is a free resource like this available into the future for everyone learning Postgres.

The platforms that usually do the rugpull normally offer far far more resources that are obviously not sustainable in the long term. I started out being conservative on data limits, which I can hopefully increase over time if I end up introducing some sort of paid tier.

Don't have any particular grand ambitions with this project right now. The main focus is providing a free Postgres resource, but I may introduce some simple paid tier in the future with much more disk space to help make sure this project can scale to support more free accounts if it needs to.

bronze citrus
#

I'm guessing this means that in the future you'll be able to have a single DB that can use your entire 200mb cap?

#

obviously you'll probably want to split it into more like 4 though, 50mb each

#

US West, US East, Europe, Asia [ Dallas, Chicago, Warsaw, Singapore ] would probably be a good split

serene nimbus
#

Ideally, yep. Right now the platform is deployed to a handful of VPS's in different regions with a set disk limit on each.

When you create a DB (currently), I essentially reserve the full 20MB of disk for that DB. I don't really have any mechanism currently for moving databases across VPS's to make additional room dynamically, so I just assume that every DB will use the full allotment eventually.

If I implemented it such that you can spread your data allotment however you want across all your DB's, then I would basically have to set aside 200MB for every single DB (regardless of how much data is in it), which I can't afford to do right now.

^This is just a limitation of me not being able to move DBs across VPSs / a limitation of the fact that I chose to use VPS's in the first place, but I wanted to reduce the risk of bankrupting myself via a hyperscaler 😅

bronze citrus
serene nimbus
#

yeah i think those would be really good options. currently you can choose between these. so kind of have US East, EU, and Asia covered a bit. no US West or Lat Am option yet though.

bronze citrus
#

apparently Poland has better energy pricing

serene nimbus
#

interesting

bronze citrus
#

might be wrong though

#

also Germany probably has better datacenter competition, so it might be a wash, not sure

#

Singapore is a better compromise too, helps out australians

#

lots of folks in India & the Middle East will probably get served from Europe anyway

serene nimbus
#

mmm the australia / oceania aspect is a really good point

#

for singapore

#

lots of folks in India & the Middle East will probably get served from Europe anyway

how do you mean? they can choose where they want their db deployed, why would they choose eu if its further?

serene nimbus
#

yeah exactly, why would their latency be better hitting a server in EU over Delhi?

bronze citrus
#

I meant over Singapore

serene nimbus
#

ahhh gotcha

bronze citrus
#

apparently south america routing to Dallas is pretty good too, guessing its better than Miami

#

West coast hosting (eg. San Francisco) is really expensive, Dallas is a good US/West host imo

serene nimbus
#

this wondernetwork thing is great. i was actually just chose miami originally bc it was a bit further south, so i assumed it would be better for South America

bronze citrus
#

I don't think there's a lot of seabed investment there

#

just thinking about economics, it makes more sense that Dallas is better

#

because of central america (Mexico)

#

oh huh I guess I'm wrong

#

"early 2024" lol

#

ugh wondernetwork is throttling me lol

#

okay here we go

#

looks like it is up and running

#

Mexico's routing is probably just bad

serene nimbus
#

might just deploy something in latam directly anyway, but dallas might be good as a way to service all of NA

#

im sure miami-> seattle is prob pretty bad

bronze citrus
#

oh yeah

#

but not great

bronze citrus
marble sequoia
#

Cool Prisma!

delicate skiff
#

hey @serene nimbus nice project, i would like to know where the datbases are hosted? Wanna build my own platform like this just for mongodb

serene nimbus
#

thanks @delicate skiff !

Each database region is on a dedicated VPS (Vultr in my case). I think either a VPS or an autoscaler (AWS, Azure, GCP, etc) are both fine. I was just worried about inadvertently running up huge bills if I used EC2 or something like that.

delicate skiff
delicate skiff
#

@serene nimbus What does yours dedicated VPS cost at month?

serene nimbus
signal fern
#

Yoo @serene nimbus Thank you. Do I have permission to showcase this in a few youtube tutorials? This is great for devs that want to host a project but don't have the funds to pay for a database right away

serene nimbus
#

@signal fern That would be great! That’s the perfect use case for this, exactly who I made it for 🙂