Live data from Hacker News

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

simplecto.com

71–80 of 347 posts

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

#71

Earlier quoted context omitted.

> 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 langua…

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

I can’t speak to Rails but this is easy in Python - especially because the addition of typing years back now means that a few annotations will cover most of the common mistakes before leaving your editor. In the Django community there’s a healthy distrust for the heavy levels of magic which are harder to test, which helps a lot.

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

#72

Earlier quoted context omitted.

A dedicated server at hetzner is about 30-35 dollars / month. That will get you a ryzen5/64 gigs/512 RAID-1 NVME on linux. Heroku at that spec really starts to hit the wallet. More than engouh for a lot of applications. Hell, I ran a E-commerce company with 20MM USD/year in sales on a dedicated server from 2005-2013. Most things are plain vanilla and rock stable. I can go from new server to running my first services…

Are you based in the US? I see Hetzner mentioned often due to their great value, but given their EU location I’d imagine the latency isn’t ideal. I’m curious what your experience is. When I’m looking for a cheap dedi box I use OVH or one of their related companies since they have Canada DCs which are closer. Obviously if you are in the EU, Hetzner and scaleway are a great option.

I'm in Europe, but most of my users are based in the US. The ping seems to be in the low 100s for my users and the price is really low compared to AWS/GCP/Azure (about $450 vs $2500). I think it's pretty much worth it.

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

#73

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…

Developing apps in Go is not a high productivity experience, compared to Rails or Django. The framework ecosystem isn't comparable, and you DIY a lot of stuff.

I'm saying this in complete self contradiction: my current stack is Next.js with Go/gRPC Web/sqlboiler

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

#74
Regarding ZeroTier, these days I recommend using tailscale [1] instead. Much simpler setup, easier to understand, and likely more secure since it's just built on top of Wireguard (vs. layers of custom protocols). You do trade-off some of the more advanced features, but those are hardly used for this use-case anyway.

[1] https://tailscale.com

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

#75
post #22

I like the simplicity of the asynchronous tasks. The author mentions it's just a sleep and he isn't kidding: https://github.com/simplecto/screenshots/blob/master/src/sho... Of course, this only really works when you're not worried about multiple workers for the same "queue", etc. Still, simplicity is key -- don't build for scale just because you think you might be there in X years. I like your style!

Thanks for the kind words. I should update the part about the queues. I started using this pattern for SKIP LOCKED and it works well for multiple workers (search engine crawlers). https://www.2ndquadrant.com/en/blog/what-is-select-skip-lock... And implemented in Django: https://docs.djangoproject.com/en/3.1/ref/models/querysets/#...

Have you looked at django-fsm for managing your state transitions? Overkill for small projects - invaluable for larger ones where state changes can be literally anywhere.

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

#76
post #69
post #52

Earlier quoted context omitted.

Yes, you can patch them but with a compiled binary like go, you don't have to. You don't have to watch security lists for vulnerabilities. You don't have to scan your docker containers because the dockerfile is 4 lines long. You don't have to worry about a coworker adding a bad tool to your production container. That frees up cognitive load to write your code. Note: I am an infrastructure engineer for a small SaaS th…

> Yes, you can patch them but with a compiled binary like go, you don't have to. > You don't have to watch security lists for vulnerabilities. These two statements are incompatible. You have fewer things to watch but you’re definitely still going to track your dependencies. Static linking still means you have to do that, and nobody else can do it for you.

Not exactly. You have to watch your libraries for vulnerabilities no matter what language you use. Link or apt-getting the library will pull in a vulnerability

I am more concerned about pulling in Linux binaries that are full of vulnerabilities.

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

#77
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.

There's no difference between a 1000MB or 10MB image, aside from how much time it takes to download new versions and how much disk space it uses.

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

#78
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…

> It's absolutely not scalable.

And yet, somehow YouTube muddled along through and made it work.

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

#79

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 previously worked heavily with ruby and I cannot imagine building beyond >1000 LoC in interpreted, dynamically typed languages.

Airbnb, Stripe, WhatsApp and Discord were able to and win in gigantic markets despite fierce competition.

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

#80
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?

The answer is no, and you’re not going to hear it from the Go zealot replying to every comment in this thread.

Suggesting Go, given where it is right now, is betraying a lack of experience with at least one critical part of the software development lifecycle.

Post reply on HN