Ask HN: What's the best backend right now?

5 points by romikusumabakti ↗ HN
I'm planning to build a multiplatform application (web, mobile, and desktop) with a modern tech stack.

I've decided on the following frontend tech stack:

  - Web: Next.js, Tailwind CSS
  - Mobile
      - Android: Jetpack Compose
      - iOS: SwiftUI
  - Desktop
      - Windows: WinUI 3
      - MacOS: SwiftUI
      - Linux: Qt
But I'm still unsure about choosing a backend. What backend do you think is the best right now?

*assume the team is ready to learn any technology

11 comments

[ 3.5 ms ] story [ 30.6 ms ] thread
I still work on a lot of Java projects. As of JDK 17 Java has most of "ML the good parts" and has the same scalable, reliable and high-performance threading Java is famous for. JAX-RS provides a Sinatra style framework that makes it easy to write JSON API back ends. JDK 21 is just about to come out as a long term supported version and it will be even better. .NET is similar in capabilities, I think C# is a better language but Java has a better open source ecosystem.

I do my side projects in Python with aiohttp and think it is a lot of fun even though people tell me it is suicide (I guess if you block the thread you are in trouble)

I think "Next.js" really wants a node.js backend which has the big advantage that you can share code with the front end and back end. It's basically single-threaded but I know people who are happy with it.

The system I'd most like to try is

https://www.phoenixframework.org/

which is just great if you want to do stuff with websockets that is more interactive than what most people are doing.

I think though that developing that many different front ends would drive you crazy: is there a real reason you can't just make it a web app?

Thanks for sharing your insights! For this project, I'm leaning towards more modern backend technologies. While Java and .NET offer scalability and reliability, I'm aiming for a tech stack that's perceived as more modern. Python, while fun, might not be the best fit due to potential performance concerns.

This project is actually more of a hobby and learning experience. And I would of course start with the web first. I'm inspired by OpenAI's approach in gradually rolling out ChatGPT – starting with web, then mobile, and maybe finally desktop.

Thanks for your suggestions! I might consider Node.js.

(comment deleted)
.net and jvm are still very modern. Use kotlin for with spring or ktor. Or use c# or f# with aspnet. They come with everything included.

The time to finish your project would be quicker with all-in-one solutions.

Ditch the nextjs part and just return html. Add alpinejs and htmx and you won’t need to waste time creating a typical json api.

"The best" is kind of subjective. Best in terms of what, performance? flexibility?

You might want to check out https://awesomestacks.dev or https://project-awesome.org/stackshareio/awesome-stacks#back...

Hope those helps.

Thanks for the resources! By "best" I mean "truly built for backend services / web APIs", so it has no performance and scalability issues to be used as a backend for multiplatform applications. Any personal recommendations based on that?
Oh okey! I've mostly written my backend with Rails (or Sinatra when its a smaller service), still happy using it when I can because of how quickly I get things done.
I'm a big fan of JDK 21 with Helidon 4/Nima on the backend - most use cases covered, but very tight and light in dependencies and pretty much completely platform independent. You also have the option of compiling it AoT with GraalVM for a very quick-loading and low-memory near-native binary. Virtual threads mean much easier scaling, as you can do thread-per-request with a synchronous API. (Although I'm not sure if Graal supports java 21 yet, I'll have to check)
I’ve wanted to give GraalVM and its native-images a try but haven’t yet. Do you have any experience with it?
Yes - I once wrote an AWS lambda that was having issues with cold boot times, so I compiled it to a binary and bada bing bada boom, boot went from 2 seconds to about 200ms.

It's not a silver bullet though - some reflection features aren't supported, and reflection in general requires a bit of config at compile time to make sure all the required classes are loaded. This can make some plugin architectures unworkable, although I maintain that if you need reflection for pluggable code, you're probably doing it wrong.

I would go with Laravel if you are familiar with PHP. Lots of out of the box goodies available.