Live data from Hacker News

Ask HN: While developing, do you run all the dependent services on your machine?

news.ycombinator.com

1–10 of 16 posts

Ask HN: While developing, do you run all the dependent services on your machine?

#1
Development requires running many dependent services, like databases, caching servers, queues, other dependent (micro) services etc. Do you run them on your machine? Or you use other server infrastructure to run them while only running the specific service you are developing on your machine? How do you enforce consistent dev environment across your team mates?

Re: Ask HN: While developing, do you run all the dependent services on your machine?

#2
Yes, mostly I do. And I have not yet needed Docker to do this, though many people have argued that this is what Docker is for. I tried to point out how empty that argument was in "Docker is the dangerous gamble which we will regret":

http://www.smashcompany.com/technology/docker-is-a-dangerous...

When I need to run multiple database, or want a database with a copy of production data, then sometimes we run that remotely. Running a few servers that all developers can use seemed to be standard practice 10 years ago, but the practice seems to be in retreat, replaced by the notion of "Use Docker to run every service on your own machine." But I have not seen that Docker actually makes that easy to do, and if your team has a full-time devops person who can spin up some extra machines, then usually it saves the whole team a lot of time to simply rely on a few central servers that the devops person has set up for development.

Re: Ask HN: While developing, do you run all the dependent services on your machine?

#4
post #2

Yes, mostly I do. And I have not yet needed Docker to do this, though many people have argued that this is what Docker is for. I tried to point out how empty that argument was in "Docker is the dangerous gamble which we will regret": http://www.smashcompany.com/technology/docker-is-a-dangerous... When I need to run multiple database, or want a database with a copy of production data, then sometimes we run that remote…

Any thoughts how to enforce consistent dev environment among the team mates?

Re: Ask HN: While developing, do you run all the dependent services on your machine?

#5
post #2

Yes, mostly I do. And I have not yet needed Docker to do this, though many people have argued that this is what Docker is for. I tried to point out how empty that argument was in "Docker is the dangerous gamble which we will regret": http://www.smashcompany.com/technology/docker-is-a-dangerous... When I need to run multiple database, or want a database with a copy of production data, then sometimes we run that remote…

> I have not seen that Docker actually makes that easy to do

docker-compose up -d

What’s not easy about that?

Re: Ask HN: While developing, do you run all the dependent services on your machine?

#6
At a previous company, we had a project so large that you could only run portions of it locally. For everything else, we had ansible scripts to create and deploy to an AWS instance. Then, you could use SSH port forwarding to have those pieces available to your machine, as well as JMX ports for debugging those other parts, if need be.

Re: Ask HN: While developing, do you run all the dependent services on your machine?

#7
Last job: small web app with app servers, queue, workers, database. Plausible to run this all on one machine while hacking on one or more parts. After we migrated to AWS we made it easy for devs to launch a new isolated copy of the whole environment in EC2. Define cloud formation templates & scripts to boot the whole stack. If you need a database in a well defined state, automate that too (ideally build the schema and initial data from scratch using automated process, failing that, start with a snapshot/backup then run schema migrations on it)

Current job: there's about 10-20x as many integration points with downstream services, many of them owned by other teams. No investment in making it possible to spin up isolated service graph on a dev machine. Heavy use of persistent shared testing environments in company data centre, these environments usually in one or more state of brokenness. Some use of mountebank to replace troublesome downstream services with stubs returning canned data.

Re: Ask HN: While developing, do you run all the dependent services on your machine?

#8
post #2

Yes, mostly I do. And I have not yet needed Docker to do this, though many people have argued that this is what Docker is for. I tried to point out how empty that argument was in "Docker is the dangerous gamble which we will regret": http://www.smashcompany.com/technology/docker-is-a-dangerous... When I need to run multiple database, or want a database with a copy of production data, then sometimes we run that remote…

> I have not seen that Docker actually makes that easy to do docker-compose up -d What’s not easy about that?

Go here:

http://www.smashcompany.com/technology/docker-protects-a-pro...

And then scroll down to where you see this:

UPDATE 2018-07-09

And read that Slack conversation. That is a real conversation that actually happened. We lost 3 days trying to fix that bug, which in the end was a complex interplay of the Docker cache and the way the Dockerfile was written.

This is the sales pitch for Docker:

docker-compose up -d

But that Slack conversation is the reality.

Re: Ask HN: While developing, do you run all the dependent services on your machine?

#9
post #2

Yes, mostly I do. And I have not yet needed Docker to do this, though many people have argued that this is what Docker is for. I tried to point out how empty that argument was in "Docker is the dangerous gamble which we will regret": http://www.smashcompany.com/technology/docker-is-a-dangerous... When I need to run multiple database, or want a database with a copy of production data, then sometimes we run that remote…

> I have not seen that Docker actually makes that easy to do docker-compose up -d What’s not easy about that?

It's slow feedback loop when developing / testing / debugging. This of course depends on your tech stack, with dynamic language such as NodeJS it is actually quite good as you can just mount your code base to the container and when you edit files they are reloaded automatically.

However if your application docker container requires compilation and you need to restart docker compose once you make changes to the codebase (and/or want to run integration tests), the whole docker compose flow might add an extra minute or two to your feedback loop and slow down development.

In those cases I'd rather run everything locally (still would include docker-compose.yaml file for developers who prefer that and are not comfortable running all required services locally).

Developing Go applications I have found my development flow much more agile without docker, docker was decreasing my productivity a bit so I stopped using it.

Our current integration test suite runs entirely through docker compose flow normally (in the CI or locally) but launching the integration test suite outside of docker, if you have all dependencies running locally, is quite faster and saves a lot of time, thus increasing my productivity.

Re: Ask HN: While developing, do you run all the dependent services on your machine?

#10
If those services are made by me or my team, I would usually run them on my machine. However, if they are made by a different team, I usually create a mock server of sorts to be able to run it locally with no dependencies for most of the dev. This allows my team to not be dependant on other teams. My flow is usually to work on this mocked server while I develop a feature, and then before making a pull request testing on the real thing. I found a good 70% of the dev work I do can be done in those conditions. Of course, that's something you'll be able to pull on a greenfield project, not on an existing giant codebase with billions of API.
Post reply on HN