5 ms·
The article talks about the difference between laptop vs server, but no other comments here so far have really touched on that topic. I think this post isn't ab
by godot 6y ago
The article talks about the difference between laptop vs server, but no other comments here so far have really touched on that topic. I think this post isn't about how good or bad cloud/VPS servers are, but really about difference between running on laptop vs servers.
It seems starting around maybe 2012~13, devs in the tech industry started moving from Windows laptops to Macbooks in large scale, and this was when it became much more common to run your server stack locally on the laptop. This was really strange to me at first; since prior to this, I was very used to having "dev servers". I came from LAMP world where we'd write code on Windows, upload code to a dev server, run the app on it and test. This seems very amateur in retrospect, but I also worked in a relatively large unicorn at the time (from 2008 to 2013) and I don't think we were even the only company doing that -- from what I knew, this was pretty much standard practice, especially if you run LAMP stack. Which is to say, it was way more common back in the days to dev on a dev server than on their own laptop. (Maybe that's a point against Windows at the time; about how difficult it was to have a reasonable local dev environment on Windows.)
So when I joined a startup later, and found out how everyone on the team had Macbooks (with no option of going Windows), and everyone ran the entire server app on their laptops (and this was the nodejs world, no longer LAMP), I was almost in disbelief -- are we not to worry about any difference between developing, testing and running this server code on a Mac laptop, vs when deploying it and have it actually run on a Linux server later? After a short while it seemed like it was not really a concern; it seems perhaps either macOS linux is close enough to servers, or node is compatible/high-level enough between mac and linux.
Reading this article is kind of a wake-up call -- no, it's really not exactly the same.
- wmf 6y agoAnother thing is that if you're using Node.js (or worse, Ruby or Python), your code is so inefficient that you probably don't care about performance differences; just throw more dynos at it.
- jinglebells 6y agoIsn't that the argument for Node or Python? You can get a damn powerful VM for the same monthly cost as 1 developer day?
- skrtskrt 6y agoI can see Go slowly eating Python's lunch for web services here. It's close to Python's productivity and much less resource-hungry while being more performant for many use cases. Go still has a way to go in terms of productivity-boosting frameworks in comparison to Python though. I hate the tight coupling of and patterns of Django but if I had to spin up a company in a month, there's no doubt I would do it Django. Lots of people will say "frameworks are an anti-pattern in Go" and I generally agree with the sentiment of writing boilerplate to stitch together various libraries > giving control to the framework. Still, some people want big hefty, quick-to-production frameworks with everything & the kitchen sink built in. I'm certain we will see those come into existence for Go.
- jinglebells 6y agoI like Go and Elixir from the minimalist approach but I've delivered so many projects recently by using Django and Django Rest Framework with a React front-end simply because you get ORM, Admin, form validation etc out of the box. In a couple of days you can have a production-ready site and I've never seen anything quite like it for productivity.
- skrtskrt 6y agoYeah I think probably the biggest accelerating factor is out of the box user account & auth management. That gives you a huge leap from “hey my app works” to “I can literally deploy this to the public right now”. The models and rest framework are convenient but you could probably do the same in close to the same amount of time in another language or framework.
- bouke 6y agoAlso when everything is running locally people tend to forget network latency and the cost of additional roundtrips. This comes at a high price when for example doing lots of database queries or waiting on a majority confirmation of a clustered transaction. Another problem with developing locally is that the dev is the only simultaneous user, and doesn’t have to share the resources with other users. I guess the takeaway is to always validate your assumptions through measurements like profiling etc.
- fetbaffe 6y agoThing is that the dev servers of the past was never equal in setup of the prod servers, difference in software versions, failovers, proxies, crons, backups etc, that was just a lie that was told. In my opinion is is much better to develop a cross platform/environment product that can work everywhere and the key to that is to avoid assumptions about where the product is executing. In the long run, this makes your software much more flexible.
- steerablesafe 6y agoThere is a significant difference between "works everywhere" and "works everywhere efficiently". For the former you can get away with just writing portable code. For the latter you basically have to benchmark everywhere. Performance is a hell of a leaky abstraction.
- fetbaffe 6y agoYes, that is why it is futile to try to have an exact copy of the production server because the smallest difference will ruin your performance profiling, to be absolutely sure you have to do the profiling on the production server itself. Usually every developer has their own login user on the development machine, but that is enough to skew performance profiling, because usernames populates environment variables & that will change memory layout of any program that the shell executes.
- steerablesafe 6y agoIf memory layout changes due to environment variables significantly changes performance characteristics then it looks like an opportunity to optimize this aspect of loading a binary. I assume cache alignment is in play here.
- fetbaffe 6y agoGood video on the topic https://youtu.be/r-TLSBdHe1A https://youtu.be/r-TLSBdHe1A
- christophilus 6y agoI always ran my code locally on Windows, too, and never had a dev server. I had staging and test servers, but not a dev server. I can't imagine working that way. I like to make a change and see it instantly.
- saurik 6y agomacOS is also just really different from Linux... it is madness to me that people run so much code on their local laptops and then expect it to work in production <- and I say this both as someone who long felt t was ridiculous to do that at all and now as someone who started doing it myself, got addicted, and just found a serious bug in libwebrtc of all things that only manifests on Linux.
- zeveb 6y ago> It seems starting around maybe 2012~13, devs in the tech industry started moving from Windows laptops to Macbooks in large scale I really doubt it has been that recent — I think the Great Migration to Macs started a decade earlier. Meanwhile, a lot of us have been developing on Linux and deploying on Linux even longer still. Heck, that's a good part of how Linux got popular, although once upon a time it was develop on Linux in order to deploy on Solaris or HP-UX (or even AIX)!