[HN Gopher] Ask HN: How do you deploy your weekend project in 2022?
       ___________________________________________________________________
        
       Ask HN: How do you deploy your weekend project in 2022?
        
       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
        
       Author : bitgif
       Score  : 23 points
       Date   : 2022-09-09 17:04 UTC (5 hours ago)
        
       | korostelevm wrote:
       | Only does Node.js currently but check out https://www.cyclic.sh.
       | AWS DynamoDB is included in free tier
        
       | idmontie wrote:
       | 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.
        
       | freeqaz wrote:
       | 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)
        
       | phpthrowaway99 wrote:
       | Namecheap shared hosting, cpanel, php, myphpadmin for MySQL
       | admin.
        
       | vasergen wrote:
       | 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.
        
       | MacsHeadroom wrote:
       | 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.
        
       | verdverm wrote:
       | 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
        
       | bko wrote:
       | 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
        
       | quantumOctopus wrote:
       | Been having good expense with momgodb app services, pretty
       | flexible if you don't know which direction your project will take
        
       | reducesuffering wrote:
       | Compute / VPS: Railway, Render, Fly.io, Dokku on any VPS
       | 
       | Managed DB: Railway, Render, Planetscale, Supabase
        
       | napsterbr wrote:
       | 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.
        
       | slt2021 wrote:
       | managed hosting from godaddy.com is all you will ever need for
       | this kind of scale
        
       | matus_congrady wrote:
       | 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)
        
       | e9 wrote:
        
       | 1776smithadam wrote:
       | 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.
        
       | rhn_mk1 wrote:
       | Typically, something like make && ./start
       | 
       | If it's a daemon, I write a systemd service file.
        
       | oxff wrote:
       | flyio since Heroku had the little accident, works for me
        
       | derkoe wrote:
       | 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.
        
       | hilti wrote:
       | 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.
        
       | nocommandline wrote:
       | 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
        
       | thegabez wrote:
       | Rails, Heroku, and Cloudflare. Very easy, but costs are rising.
        
       | nathants wrote:
       | 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
        
       ___________________________________________________________________
       (page generated 2022-09-09 23:02 UTC)