Live data from Hacker News

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

simplecto.com

41–50 of 347 posts

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

#41

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…

Sounds like you may not be familiar with Django, but it's honestly an amazing option if you want something that's mature, stable, well documented and full stack (the latter being key - one of the only ORMs I don't hate).

The biggest problem for Django and Python in general to me is more in the line of the scalability (performance) question. You are simply forced to put one or even two layers in front of it with a multi-process architecture just to get it to a baseline deployable state (in this case, traefik + gunicorn). But the good news is there are so many people doing that it really isn't a problem. And it turns out you probably want that architecture anyway (probably best if your application server isn't also doing your TLS etc).

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

#42
post #35

Earlier quoted context omitted.

Django drives the choice here. Batteries included, huge community support, and AMAZING documentation. Half the software I write is from stackoverflow. LOL I dont see dockerizing as a problem. Once copied out from my template I never think about it. I do admit that familarity with the underlying Image OS (Debian in this case) makes debugging / fussing about a non-issue.

For local development that debian container is fine but for production you want something small like scratch or alpine. The fewer binaries in the container, the better and more secure. This is one of the benefits of golang. You compile it into a binary and copy just the binary into your scratch container. Maybe it is 20MB in size.

This feels very hand-wavey to me. I can patch and ship my docker images the same way I might patch a server.

apt-get update && apt-get upgrade

rinse, repeat.

Secondly, all this cargo-culting around small containers is fine if you are cramming resources. I am not.

The reality is that my projects and many others are really, really over-provisioned. Looking at my graphs right now, I am on the front page of HN and my server load is still only 20%.

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

#43

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…

> I cannot imagine building beyond >1000 LoC in interpreted, dynamically typed languages 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 the…

> 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) had trouble "guessing" the function parameter types. It's absolutely not scalable. I don't want to be reading a function and guessing "what the hell is the type of this?".

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

#44
post #27

Earlier quoted context omitted.

You’ve just dismissed the entire article and it’s details by adding nothing useful to discussion. By your logic, let’s all dismiss HN - the best knowledge is what you already have.

I think you misunderstood the intent. Constantly optimizing your toolset instead of building a startup with what you already know is a very common form of bike shedding and is one of the hardest things for some developer-founders to get past.

The goal of a startup is to build things quickly, so actually being able to build things quickly is important. If you know a set of tools well you can work quicker than using a perhaps better set of tools that you do not know well. That is an important point to make to people like me who like playing with new toys

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

#45
post #2

Goto stack for building SaaS is the one you know the best.

You’ve just dismissed the entire article and it’s details by adding nothing useful to discussion. By your logic, let’s all dismiss HN - the best knowledge is what you already have.

I don't see it that way. After multiple comments in one direction it was healthy to have someone say, "Wait a minute. Let's not forgot why we're here and what we're here to do."

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

#46
post #35

Earlier quoted context omitted.

For local development that debian container is fine but for production you want something small like scratch or alpine. The fewer binaries in the container, the better and more secure. This is one of the benefits of golang. You compile it into a binary and copy just the binary into your scratch container. Maybe it is 20MB in size.

This feels very hand-wavey to me. I can patch and ship my docker images the same way I might patch a server. apt-get update && apt-get upgrade rinse, repeat. Secondly, all this cargo-culting around small containers is fine if you are cramming resources. I am not. The reality is that my projects and many others are really, really over-provisioned. Looking at my graphs right now, I am on the front page of HN and my ser…

"apt-get update && apt-get upgrade"

You can do this exactly the same in alpine, with "apk update" and "apk add".

"Secondly, all this cargo-culting around small containers is fine if you are cramming resources. I am not."

The default docker python image is 885MB. python:buster-slim is 114MB which is much more reasonable. Even if you're not "cramming resources", pushing 885MB vs 115MB vs 20MB across the wire does add up over time.

In my case, we do quickly iterate and pull docker images so it does make a difference for my colleagues if the image is 30MB vs 500MB. Even if we're all on gigabit internet.

"Cargo culting" implies doing it without knowing why we're doing it. The benefits of reducing the size of docker images is apparent to everyone, although there are diminishing returns. With dive[0] it is very easy to figure out where the waste is.

"The reality is that my projects and many others are really, really over-provisioned. Looking at my graphs right now, I am on the front page of HN and my server load is still only 20%. "

Optimizing docker images has nothing to do with being over-provisioned.

I will concede that it's very different as a solo developer vs even a small team.

[0]: https://github.com/wagoodman/dive

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

#47
post #43

Earlier quoted context omitted.

> I cannot imagine building beyond >1000 LoC in interpreted, dynamically typed languages 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 the…

> 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]:

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

#48
post #26

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…

It's more Django than Python specifically. Does Go (genuinely) have something to match?

You might want to check out https://gobuffalo.io/en

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

#49
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 would be nice if everyone used that. When I looked at the source code for mayan-edms, they weren't using that.

Apache airflow? Doesn't use it. Jupyterhub? Doesn't use it.

I was happy to see projects like Zulip using this, but if it's optional then I can't rely on people actually using it. It's the same thing with ruby/sorbet.

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

#50

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…

> I cannot imagine building beyond >1000 LoC in interpreted, dynamically typed languages That would include Ruby, Python, PHP, and JS. GitHub, Shopify, Wordpress, Instagram, Pinterest, Reddit, significant parts of Netflix (Node), Facebook, just off the top of my head. And you can’t imagine writing > 1000 LOC of a startup SaaS product in any of them? Really?

Not in 2021, no. I would go with typescript, golang+gin or preferably rust+warp/tide.

If you had asked me in 2010, 2015, or even 2018 I would've had different answers most likely.

"And you can’t imagine writing > 1000 LOC of a startup SaaS product in any of them? Really? "

After working on large rails codebases I get nauseous even thinking about having to safely maintain that level of code in dynamically typed languages.

Post reply on HN