Live data from Hacker News

Ask HN: Solo-preneurs, how do you DevOps to save time?

news.ycombinator.com

71–80 of 328 posts

Re: Ask HN: Solo-preneurs, how do you DevOps to save time?

#71
> CI

GitHub Actions

> deployments/rollbacks

Docker. Scaleway offers a container registry that's ridiculously cheap[1]. Deployments are infrequent and executed manually.

> DBs

Again, Scaleway's managed RDS[2].

Outside these, we have setup Grafana + Loki cloud[3] for monitoring and alerting. They have a generous free plan.

For product analytics that can be derived from our database we've a self hosted instance of Metabase[4].

[1]: https://www.scaleway.com/en/container-registry/

[2]: https://www.scaleway.com/en/database/

[3]: https://grafana.com/

[4]: https://www.metabase.com/

P.S. We were a 1 person company when most of this was setup. We're 3 now, works just as well.

Re: Ask HN: Solo-preneurs, how do you DevOps to save time?

#72
post #57

I scaled to millions of users as a solo founder and still run the whole show myself. AMA if you like. Here is what works for me: CI: From the terminal, I run my tests and commit to git. Deployments: rsync Rollbacks: Never did one. If something breaks, I fix it and rsync the fix to production. DB: MariaDB k8s: I don't use it. Computers are very fast these days. A cheap single VPS will get you a long way. Nightmare: No…

Best comment so far. Thank you for being specific and to the point.

Re: Ask HN: Solo-preneurs, how do you DevOps to save time?

#73
Use Linux, pretend you’re in the 90s/2000s. If you can’t afford a team, you’re too small to need more.

- Use NFS (EFS), put builds in a /releases folder

- Bash scripts for build, deploy, release

- Bash scripts to wrap apps (write pidfile, start, stop, etc)

- Cron those scripts

- Check crontabs into a repo along with all other config

- Cron a bash script to pull from that repo and update crontabs on every box

- Have a staging environment, deploy stuff there (esp DB migrations) and do smoke tests.

- Have some kind of monitoring (I have a slackbot that sends me messages when things break)

I general I follow the principle of proportional response, and n=2 (or 3 depending on how trivial the task is to automate).

Proportional response means you invest in automation / tooling proportional to the pain you have suffered. Burning a day to build a bulletproof script only makes sense to solve a big problem. For a smaller issue, maybe adding a debug line or writing a line somewhere that you can copy-paste later is good enough.

N=2 means you don’t solve stuff until the second time you need it. This stops you from burning hours building clueless complex garbage to solve unnecessary problems - at least by the time you are automating, you have solved it once or twice by hand and you know where you are going.

Elon’s 5 principles have been very useful to me as a solo dev:

1. Make requirements less stupid

2. Delete the part/requirement

3. Simplify/Improve the design

4. Accelerate cycle time

5. Automate

So in particular you might try 1-4 to see if you can magic problems away before you invest in building devops automation you will then need to maintain.

Re: Ask HN: Solo-preneurs, how do you DevOps to save time?

#75
Having 90% of the system in a single Cloudformation template worked pretty well for me.

On every stage (dev, test, prod) I can deploy it automatically up to two times (blue and green) by running a simple shell script. So when I update the application I just deploy it another time on prod, test it one last time by adding the IP of the load balancer in my local hosts file and if I'm satisfied with the result switching the DNS entry to the new version using a weighted DNS record with the ability to switch back until I shut down the old version.

Doing anything continuous doesn't feel worth it in such a small setup with one update every 1-3 months.

What I like most about the approach is that I'm free to change any aspect in the main template without any risk to break something in the live application. Only changes to the elements shared between versions need to be handled carefully.

The main template includes VPC, network, fargate service, loadbalancer, firewall, KMS, DNS records, access rights, database tables, queues, monitoring metrics, email alerts

It excludes everything that is shared from update to update which are defined separately and just referenced from the main template such as some database tables, persistent storage container registry, user groups (Only the groups, not the rights assigned to them)

Re: Ask HN: Solo-preneurs, how do you DevOps to save time?

#76

> CI GitHub Actions > deployments/rollbacks Docker. Scaleway offers a container registry that's ridiculously cheap[1]. Deployments are infrequent and executed manually. > DBs Again, Scaleway's managed RDS[2]. Outside these, we have setup Grafana + Loki cloud[3] for monitoring and alerting. They have a generous free plan. For product analytics that can be derived from our database we've a self hosted instance of Metab…

Thanks for being specific.

Re: Ask HN: Solo-preneurs, how do you DevOps to save time?

#77
post #68

I have no idea why there's nothing here saying "don't". Go and get a Heroku account, hook it up to your Github repository's master branch for deploys, use Github Actions for CI, and then get on with life. Yes, you'll pay more for a Heroku Postgres instance than you would for a VPS on Digital Ocean with Postgres running on it, likewise you'll pay more for Heroku Dynos than another VPS to run your application server. O…

I really like Heroku, when I work on NodeJS projects. BUT: In the last year I've had some rather serious downtime issues that were 100% Heroku's fault . (Poor encapsulation of Postgres configuration via the connection string, and they mistakenly claimed that I violated their TOS when I didn't. They apologized and fixed the situation.) I'd really like to see some good alternatives to Heroku. Not just because of their…

which languages do you want to work on?

Re: Ask HN: Solo-preneurs, how do you DevOps to save time?

#78
I personally like k8s a lot, but my general approach is to fake it until you make it and only add things once it's clear why I need them.

I have a few old boxes that run VMs. Some of these VMs make up a virtual k8s cluster, but almost everything I need runs on bare VMs rather than on k8s.

When I find something particularly annoying to administer, I move it off a bare VM and onto k8s.

The main thing this gives me is a migration path off of "a bunch of custom shell scripts" toward something I believe will be useful in the long run.

A bunch of shell scripts and rsync will work for a long time until they don't. And when they stop working you'll be in for some pain.

Re: Ask HN: Solo-preneurs, how do you DevOps to save time?

#79
Not solo but I head a tiny tech team (4 engineers) so we don't have bandwidth for DevOps stuff. Here's our current state.

We are all in on AWS.

0. Tech stack: NodeJS, React, RDS Aurora, Redis, S3, Route 53, SES, Lambda and a few more.

1. 3 EC2 machines behind an ELB. Deployment is scp + cd + ./deploy.sh prod

2. Aurora takes care of everything around DB for us. Backup, read/write replica etc., etc.,

3. No CI; our development cycle isn't rapid enough to warrant investing in CI.

4. We recently moved some of long running tasks to Lambda. There's definitely a big value here so we'll invest further on it.

5. Also, recently, we experimented with an internal service on "ALB + AWS Lambda"; it's a sweet combination so we'll invest further.

6. Frontend is hosted on AWS Amplify. It's an underrated nifty service; highly recommend it.

7. Datadog is for monitoring. It's quite good but a bit expensive.

I can tell you from my experience that CI, auto-rollback etc., are overrated for smallish teams given their development velocity. Even if you have to do once or twice a deployments per week you can do it manually, don't need to wade into the CI territory. And unless you have prior experience steer clear of k8s.

Re: Ask HN: Solo-preneurs, how do you DevOps to save time?

#80
Talking about myself, as a python dev:

- cheap VPS for hosting, postgres for the db, nginx as a proxy, redis for everything else, including caching.

- deploy python projects by packing them as zipapp with shiv, then use fabric to ssh and performs any migrations necessary. No, not even ansible.

- build, lint, format and test, like all automatizable stuff, are made using pydoit. If you are solo, you don't need a CI service. Your laptop is the CI machine.

Scaling is always the same story:

1 - start with the cheapest VPS possible. This will force you to code with some constraints. Not crazy, just enough to balance it out.

2 - once you start seing your load average rising, just move the db on a second cheap VPS. You just tripled the load you can sustain. Not doubled, tripled. Most solo projects will stop here actually.

3 - wait again, collect some perfs data when you see the site starting to be slow. Check for slow queries, code hot paths, etc. Optimize that, add some cache, setup tasks queues. Use cron to purge / regenerate cache if you need to smooth out the curve. Maybe slap some varnish for extra peps, or just cloudflare.

4 - now you got what looks like a real load, and a more realistic code base, so when you peak again, request more perfs for your server, or migrate to another bigger one. You can scale vertically to crazy highs nowadays. Really, really crazy. You can get terabytes of RAM, 64 cores servers, etc. At your current scale, your service should generate enough money to pay 10 times for it anyway. But you probably won't need to. Even cheap servers are beast, look at the current leaseweb offer: https://www.leaseweb.com/dedicated-servers#NL

For €320.09 per month, you get:

    2x 16 cores 2.30GHz
    28GB DDR4
    4x960GB SSD
    30 TB traffic
To put it in context, myspace used to serve all its users with 2 servers only, until they reached 500,000 accounts. Only then it was too much. This was with hardware (and price!) in the years 200x.

5 - you will probably never reach this point. This is the point where kubs, load balancers, sharing, etc. start to be interesting.

How to preserve your data:

- Raid

- Dump the db with a _randomized_ cron

- rsync the dump and all assets. You can do it to another server, or just your laptop at the beginning.

You can get fancy with database replication if you want, or use backups that stream in real time.

But there is one trick: not all data are equal. Identify some data in your db that you can't afford to lose, and make sure this one is saved separately and very regularly while being given priority. There are plenty of data, if you have a hole in it, most people don't care. E.G: if 1 tweet out of million from 10 years ago is missing, do you think it affects the service?

Monitoring:

- Sentry

That's all. It's free (or cheap), and for a small service, you don't need real time. It's ok to be down a few hours once a month for most services at first. I have a service with 700k unique users a day, it still goes down sometimes. It's a blip.

Sometimes, log into the servers, run htop and checks what's up. You can install open telemetry later if you really need to, but for now, even HN hug is not going to kill you.

Summary:

- Modern software and hardware are amazing. Max them out. Horizontal scaling is hard, and expensive.

- You don't need a perfect service. Unless you are handling patient cancer data, that is. Don't worry about perfect uptime, 0 data loss, etc. If you are a solo dev, the cost for that is huge. Just do 97% right⋅

- what worked 20 years ago still work today, and will likely be there tomorrow. And you can move from that to the cloud later. The reverse is not that nice.

Post reply on HN