Better HN
topnewbestaskshowjobs
Log inSign up

physicles

1,822 karma · joined Feb 3, 2019 (7y ago) · 645 submissions

Submissions

comment 2y ago · link · parent

Others mentioned a parabola, which seems true to me. Imagine writing a database migration and not testing it. You could end up losing customer data, which is very expensive to "fix".

comment 2y ago · link · parent

Is that Jira config in a blog post somewhere? Imagine how many person-years of bureaucracy it would save.

comment 2y ago · link · parent

For a tool you run locally, a GPU could be an easy win. But most Go code is probably run on cloud servers. Adding requirements to your runtime environment isn't something to do lightly.

- SIMD: up to 400% speed boost, most likely on the same VMs you were already using

- GPU: orders of magnitude faster, but now you need to make sure your cloud servers have compatible GPUs attached

If you really do need crazy performance then it's worth it. If you're already stable and right-scaled and SIMD allows you to reduce your VM spend by 25%, then you probably just take the savings and move on.

comment 2y ago · link · parent

I agree with this in general, but his essay on functional programming in C++ (linked at the top of the page) is phenomenal and is fantastic general advice when working in any non-functional language.

comment 2y ago · link · parent

GOMEMLIMIT has really cut down on the amount of time I’ve had to spend worrying about the GC. I’d recommend it. Plus, if you’re using kubernetes or docker, you can automatically set it to the orchestrator-managed memory limit using something like https://github.com/KimMachineGun/automemlimit — no need to add any manual config at all.

comment 2y ago · link · parent

What kind of command was it?

If I’m doing something more involved, I’ve got a k9s window open in another pane, making sure the command is having the intended effect.

I guess the riskiest commands would be things like deleting persistent volumes. But our storage class doesn’t automatically clean up the disk in the cloud provider, so we could recover from that too.

comment 2y ago · link · parent

We’ve avoided that situation with kustomize. Common resources go into a ‘bases’ directory, and if two clusters have identical resources, then they both have their own directories and reference all the base resources from there.

In practice, there are always slight differences between cluster config between test and prod (using different S3 buckets, for example) so this is needed anyway.

comment 2y ago · link · parent

Yep. Direnv inserts itself into your prompt function.

comment 2y ago · link · parent

Check out direnv, and use a shell alias for kubectl. And yeah, current context is evil.

comment 2y ago · link · parent

We’ve basically solved this where I work, with these steps:

- Each environment gets its own directory. We use kustomize to share config between environments.

- direnv “sets” the current context when you cd under a cluster’s directory (it sets an environment variable that a kubectl alias uses. Nobody calls kubectl directly; it wouldn’t work because we’ve banned the current context from the yaml files). You switch clusters by changing to that cluster’s directory.

- most of the time, the only command you run is ‘make’ which just does kubectl kustomize apply (or whatever). 100% of cluster config is checked into git (with git-crypt for secrets), so the worst that can happen is that you reapply something that’s already there.

I’ve also colored the command prompt according to the current cluster.

But anyway it’s essentially impossible to apply a config change to the wrong cluster. I haven’t worried about this in years.

comment 2y ago · link · parent

Didn't know about Perses. Looks promising! I've had one foot out the door with Grafana for a couple years -- always felt heavy and not-quite-there (especially the Loki log explorer), and IMHO they made alerts far less usable with the redesign in version 8.

comment 2y ago · link · parent

I feel like if you have to display UUIDs in your app’s UI, you’ve already lost. Copy to clipboard should hopefully be enough.

comment 2y ago · link · parent

I've also taken UUIDs and re-encoded them as base58. Works fine.

comment 2y ago · link · parent

Uggh, I was cornered into writing a couple of these over the years. The way I handled it was:

1. make sure both operations will be retried if they don't run to completion, and

2. think through how the rest of the system would react to one of them being present without the other

Then I use whichever of the two orderings is less bad from the perspective of #2. Obviously this depends on the exact use case -- I was simply lucky that the rest of the system was designed in such a way that it could tolerate that bad intermediate state.

comment 2y ago · link · parent

We do this, but with k3s instead of docker compose (it’s a wonderful single-box substitute for full k8s), and a developer starts by building the relevant container images locally. If everything works, it takes about 3 minutes to get to a working environment with about a dozen services.

We steer clear of proprietary cloud services. In place of S3, we use minio.

The one sore spot I haven’t been able to solve yet is interactive debugging. k8s pushes you toward a model where all services need a pile of environment variables to run, so setting these up is pretty painful. In practice, though, all rapid iteration happens inside unit tests, so not having interactive debugging isn’t much of a productivity drag.

comment 2y ago · link · parent

Agreed. I've also heard this stated as:

> for each desired change, make the change easy (warning: this may be hard), then make the easy change"

(earliest source I could find is @KentBeck on X)

I love the idea of that vocabulary of tools and libraries, too. I strongly resist attempts to add to or complicate it unnecessarily.

comment 2y ago · link · parent

When I worked on Windows Phone during the good ol' days, my team used this for a sort of retail mode assert, for situations that really shouldn't happen. Instantly recognizable. The definition went something like this:

// This is a shout out to that 80s hit. You know the one.

#define E_JENNY_JENNY_WHO_CAN_I_TURN_TO 0x88675309

The 1 in bit 31 was required to signify that it's a Win32 error code. The other high bits are essentially a namespace, which we used correctly for all our other error codes.

comment 2y ago · link · parent

The trick is knowing which of these two solutions to apply at the time.

comment 2y ago · link · parent

K8s does solve a huge set of problems. But I agree with GP that all the non-application-specific parts on top, especially observability, are a huge time sink. The industry could use a Rails for the cloud. We built ours from the ground up and we’re in a good place now, but we kind of had to reverse engineer things like logging requirements from security questionnaires. I suppose these are things that consultants and saas companies can charge a lot of money for, so there’s no desire to open source it.

comment 2y ago · link · parent

Reproducibility is one of the things we got with containers and k8s (and before that, 12-factor apps). I run k3s on my laptop with a minified stack, which is good enough to mimic nearly any behavior on prod.

Cloud-specific saas (like proprietary databases and AWS lambda) are awful for this though, and we avoid them where possible. Our S3 code was a bug farm until I discovered minio. Now we’re stuck with Snowflake because scale and speed, but the fact that I can’t iterate fast locally has caused me to lose days of my life that I’ll never get back. Hoping I can hack something together with duckdb when I get time.

comment 2y ago · link · parent

Agreed. If we didn’t use kubernetes, we’d have to reimplement a bunch of its features. Back when we were getting started I tried docker swarm because it was supposed to be simpler, but I had weird issues with its networking.

The best part is multiple environments. I can run our full stack on my laptop with k3s and one call to make. We use the same yaml (with kustomize) for all three cloud environments.

It feels pretty boring, which is fantastic.

comment 2y ago · link · parent

Thanks, much appreciated! Any ideas how to kick start that shakeup? Hackathons on devops or proceeds stuff? Brainstorming? Consultants?

comment 2y ago · link · parent

Yeah I’ve got about five ideas for refactors that will make my life noticeably better. I’ve been pondering some of them for more than a year, slowly improving the design, but I’m still waiting for the right time when the ROI is higher.

comment 2y ago · link · parent

I’m lucky that I don’t have a boss like this, but I’ve asked myself this question recently. I’ve been with the same company for almost eight years working on the same code base, which I and another dev greenfielded. I know it very, very well.

I’m often dismayed at how long things seem to take these days compared to when we first started out. Am I getting slower? Lazier? So far, I’ve identified the following factors:

- We have more customers, and those customers are much more demanding (used to be b2c, now we’re b2b). The cost of making a mistake is much higher.

- It’s just a lot of code. Parts of it are fairly complex, as much as I try to keep it simple. When a core component is changed, multiple services might need refactoring.

- We have many more features, and they sometimes interact in surprising ways. I’ve been around longer than our product people, so we often have to spend time iterating when they come up with a design that doesn’t fit with what’s already there.

- It’s important to refactor your database from time to time as you learn more about the domain and find simpler ways to do things. But refactoring a database is terrifying. I spend a lot of time triple-checking my work.

Working on such a large code base for years is super satisfying though. I’ve learned so much about system design, just from noticing how easy or hard stuff is to maintain.

comment 2y ago · link · parent

I recently needed to make a change in how something common is done across several services. I made the change in one place (and have some passing unit tests), but then I realized that I’d have to duplicate more code than I’d like. So I’ll take a couple days to pull all related functionality out into a shared library.

This refactoring could’ve been done ages ago — there’s already some messy and duplicate code there — but now’s the perfect time to do it because 1) I’m already touching and destabilizing that area of the product, and 2) the clearer, de-duplicated code will be easier to spot check.

comment 2y ago · link · parent

Those stupid, immoral things that the author did at 17 were also done on purpose. The mistake is in the reasoning that led to the decision to do the action.

Pai's mistake was _deciding_ to commit research fraud, and then doing it.

comment 2y ago · link · parent

Came here to post this comment. It's a common misconception even among people who sort of know how GPS works.

comment 2y ago · link · parent

> how much conventional wisdom in the software world was not necessary or true.

Do you remember any specifics?

I’m also curious how their tooling made them so much more productive. Were the tools just really well designed, or did they integrate perfectly with each other?

comment 2y ago · link · parent

> Second, all changes must be rooted in respect for existing usage and users

This is one of the reasons I love working in Go. I feel that the language maintainers understand that people using Go have more important work to do than update their code to whatever the new hotness is this month.

Basically the opposite of this: https://steve-yegge.medium.com/dear-google-cloud-your-deprec...

comment 2y ago · link · parent

It’s like SpaceX’s development process. Step 1: “make your requirements less dumb”
1
8910
22