Live data from Hacker News

Ask HN: Go-To Web Stack Today?

news.ycombinator.com

21–30 of 31 posts

Re: Ask HN: Go-To Web Stack Today?

#21
post #5

Earlier quoted context omitted.

Interesting, thanks for the feedback. Didn't even consider the whole innate multicore support.

Erlang/Elixir do much better at utilizing all CPU cores effortlessly -- without you having to lift a finger. In Elixir's case just use the Phoenix framework and you get something that can serve 2000 requests per second on a $5 VPS host.

Thanks for the pointer! Will look into it

Re: Ask HN: Go-To Web Stack Today?

#22

I recommend giving Actix Web a try, was able to use the knowledge of Python Flask to build it. Rust has sum types which makes development much nicer especially with all the inevitable business logic that is associated with backend web dev.

I have been using Actix Web as an excuse to learn Rust recently.

I like the fact Actix Web is lightweight and fast. You can deploy it on cheap $5 VPS's and get single-digit millisecond response times and memory usage.

For API type work, it takes little to get going.

The one thing I've taken away is it's still very early days for web frameworks in Rust and Rust in general, so you need to be committed to putting in extra work building libraries/integrations yourself.

I.E. non of the cloud platforms have officially supported SDK's. AWS have a beta SDK they are working on with big bold letters in the readme saying "Do not use this SDK for production workloads" , Azure has an unofficial SDK it looks like staff are work on in their spare time. Google doesn't look to have anything.

Things like live reloading for templates isn't there. I found myself setting up a Webpack build to iterate templates and the frontend quickly with live reloading. I take the Webpack HTML template I produced + CSS assets and move/link to them into my Actix project. I really like the MAUD template engine for compile-time HTML so I find myself rewriting HTML I produce in Webpack to MAUD and just linking to the css / js asset bundle paths from the Webpack build. If I used something like Mustache templates in Webpack that admittedly would make things easier as I can reuse them as is.

The Actix middleware layer isn't well documented, so I looked at existing middleware to figure out how to use it. There's some useful middleware for CORS + logging, but the user auth stuff didn't work for what I needed, so I found myself rewriting my own auth middleware.

The latest stable version of Actix Web is 3.3.2, which uses the old version of the Tokio framework. This will cause issues if using some libraries that rely on a new version of Tokio i.e. the beta AWS SDK's. This means you need to update to Actix Web 4 beta, which then breaks some Actix integrations which do not support Actix Web 4.

All the issues stem from the Rust ecosystem being young. You need to invest extra effort for functionality that exists and is quite mature in other languages/tools. In my current personal project, I could have written it 10x faster using a different stack just because in Rust/Actix I've had to build a lot of basic functionality other web frameworks provide already. It's a pet project, and I choose Rust/Actix for learning purposes, so that's ok. If I had something I really needed to deliver and it wasn't just a REST API I'd probably not use Rust/Actix right now unless I was on a team/company who where willing to spend the extra time for the performance / hosting cost savings.

Re: Ask HN: Go-To Web Stack Today?

#23
>>analysis paralysis trying to decide on a stack.

Yeah, I went through that a few years ago. I went to "TodoMVC.com" and started going over their demos. Spent over a month on that and then a couple more weeks fretting over which one to use. I finally realized I didn't want to invest in any of them.

Instead I use these off the shelf toolkits: Bootstrap for the front end and jQuery, Mustache.js, Accounting.js, Chart.js, and PouchDB.js on the client side along with CouchDB and a bit Perl or Python where needed on the server side.

This is really a pretty sweet way to go. First off, I didn't have to invest in learning how use a "framework" or set up anything on my web VPS except a web server (Apache) and the CouchDB database (also made by Apache).

It's really pretty impressive how much those tookits can do, and how easy they are to use, and how well they work together. That is a really powerful toolset that's rock solid.

PouchDB.js makes working with CouchDB so sweet and easy, and you can configure it to use the web browser's built-in IndexedDB so you don't even need a CouchDB to get started building your app. You change one line of code to switch from the web browser DB to the CouchDB.

And you can install CouchDB on your desktop PC and point your app at it. When you do that, and configure a "Service Worker" for your app you can make an "Offline-First/Local-First" app that runs at near native app speed that can "Live-Sync" with your Cloud based CouchDB on your web server.

The real beauty in this set up is the flexibility. You can drop in any JS toolkit you need to add features and mix it up with plain vanilla JS to create feature rich "single page" web apps that are easy to maintain and use very little bandwidth.

Unless your working with huge amounts of data you can run the web server and the CouchDB on a $20 a month DigitalOcean VPS and it will never break a sweat.

It's worth checking out PouchDB.com and going over their intro and API docs to get an idea of what PouchDB.js does. They have a demo "Todo app" there you can build to get a feel for it.

I have an app you can also check out at https://pugilis.com/app.html

It's a boxing scorecard and boxer database app.

Re: Ask HN: Go-To Web Stack Today?

#24

I recommend giving Actix Web a try, was able to use the knowledge of Python Flask to build it. Rust has sum types which makes development much nicer especially with all the inevitable business logic that is associated with backend web dev.

I have been using Actix Web as an excuse to learn Rust recently. I like the fact Actix Web is lightweight and fast. You can deploy it on cheap $5 VPS's and get single-digit millisecond response times and memory usage. For API type work, it takes little to get going. The one thing I've taken away is it's still very early days for web frameworks in Rust and Rust in general, so you need to be committed to putting in ext…

This might help: https://github.com/secretkeysio/jelly-actix-web-starter

Re: Ask HN: Go-To Web Stack Today?

#25
post #3

Pick the hyped stack if you want to learn. Pick the tools that you're comfortable with if you want to finish.

Thanks for the brutally honest reply :) I guess part of my question is Django still as relevant today or is it losing 'market share' and finding devs to help out in the future is going to prove a lot more difficult.

Django is still relevant and will be in the future. I wouldn't worry about that honestly.

Getting revenue is problem nr° 1, so focus on that.

Re: Ask HN: Go-To Web Stack Today?

#26

I've really enjoyed Flask and Quart (asyncio Flask) for my smaller tool sort of web services as the backend. It can run either self-contained, via uwsgi. For the frontend component, I'd probably be looking at Vue in the future, I haven't done much on that front. My most recent toy was replacing the backend of MailHog with Python, the existing one has been flaky for us I'm not the right guy to fix Java. So I built a Q…

Say you wanted to recreate hackernews as a toy project - what stack would you use nowadays to achieve that most efficiently?

HN is actually a great example.

Look at the old source of it and admire it's simplicity.

https://github.com/wting/hackernews

Re: Ask HN: Go-To Web Stack Today?

#27
post #23

>>analysis paralysis trying to decide on a stack. Yeah, I went through that a few years ago. I went to "TodoMVC.com" and started going over their demos. Spent over a month on that and then a couple more weeks fretting over which one to use. I finally realized I didn't want to invest in any of them. Instead I use these off the shelf toolkits: Bootstrap for the front end and jQuery, Mustache.js, Accounting.js, Chart.js…

Thanks for the input oblib! Will check it out

Re: Ask HN: Go-To Web Stack Today?

#28

Earlier quoted context omitted.

Say you wanted to recreate hackernews as a toy project - what stack would you use nowadays to achieve that most efficiently?

HN is actually a great example. Look at the old source of it and admire it's simplicity. https://github.com/wting/hackernews

Yeh, I had actually briefly looked into after writing that comment and found the same - interesting that Paul came up with his own version of LISP to do it in.

If you wanted to remake it in a modern framework though, what stack would you personally opt for? I think Postgres or MySQL for the database is a no-brainer, but what about the quickest approach for the rest (bar of course simply cloning the repo ;) )

Re: Ask HN: Go-To Web Stack Today?

#29

Earlier quoted context omitted.

HN is actually a great example. Look at the old source of it and admire it's simplicity. https://github.com/wting/hackernews

Yeh, I had actually briefly looked into after writing that comment and found the same - interesting that Paul came up with his own version of LISP to do it in. If you wanted to remake it in a modern framework though, what stack would you personally opt for? I think Postgres or MySQL for the database is a no-brainer, but what about the quickest approach for the rest (bar of course simply cloning the repo ;) )

The tool i best know is dotnet.

Perhaps controllerless, similar to : https://github.com/ServiceStackApps/RazorRockstars

But, as mentioned. That's because I know that tool, that knowledge is not transferable through a comment :p

Post reply on HN