News for hackers. Stuff that matters.
Re:Don't Make My Mistakes: Common Infrastructure Errors I've... by karmakaze on Friday December 03, 2021 @05:59PM (#29436689)
I was hoping this would've been a more surprising list, but it was titled 'common'.

> Don't migrate an application from the datacenter to the cloud

Good advice that follows the pattern of don't do a rewrite with a plan to cut-over. Instead make two and gradually transition to the newer one.

> Don't write your own secrets system

Follow-on to 'don't do your own crypto'

> Don't run your own Kubernetes cluster > Are you a Fortune 100 company? If no, then don't do it.

> Don't Design for Multiple Cloud Providers

This seems like an extension of YAGNI. If you're not using it, don't build it. If you really will need it, use it as you're building it. A good example is if you're doing multi-datacentre redundancy using standard tech, it might be worthwhile to do multi-cloud. But have an actual threat model in mind that this mitigates, e.g. cloud provider 'A' may become a conflict-of-interest competitor in the foreseeable future.

> Don't let alerts grow unbounded

> Don't write internal cli tools in python > Nobody knows how to correctly install and package Python apps. If you write an internal tool in Python, it either needs to be totally portable or just write it in Go or Rust. Save yourself a lot of heartache as people struggle to install the right thing.

+1 This one rarely gets mentioned.

One that I would add, that I haven't experienced but can certainly foresee is "don't switch major datastores". Switching between MySQL and PostgreSQL might be rough but doable. Switching between MySQL and CockroachDB for a large, heavily-used app could stall developing new features for a long time or make everything take 5x longer. The reason isn't the query syntax, it's the query characteristics. Using a std rdbms gives you the ability to do many relatively quick round-trip queries (though you should avoid N+1's) some can be tolerated. A distributed DB can have high throughput but will have high latency for simple queries.

Re:Don't Make My Mistakes: Common Infrastructure Errors I've... by claytonjy on Saturday December 04, 2021 @10:37PM (#29446499)
I get what you mean with the Python tools, but I've had a good experience distributing tools with an internal pypi and pipx. Then users do "pipx install <package>" from the README, voila, commands work.

At that point I think it's pretty competitive with "go get". In both cases users have to install one thing, then use it to get your thing.

Haven't seen an internal rust tool yet.

Re:Don't Make My Mistakes: Common Infrastructure Errors I've... by jasonhansel on Saturday December 04, 2021 @11:03PM (#29446600)
IMHO real answer isn't to use "go get" instead of "pipx install"; the answer is to use Go to build statically-linked binaries and then to distribute those binaries with an OS-level, language-agnostic package manager (e.g. Homebrew or apt-get).
Re:Don't Make My Mistakes: Common Infrastructure Errors I've... by da39a3ee on Sunday December 05, 2021 @06:21AM (#29448453)
Why do you need a package manager if you have a statically linked executable? Can't you just save it in ~/bin and have that in PATH? (Users who can't do that shouldn't be using CLI would be the argument I guess.)
Re:Don't Make My Mistakes: Common Infrastructure Errors I've... by afarrell on Sunday December 05, 2021 @07:48AM (#29448869)
So that people can install and update the tools via the same habits they’ve already learned.

> Users who can’t do that shouldn’t be using CLI

Users who can do that will still find it an odd departure from convention.

Re:Don't Make My Mistakes: Common Infrastructure Errors I've... by chakspak on Saturday December 04, 2021 @11:27PM (#29446682)
I second having an internal PyPI. Not requiring your customers to build your platform wheels for you simplifies Python distribution quite a bit.

It'll never be as clean as a static binary build, but it saves us from having to build out two language ecosystems when the rest of the company uses Python for everything.

Re:Don't Make My Mistakes: Common Infrastructure Errors I've... by unbanned on Sunday December 05, 2021 @02:53AM (#29447597)
And when your client has a slightly different python install or some other library which deps on an older incompatible version of a lib... Then what?

Python is awful for this stuff

Re:Don't Make My Mistakes: Common Infrastructure Errors I've... by chakspak on Sunday December 05, 2021 @03:32AM (#29447737)
Don't disagree. It's a problem. As the parent poster and others have mentioned, you can use something like pipx, or bare virtualenv. At least once I've deployed via dh-virtualenv and rpmvenv, pyinstaller, cx_freeze, or tested for compatibility with the system Python if I could control for the client machines.

It's never fun. It's never pleasant. But to be fair, if I have a CLI tool that needs a deployed SSH client, or Tensorflow, or SDL or Qt or something else, I'm not convinced packaging gets much easier no matter what language we're talking about. If your use case is simple, Python is easy enough to deploy, and Go is even easier. If you can't disable CGO or need a third party component, I imagine the fun is just getting started anyway.

As a counterpoint, awhile back, discovered that Golang had a minimum kernel version requirement. That pretty much eliminated it as a possibility for writing tools for legacy systems. Python was viable though, Bash moreso. :) Couldn't tell you if that was still a requirement for Go today.

Re:Don't Make My Mistakes: Common Infrastructure Errors I've... by karmakaze on Sunday December 05, 2021 @01:23PM (#29451443)
All good comments. I should have noted that my comment was not regarding Python (which I have little real-world use) and meant to apply more generally to utility or in-house tooling should be as easy to install and use as possible. Being that it's not the main focus of development, it will bitrot so anything you can do to guard against it is worthwhile, and a single compiled Go binary is hard to beat in that regard.
Re:Don't Make My Mistakes: Common Infrastructure Errors I've... by Cerium on Saturday December 04, 2021 @08:40PM (#29446026)
> Don't let alerts grow unbounded

This seems an infrastructure extension of treating compile warnings as errors.

Re:Don't Make My Mistakes: Common Infrastructure Errors I've... by astrange on Sunday December 05, 2021 @04:55AM (#29448065)
Which is probably a mistake when some warnings are compiler bugs and some are difficult-to-impossible to fix. Or if you don't control the compiler being used.
Re:Don't Make My Mistakes: Common Infrastructure Errors I've... by karmakaze on Sunday December 05, 2021 @01:17PM (#29451378)
That's why we have 'ignore' type annotations/pragmas/etc.
Re:Don't Make My Mistakes: Common Infrastructure Errors I've... by rixed on Sunday December 05, 2021 @12:37AM (#29447018)
"Page an engineer for any blip in the radar" is the equivalent of treating compile warnings as error.
Re:Don't Make My Mistakes: Common Infrastructure Errors I've... by Cerium on Sunday December 05, 2021 @10:24AM (#29449924)
If you as a company refuse to ignore the warnings your only choice is to drive them down to as low a level as possible which maximizes the value of future warnings.
Re:Don't Make My Mistakes: Common Infrastructure Errors I've... by throwawayboise on Saturday December 04, 2021 @11:16PM (#29446631)
> don't switch major datastores

Agree with you strongly. Also by committing to a database you can take advantage of things it does for you rather than trying to stay "generic" and portable. Pick a database (I like Postgres), and then wring everything you can out of it.