Ask HN: How do you deploy your weekend project in 2022?

52 points by bitgif ↗ HN
What do you use to launch your weekend project these days?

Example, I'm developing a simple Python project that uses database. Need db service that I don't want to manage. Also, want to auto scale

49 comments

[ 2.8 ms ] story [ 99.5 ms ] thread
flyio since Heroku had the little accident, works for me
We just posted our first Show HN ever with your exact same setup, but s/python/go. If you're running it in Docker, then this might work for you too:

1) CloudRun ( run a Docker container exposing a port to the web )

It can autoscale.

2) CloudSQL ( managed Postgres and some other SQL choices )

We faced some friction getting the two connected. CloudSQL is available on an IP address, then in our code we have PSQL library which we specify the IP address to. The complication was that CloudRun instances can't actually "see" the CloudSQL. After navigating the GCP documentation, website, and some trial and error, it magically worked.

It was painful to get setup but it's running smooth now.

Compute / VPS: Railway, Render, Fly.io, Dokku on any VPS

Managed DB: Railway, Render, Planetscale, Supabase

I like Serverless on aws. It's super cheap (free tier), and even the database in RDS has a free version for Postgres. Front end I like to deploy using Next.js and Vercel or Netlify.

I haven't had a problem scaling because its all lambda so it scales nicely and is all self contained for functions.

I've used DynamoDB with is even simpler but if you think you'd ever want something relational or more familiar I would definitely go with Postgres RDS

I usually just use terraform to deploy to AWS with some additional scripts to rsync files from the CI/CD pipeline.

At this point I just have a template to do it and reuse it in my various projects.

If I don't need a server, I usually just use the Serverless framework.

Can you please explain how/why terraform is used?
Serverless on Google Cloud (it scales and no manual management)

1. If DB is needed - Google App Engine with Datastore (default) or Firestore

2. If no DB - Google App Engine (default) or Cloud Run

Namecheap shared hosting, cpanel, php, myphpadmin for MySQL admin.
GCP & GKE, I already have the cluster so everything pretty much lands there. Great way to learn k8s if you don't know it already
Rails, Heroku, and Cloudflare. Very easy, but costs are rising.
It depends. Azure Static Webapps + Azure Storage (tables, queues and blob) for simple js web applications. Fly.io for things that need more complex environment.
AWS CDK is pretty magical. The whole "constructs" that they have are very powerful. I was able to setup a scale-to-zero RDS Serverless database with an auto scaling backend using ECS + Fargate in a few hours. (With zero prior experience with the CDK)

You can see that code here if you're curious: https://github.com/lunasec-io/lunasec/blob/master/lunatrace/...

It's more complicated now but if you look at the history of that "backend-cdk" folder then it's simpler a few months ago.

The important bit is the "ecs-patterns" library. That's the one that is magical and deals with setting up the load balancer, cluster, etc for you. And the way we shove the Docker images in I found to be quite straightforward. (And deploys are one line)

If auto scale is needed, then I‘m sticking to Firebase hosting, cloud functions written in NodeJS and BigQuery or Firestore depending on the update frequency

For recent projects where auto scale is not needed I‘m happily using FlightPHP as a REST framework and use SQLite as my db service. Frontend UI is provided by just including Bootstrap.

This setup feels great, because it takes me back to my origins of web development: simple tools that work and get stuff of my plate.

Before installing 250 MB of NPM dependencies, pre-processors etc.

Bare metal from the likes of Hetzner for most things. Serverless for some small components which benefit from global distribution.

I currently have ~30 containers running on a Hetzner server w/ 64GB of RAM and 16 dedicated cores for ~$25/mo. I even get direct access to the Intel iGPU for graphics acceleration at no additional cost.

Cloud providers like AWS give you a couple orders of magnitude less resources for the same dollars. Too many engineers are getting fleeced into using crappy solutions (VPS's, almost anything by AWS/Azure/GCloud/Digital Ocean) because they're all they've ever known.

What option is this? I see 4 core options reaching ~$20
Check server auctions. You can buy out someone else's lease. Pricing and availability depends on supply and demand.

I used to pay $45 for the same specs, until I found this offer and migrated.

Any idea what the Hetzner equivalent in the US would be?
I don't think there's an equivalent in the US but I've used OVH in their Canadian datacenters.
Hetzner Cloud have US hosting region.
If I could get a dedicated server for that price in Australia I would be using that instead of a VPS for sure. Sadly I don't think that exists.
Found the same thing when was comparing AWS/Azure to fixed prices providers. When I then looked into it further I found AWS/Azure provided “recommendations” when you selected “production” workloads which was grossly overpriced.

Hetzner Cloud I found is a good balance between price and convenience.

SSH + Docker compose makes for a simple deployment process.

Related write up here: https://servicestack.net/blog/finding-best-us-value-cloud-pr...

How did you get such a cheap machine? The cheapest root server right now is about 45, the cheapest server auction is 35.
I don't side-project anymore, but here's what I used to do back in the day:

I got myself a dedicated box from OVH, located in Canada. 32 threads, 64 GB EEC, NVMe disks and unmetered 1Gbps outgoing link. That cost me ~$100.

In it I had my application server and database, as well as disk caching layer in front of S3.

No need to worry about auto-scaling, as that beefy server could take care of 10-100x more users than I currently handled.

No need to worry about bandwidth costs or getting DDoSed. The gigabit link was more than sufficient (I think I used 5% of it), and OVH provides an anti-ddos service included in the price.

I had a cheaper ($10) dedicated box from Kimsufi which I used to host CI, Phabricator and other non-critical stuff.

I'd deploy with a simple ansible script which would launch a new docker container that HAProxy would then point to (similar to a green-blue deployment). This allowed me to deploy small changes[0] silently and I could test them before the actual release.

My side project was not critical enough, so if for any reason my host was unreachable I could perform a disaster recovery anywhere else by restoring from my backups. In ~4 years, I never had to do that.

If I were to start a side / weekend project today, I would probably follow a similar route. Running cloud compute instances with unpredictable bandwidth billing gives me anxiety.

[0] - As long as they did not have database migrations in them.

on aws as scale to zero services. lambda, dynamo, s3, and ephemeral ec2 spot.

when egress bandwidth is needed i use cloudflare workers + r2 just like i would use s3 presigned urls.

services with no usage should have no cost. services with usage should bill based on usage.

typically i start from a full project template[1][2]. sometimes i start from scratch[3].

1. https://github.com/nathants/aws-gocljs

2. https://github.com/nathants/aws-exec

3. https://github.com/nathants/libaws

Typically, something like make && ./start

If it's a daemon, I write a systemd service file.

since nobofy mentioned, I use https://caprover.com and a server on Hetzner. Caprover is easy to install and use, it has ui, cli, different deployment methods, automatic let's encrypt and possibility to install predefined apps like a database for example. I don't use cluster mode, since there is no need for me, but it has cluster support as well. I would say it is perfect fit for small home lab for personal projects.
Been having good expense with momgodb app services, pretty flexible if you don't know which direction your project will take
managed hosting from godaddy.com is all you will ever need for this kind of scale
Have a look at https://stacktape.com. It removes the complexity behind AWS and allows you to deploy applications with zero DevOps. It also allows you to fully leverage your AWS free tier.

You can deploy containers, lambda functions, SQL databases, Redis, MongoDb and many more infrastructure components with just a few lines of config.

(I work at Stacktape)

terraform and AWS’s free tier. Only costs are route53 costs which depending on your setup you can also eliminate.

I’m usually utilizing a static site generator for main site; usually S3 behind a CDN.

Then I’ll typically have my services written in go running serverless behind apigateway. Then locally I just have my services running on a generic http framework.

I host my side project / "e-commerce" business on a tiny $3/year VPS (found using lowendbox), it only receives bytes (119 to be exact) from the mobile app each time it's used.

Frontend is that handcrafted artisanal static HTML hosted on CloudFlare Pages, and simple button for checkout to Shopify/Stripe/whatever.

The damn licensing for publishing my iOS app costs more than my entire infrastructure. Stay lean!

Honestly, I should simply move to "serverless" ala AWS Lambda, but probably won't until (if) things go gangbusters.