Live data from Hacker News

Docker, Django, Traefik, and IntercoolerJS: My go-to stack for building a SaaS

simplecto.com

281–290 of 347 posts

Re: Docker, Django, Traefik, and IntercoolerJS: My go-to stack for building a SaaS

#281
post #232

I don't get why people use Docker for "small SaaS apps" where "scale is not an issue". You can run everything without Docker to remove an extra level of indirection. I've been doing that exact thing with a very similar Django stack for years. Not once have I missed Docker. On the other hand, I have taken over SaaS projects where the (unnecessary) usage of Docker made it more expensive to host, decidedly more difficul…

I'm not trying to pick on you personally here but this comment, like many I see on HN, seems overly adversarial and could have made the same arguments in a less combatative way. There's a lot of emphasis on your own perspective: "*I* don't get", "*I've* been doing that", "Not once have *I* missed Docker", "making *me* less productive", "*my* personal experience*" And an assumption that it applies to others: "Just use…

Denigrating any subjective experience because it's "too direct" is bordering on passive aggressive. Every suggested edit you've made to the comment completely alters the meaning of the text: you're basically saying that if you're not looking to learn and completely disregard the veracity of your own experience in every statement you do, you're better off not saying anything at all.

It strikes me as exceedingly dishonest to pretend that you're genuinely interested in someone's opinion if you already know you strongly disagree with it, and it's by no means a requirement to lack an opinion to have a respectful debate. Telling someone that you believe they're wrong is not an insult.

People have subjective opinions and experiences, this does not necessarily make their statements true. This should be obvious and I don't see why it's the sender's responsibility to preface everything they say with that fact to avoid stepping on the toes of whoever reads it. Opinions don't kill debate, it furthers it.

Re: Docker, Django, Traefik, and IntercoolerJS: My go-to stack for building a SaaS

#282
post #232

I don't get why people use Docker for "small SaaS apps" where "scale is not an issue". You can run everything without Docker to remove an extra level of indirection. I've been doing that exact thing with a very similar Django stack for years. Not once have I missed Docker. On the other hand, I have taken over SaaS projects where the (unnecessary) usage of Docker made it more expensive to host, decidedly more difficul…

I'm not trying to pick on you personally here but this comment, like many I see on HN, seems overly adversarial and could have made the same arguments in a less combatative way. There's a lot of emphasis on your own perspective: "*I* don't get", "*I've* been doing that", "Not once have *I* missed Docker", "making *me* less productive", "*my* personal experience*" And an assumption that it applies to others: "Just use…

> If we all wrote like this (and I'm certainly not perfect myself), HN could be a much friendlier, more welcoming place.

This is a well-intentioned thought but I'm not sure it actually makes sense. The things that make or detract from HN being a friendly and welcoming place have a lot to do with its size and heterogeneity -- ideology included. You're trying to neuter the disagreement and rephrase it in terms of a question. That's not always a bad thing, but in some cases you really do just disagree. If that's going to be the case, why not be upfront about it, so long as you can be civil? (GP's point does seem to be phrased in a pretty civil manner IMO)

Re: Docker, Django, Traefik, and IntercoolerJS: My go-to stack for building a SaaS

#284
I'm not convinced this is a great approach.

Firstly, while dedicated servers are extremely good value (by my calculations they can be 100x cheaper for performance heavy workloads), for most SaaS they're not worth it due to operational requirements. I would, however, definitely look at them for cases where performance matters and the savings are really substanial, which for an early stage SaaS product, they aren't.

I'd recommend using Heroku level solutions over more complex stacks to start with. For most use cases it works great, scales easily and the provider takes care of loads of underlying stuff. This won't work when you have a lot of developers and many apps and services to run, but it's premature optimisation to do anything more than that at the start and often in my experience ends up causing downtime due to overly complex infrastructure. You don't even need to use Docker to start with.

Next, I definitely would not recommend hosting Postgres yourself at an early stage. Use a hosted provider for this! It's worth paying slightly more for someone else to manage one level of backups, the underlying OS and version patching for you! I have seen so many data loss incidents that wouldn't have happened on managed DB services. In one case it basically killed the business overnight.

Even worse, it is hard to scale if you get hit with a load of traffic unexpectedly. You will not be able to provision VMs, configure read replicas etc quickly enough if you suddenly get hit with a load of users from some news article or blog. If it is hosted you have autoscale which will handle this for you.

Finally - I would recommend using "CI/CD" from the start (I find it odd that maintaing CI is too much of a hassle, but running dedicated servers isn't!). Many reasons for this, but one is that you will be able to do small edits even from your phone (I'm not proposing big changes). Small copy changes for example - these can be really urgent but you may not have your laptop to hand. If you can edit source file and commit to SCM and have it build for you, it can get save your arse more than you'd think.

Re: Docker, Django, Traefik, and IntercoolerJS: My go-to stack for building a SaaS

#285
post #205

Docker, traefik and debian auto-update alone allow me to run all my side projects on a single semi-beefy machine i pay I like to try new JS technologies and those alone sometimes need different node versions - i would hate to spend time on these issues. My deployment is 2 lines: DOCKER_HOST=ssh://user@mydomain.com docker-compose up Did not have to touch it for years

How do you do the auto updates?

Probably unattended upgrades[1].

[1] https://wiki.debian.org/UnattendedUpgrades

Re: Docker, Django, Traefik, and IntercoolerJS: My go-to stack for building a SaaS

#286
I feel like an idiot reading these kinds of posts. If this is a “simple” stack, then I’ll be jiggered. Why do you need a “control plane” like ZeroTier? What problem does it solve? Certainly not a problem I've ever had. And I have a real SaaS business which people pay real money for. I've been developing enterprise SaaS for 10 years.

My go to stack for small projects where scale is not an issue is Laravel, Laravel Forge for deployment, Vue or jQuery for interactivity, SQLite for database, Redis for cache/queue and...that’s it. No Docker (because Laravel has a super simple dev environment setup with Valet), not a single YAML configuration file to be found anywhere, and this kind of setup on a single $20 DigitalOcean server can literally serve 100k users without a hitch. How many apps have more than 100k users?

Re: Docker, Django, Traefik, and IntercoolerJS: My go-to stack for building a SaaS

#287
post #67

Can anyone answer why python is a choice anymore instead of i.e. golang for saas applications like this? I previously worked heavily with ruby and I cannot imagine building beyond >1000 LoC in interpreted, dynamically typed languages. Aside from developer familiarity which trumps all other points. It's also significantly easier to dockerize a generated binary from golang or rust, etc. Some of my worst docker headache…

You have to reach massive scale before you’re going to see a significant performance benefit from Go, but you’ll see productivity wins from Django from day one. If you’re not targeting that kind of public scale and don’t have a large team, there’s a lot to be said for picking a mature stack on a high productivity language.

I used to think the same way and still kind of do. But you're neglecting another performance benefit. You have ~100 ms to respond to a request before the user perceives slowness. With Go you can do 10-100x more stuff in that timeframe.

Re: Docker, Django, Traefik, and IntercoolerJS: My go-to stack for building a SaaS

#288
post #130

I don't get why people use Docker for "small SaaS apps" where "scale is not an issue". You can run everything without Docker to remove an extra level of indirection. I've been doing that exact thing with a very similar Django stack for years. Not once have I missed Docker. On the other hand, I have taken over SaaS projects where the (unnecessary) usage of Docker made it more expensive to host, decidedly more difficul…

For multi tenant deployments. Each tenant gets its own docker-compose in a directory on prod and voila: 100% same code base (same Docker image) and good separation between tenants

Multi-tenant deployments with Docker make sense _only_ if you trust all of the tenants, since it is trivial to take control of the host if you have write access to Docker socket.

You may say that it can be mitigated with some wrapper scripts with limited commands, but then you have to maintain them and we can all agree that homebrew security is very hard to do correctly.

Re: Docker, Django, Traefik, and IntercoolerJS: My go-to stack for building a SaaS

#289
post #43

Earlier quoted context omitted.

> Many have imagined and built valuable stuff in interpreted, dynamically typed languages before you, by being more focused on overall structure and making sure it's strict and resilient. One really doesn't have to search far for successful applications that are certainly way beyond 1000 LoC and still iterate pretty quickly for their size. I once tried to get into a large Python project, and even the IDE (PyCharm) ha…

Good news! Since ten years ago, you don't have to! def myfunc(foo: Dict[str, MyObject], bar: int, baz: str) -> List[MyObject]:

This is the same programming community that is half stuck on Python 2, no way should anybody expect types to have reached majority mindshare.

Re: Docker, Django, Traefik, and IntercoolerJS: My go-to stack for building a SaaS

#290

Earlier quoted context omitted.

> You can run everything without Docker to remove an extra level of indirection. ... and add questions like: are all paths correct for this machine, are binary lib dependencies the same as in production, are the OS versions compatible between dev and prod, is my local runtime version compiled with same options? The great example where the indirection adds value is: every developer has the same environment and the CI…

If you have to answer such questions then yes, Docker is probably a good solution for them. I find that in my pretty vanilla web development, I am not faced with those questions. Most of my stuff is just Python, Django, PostgreSQL, Nginx and a few not very exciting Python dependencies. (This is in several independent projects, working as a sole developer, since 2014 and let's say ~100.000 users of my SaaS apps.)

I could tell you were a solo developer before getting to this comment.

A lot of the problems docker solves is as soon as you need to fit out a team with a mix of environments and split ops from dev

I still use it for individual projects because I never plan on maintaining everything forever - makes it easier to grow to a 1+1 team or hand the project to someone else or solicit contributions

Also builds your experience for when you do work in teams

Post reply on HN