Hacker News new | past | comments | ask | show | jobs | submit login

I'm thankful to have started programming in PHP when I first started doing web work for this reason. Shared mutable state is (almost always) bad and virtually everything I've built after that (on any stack) follows similar rules around per-request isolation because of the patterns PHP instilled in me.

Not only does this reduce (1) the likelihood of correctness issues, but it also dramatically reduces (2) deployment complexity because you don't need to migrate a bunch of in-memory state distributed across web backends. Your servers should all be considered dispensable.

In 2020, I tend to bias towards things like AWS lambda for this reason (for low volume applications). By default, there's no guarantee on the lifetime of the serving process and any unhandled exception recycles the process so you're never in an unknown (bad) state. There are of course performance downsides to this (particularly when it comes to pooling connections for things like Postgres), but once you figure that out things are generally smooth sailing.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: