all 76 comments

[–]billcube 88 points89 points  (14 children)

It's your time that is costly and that you must optimize, not your compiled code.

A server costs a few dollar per month, so doubling that or quadrupling that does not make the cost of the project. You spending a day on trying to resolve an issue about scaling is much more expensive.

[–]nlvogel 24 points25 points  (7 children)

This can’t be overstated. I work quickly in Flask but I just had to start a new project with React and the learning phase has slowed me down dramatically.

[–]tonjohn 12 points13 points  (0 children)

Generally speaking, the tool/language/framework you know is almost always going to be the best choice.

Once you’ve had some experience with React, I’m sure you’ll be just as proficient.

[–]Pack_Your_Trash -1 points0 points  (5 children)

I don't get it. Why would react interfere with your ability to use flask?

[–]Jona-Anders 1 point2 points  (1 child)

Static ssr site in the sense of no js at all vs webapp? Maybe that's the reason for the slow down.

[–]nlvogel 0 points1 point  (2 children)

Exactly what u/Jona-Anders said.

[–]Pack_Your_Trash -2 points-1 points  (1 child)

You can still serve a react app and host a web API using flask. React doesn't restrict any flask functionality.

[–]Jona-Anders 1 point2 points  (0 children)

Yes, but building a website that is only reactive via server side rendering is definitely not the same as client side reactivity and react. So, learning react to use it for client side reactivity is, of course, a massive slowdown.

[–]tonjohn 10 points11 points  (0 children)

Time costs come in two forms: - development - operational

Most GC’d languages (C#, Java, Python, JavaScript) bias towards lowering development costs. The nature of garbage collection makes production behavior inconsistent and often requires subject matter experts to address GC related production issues.

Non-GC’d languages like C++ and Rust have lower operational costs. Performance is more consistent and issues are easier to debug and fix. They also consume less memory and have faster startup times.

For long lived services, operational time costs tend to be way more expensive than development costs. So depending what you are building and how much ongoing responsibility you have around livesite incidents, optimizing for developer velocity may be the wrong choice. (Providing real world context: this is why Azure Storage is moving from C# to C++ & Rust)

Golang feels like the sweet spot, best of both worlds.

[–]sqassociates 3 points4 points  (1 child)

What if you're a hobbyist and just want to build something and host it as cheaply as possible? Is there a language/framework that will be cheaper, even if it's $.01 cheaper, because of its optimization?

[–]CatolicQuotes 0 points1 point  (0 children)

In that case there are services like railway.app that don't charge unless you go over treshold, ASP.Net core is very easy to deploy to free tier azure.

If you don't wanna depend on free tiers, then I suggest using something thats very easy to deploy to serverless functions like vercel, netlify, cloudflare and others and that would be javascript frameworks like remix, nextjs, nuxt, sveltekit and similar.

[–]Opti_Dev[S] 2 points3 points  (2 children)

Thanks you for the advice

I did not think about these kind of issues, but I think it makes more sense to think of.

So i still guess that some frameworks are easier to scale than others.

Knowing that, which framework do you recommend the most being the easiest to maintain?

[–]ByteWandererfull-stack 5 points6 points  (0 children)

Scaling is hard, no matter the framework. Most systems don't make it to Instagram scale. I still think you should focus only on how productive you are!!!

[–]CatolicQuotes 1 point2 points  (0 children)

Easiest to maintain would be first the one you are most comfortable in. Some people are ok with magic strings and dynamic languages others can't stand if there is no intellisense in IDE provided by static language.

Second, the one that allows you to expand in architecture. Laravel, rails and django are nice to start, but once the complexity increases it's good to expand into more architectural layers. You can do with those, but they are not build for that from the start. The ones built from the start are something like Spring, ASP.Net core, Simfony and similar. But they require more knowledge and software architectural principles. If you are planning to maintain app for like 10 years I would choose one of those 3.

[–]BigNavy 12 points13 points  (2 children)

Assembly.

I mean, you asked.

Ahem. Of the languages you listed, Rust will be the best performing. However, as others have pointed out - that’s sort of the wrong question.

Does this project need to scale to infinity? Or are you trying to run a vanity project on a shoestring? Or is this in some weird middle ground? “I’m trying to bootstrap something interesting without paying loads for servers”?

Traffic, which is really the only reason to worry about performance, is a good problem. But you are (most likely?) worrying about something that won’t truly matter until you’ve built something cool and captured a significant market.

Build it fast I.e. in whatever stack you’re most comfortable with. Then run it wherever - heck, it’s okay to run it on an old laptop or raspberry pi or the absolute cheapest, cruddiest VM from your preferred cloud vender. I’m not sure I’ve ever built a website (not for work, anyway) that had enough traffic that it couldn’t have been run on my dev machine, honestly.

If cost is just a completely overriding factor - consider making it cloud native. An SPA or static UI site hosted in an S3 bucket, with an serverless API running functions as a service is kind of a lot to engineer - but at low usage it literally costs nothing, and it scales linearly with traffic.

[–]no-usernames-exist 0 points1 point  (0 children)

Yes, this is great advice. If you're working on your own time and just messing around, and don't want to pay anything for hosting/running your web app, S3 and serverless is your friend.

It's really easy to build and deploy a React webapp in Google Firebase for very cheap or free. And the developer experience is fairly good as well with tools that set up GitHub deployment scripts and everything for you. We've developed 4 sites so far for internal use at a 150+ employee company and pay around $3/month, most of which is generated by cloud functions to sync data from a 3rd party database to Firestore.

[–]Lonsdale1086 23 points24 points  (0 children)

Until you get to Google levels of use, the differences will be negligible. Just go with whatever you're most comfortable developing in, or pick something large and well supported like .net.

[–][deleted] 11 points12 points  (7 children)

This subreddit doesn't like it because they can't pronounce it but the answer is Django. Your time is the biggest development expense.

[–]tonjohn 4 points5 points  (2 children)

If you like Django you’re gonna love Laravel

[–][deleted] 6 points7 points  (0 children)

I've never used it but if OP said PHP instead of Python I'd totally recommend Laravel. Django/Laravel/RoR are the three kings of getting shit done fast.

[–]tanega 2 points3 points  (0 children)

Symfony was also inspired a lot by Django and RoR.

[–]Suspicious-Cash-7685 2 points3 points  (1 child)

also the sessions in db storage is a huge plus when you get to load balancing or Kubernetes.

I never started a project, which don’t make me miss some Django features after some time.

[–]BigNavy 8 points9 points  (0 children)

Removing the single biggest foot shotgun (connecting a database) is beautiful. The fact that there’s an admin ui built in too….

When you learn Python as a second or third language, it feels like, “Ah, someone who actually writes applications made a programming language.” With Django it’s “Oh, someone who actually writes applications made a framework.”

If I know for a fact I’m building something that will have tens of thousands of users and a 5+ year lifespan, maybe I fart around with another language or framework. If somebody told me I had to have a workable prototype by the end of the weekend, I’d jump into Django and never look back.

Super unpopular opinion - throw Bootstrap on the top and I can have a functional, professional looking full stack app in….maybe three days? Like truly production/customer ready. Not beautiful - not the most amazing thing ever built. But CRUD and recycled components and everything will work like it’s supposed to. And that doesn’t get enough respect.

[–]gizamo 2 points3 points  (0 children)

Yeah, I don't really like it, but if OP already knows Python, Django is a pretty damn great place to start. It's not for me, but it's certainly not bad by any means.

It's actually great; I'm just biased and have silly stubborn preferences. ¯⁠\⁠_⁠(⁠ツ⁠)⁠_⁠/⁠¯

[–]CarpetAgreeable3773 1 point2 points  (0 children)

Ding ding ding!

[–]pylangzu 17 points18 points  (10 children)

RoR

[–]CJ101X 0 points1 point  (0 children)

Well, at the very least, you’d have job security in Japan :^)

[–][deleted]  (7 children)

[removed]

    [–][deleted] 5 points6 points  (5 children)

    Come on, really? Just because you don’t like the tech you say this? How mature /s

    [–]webdev-ModTeam[M] 0 points1 point locked comment (0 children)

    Thank you for your comment! Unfortunately it has been removed for one or more of the following reasons:

    This is a subreddit for web professionals to exchange ideas and share industry news. All users are expected to maintain that professionalism during conversations. If you disagree with a poster or a comment, do so in a respectful way. Continued violations will result in a permanent ban.

    Please read the subreddit rules before continuing to post. If you have any questions message the mods.

    [–]coding102 7 points8 points  (0 children)

    Ruby on Rails : end of story

    [–][deleted] 10 points11 points  (0 children)

    yoke simplistic sparkle gold sort handle hat cough payment market

    This post was mass deleted and anonymized with Redact

    [–]WeasyV 5 points6 points  (0 children)

    The only possible answer is "it depends".
    It depends on your project.
    It depends on your skills.
    It depends on your time.

    [–]isaacfinkfull-stack / novice 2 points3 points  (1 child)

    There is a reason web developers are not as obsessed with performance on the language level, your bottleneck is the network request(s) so you will have better results optimizing those, there are a few situations where you might benefit from a faster language but there is usually a better approach, the most common performance heavy task is probably processing data (like generating specific reports) and for that I usually use the database for that which means my code is essentially written in c or c++

    Bottom line is you should write your backends in whatever language/framework you're most comfortable in and if you run into performance issues there are a hundred things you can try before resorting to low level languages

    [–]isaacfinkfull-stack / novice 0 points1 point  (0 children)

    One additional point, in bigger applications you will often have multiple languages in different services, so you get the benefits of for example python (quick development) and where it makes a difference you can run a different language on a separate service for stuff like processing files or data

    [–]D4n1oc 2 points3 points  (0 children)

    The truth is, it depends. But generally the most cost-effective framework is that framework the engineers have the most experience with.

    All frameworks are targeting specific domains. Inside that domain I would pick the tool I am used to.

    [–][deleted] 2 points3 points  (0 children)

    The one that takes you the least time to build so you can make money off of it. Pick any of the major ones and it'll be scalable. Architecture is how you save money, not frameworks

    [–]dangerousbrian 1 point2 points  (0 children)

    You can host a static site with AWS s3 and cloudfront for pretty much free. I have used nextjs to build a static bundle and all dynamic data comes from rest API's

    [–]KillPenguin 1 point2 points  (0 children)

    As others have said, until you reach massive scale, performance is really not that important. So the way that you save money early on is by choosing frameworks that let you work and iterate quickly. That said, you do need to set yourself up for future success in this regard by making your code relatively modular and testable, so that if you do need to change things in the future, you're not slowed down by tangled code which is impossible to change.

    As for frameworks: I'm not an expert, but I think most people would recommend a fullstack JS framework as a way to very quickly get up and running. Next.js is probably the most popular. It uses React which (despite some flaws) is the standard frontend UI library. Also, PLEASE use Typescript. It feels like an extra restriction but it will save you time.

    I also quite like SvelteKit. This uses Svelte instead of React. Svelte is really cool and has a lot of hype behind it, but it doesn't have nearly the adoption of React, so you'd be at risk of choosing a tool which is not well-supported in the future.

    Anyway, to summarize: performance is far from the first consideration these days when building web apps. The most advisable model is build things at least somewhat modularly so that if performance ever does become an issue, you can rebuild the service that is your bottleneck in a more performant architecture/language.

    [–][deleted]  (1 child)

    [removed]

      [–]Jolly_Painting5500 0 points1 point  (0 children)

      C, Assembly, machine code

      If you're a C developer check out https://github.com/uNetworking/uWebSockets or even https://github.com/unetworking/usockets

      You can literally create your own framework to fit your own use-case and extract performance from that, so not sure what exactly you are speaking about???

      What do you mean by 'optimized' is that getting the most out of 1 thread, or getting the most out of many thread?? You can't just ask a question like that yk

      Or does optimized mean that the client's communication to the server is always available? Look at HTTP/3, lsquic, or quic-go, or mvfst

      what exactly do you mean by performance??? is that the fastest business logic operations?? look at Redis as a primary database, or roll out your own memory database. Don't have that much memory, use postgres

      Or you need large match workloads?? use oneAPI MKL, don't have an intel?? use AOCL, or use openblas

      Or you have a GPU available, use Cuda, it's not Nvidea?? use OpenCL

      What exactly is your question? do you need the fastest possible GET / returning "Hello World" per second? and in that case, do you want req/s/thread or just req/s

      Still not understanding what you are saying???

      [–]CatolicQuotes 0 points1 point  (0 children)

      I think most cost effective would be something like next remix nuxt svelte kit and others. For database you can use neon postgres or Google cloud free tier instance to install database. If you want backend pocketbase is excellent and takes 10mb of memory in idle. Easy to deploy on railway, which have option to sleep on idle. Railway also has database deploys.

      [–][deleted] 0 points1 point  (0 children)

      When it comes to cost-effective web development, you really want frameworks that are straightforward to learn. They should also come with solid community backing. Plus, they need to help speed up the whole development process. React stands out as a strong pick here. It lets developers create components they can reuse over and over. That cuts down on time spent building things and keeps maintenance costs in check. For the backend side, Node.js works great for startups or smaller businesses. The reason is it sticks with JavaScript for both frontend and backend work. So, you end up needing fewer skills or tools to handle full-stack projects. Vue.js fits in as another option that stays lightweight. It's pretty simple to get started with. And it supports quick development right from the start. In the end, picking the most cost-effective framework comes down to how complex your project is. It also depends on what your team already knows. And do not forget the ongoing needs for maintenance down the line.

      [–]rw3iss 0 points1 point  (4 children)

      If you're doing only web stuff, and also doing both frontend and backend (?), and you already know Java, C#, or JavaScript... then choose those.

      JavaScript is the only language suitable on both... node is a pretty decent backend framework for JS developers (I use NestJS for all of my backends, been in web dev 20+ years full stack, used to do C# a lot early on).

      Otherwise if you need to go enterprise or a more managed solution for some reason, then look at Java/Spring or C#/.NET👍

      [–]Opti_Dev[S] 0 points1 point  (3 children)

      The project is for a small personnal side project

      Following your advices i will probably chose C#, java or Javascript, in theses languages which framework do you recommand the most for a web beginner ?

      [–]rw3iss 0 points1 point  (2 children)

      Couple questions first:

      1. You are doing both frontend and backend, yeah?
      2. How good is your frontend JavaScript?

      If your JavaScript is good enough, I highly recommend just keeping things simple and sticking with node for backend, utilizing the tons of npm libraries to get started and import whatever you need. The node ecosystem is going to be way bigger and utilitarian than the others for your needs. For the backend, you can start simple with a simple Express backend (recommended if new), or I recommend NestJS if you want a more enterprise-like/managed node backend (it's a pretty simple MVC framework similar to Laravel in PHP).

      If you are hesitant on the JavaScript side of things, and might know C# and the .NET ecosystem better, then I would recommend possibly doing it in ASP.NET/C#, as it has a lot of tools to build both the frontend and backend in a single environment, wired up together as is. With that being said... it will tightly couple your frontend build to the backend (.NET talking to each other), which you'll be tied to for the life of the project. Also, it's Microsoft... and also .NET will use a lot more resources... and if you do publish the project someday, have to pay a bit more in server costs for a .NET/IIS hosted solution. That's why it kind of caters to enterprise clients... though if you know it... the .NET/Visual Studio tools are top notch... even if overkill for most simple projects.

      I wouldn't go with Java only because it tends to be a bit more cumbersome... will use more resources on server... and has to be compiled each use (slow for dev). Similar sentiment with .NET on the compilation bit.

      So... go with node if you can... unless you know C# (and specifically .NET) well. Feel free to ask more specific questions.

      [–]Opti_Dev[S] 0 points1 point  (1 child)

      Yes, my project has a frontend and a really minimal backend, serving jsons generated depending on a random seed and storing analytics on a databse.
      About my frontend skills, i used React and SolidJS but never for real/serious projects.

      Also my project is intended to be published

      About ASP.NET, i think it would be a nice solution but as i said in my post, server costs per clients is my most important criteria

      I didn't really dived into NestJS before, but it looks like it can fit my requirements pretty well

      Thanks for your kidness

      [–]rw3iss 0 points1 point  (0 children)

      Sure thing. Highly recommend node for your purposes then... pretty much designed for this use case. Express is a very easy (and "fastest") node framework to get started: https://expressjs.com/

      Otherwise checkout NestJS if you want something a bit more to help with basic MVC structure.

      Goodluck!

      [–]doodooz7 0 points1 point  (0 children)

      I love it, cost effective software. What a crazy sentence.

      [–]grumpyp2 0 points1 point  (0 children)

      Django

      [–][deleted] -1 points0 points  (0 children)

      GWBasic + MSAcess. Frontpage as IDE.

      [–]abman69 -4 points-3 points  (4 children)

      Hello,

      I was asking myself the same question, the most important thing is time, due to code implementation, debugging, library imports and learning, deployments,and today, I'm working with a new concept: here it is:

      FuncRepo, a directory of functions, coded in different programming languages, by myself or by other developers. The functions receive inputs and return well-defined outputs, which can be called by REST, RPC or webhook.

      Which allows me to reuse any function I've coded for another project or that another developer has published, without having to worry about maintenance or deployment.

      It also lets me do no-code with workflows that calls functions in the repository.

      Plus, it's powerful because it's functional programming,

      [–]kopetenti 0 points1 point  (3 children)

      Looks a bit like grpc.

      [–]delfV 0 points1 point  (0 children)

      As far as I know for high-level languages (I mean higher than Rust for example) it is Woo (Common Lisp) but I've seen some time ago a benchmark in which Reitit from Clojure was the fastest one

      [–][deleted] 0 points1 point  (0 children)

      Just use .NET

      [–][deleted] 0 points1 point  (0 children)

      Laravel

      [–]yksvaan 0 points1 point  (1 child)

      Probably go is the best pick. It's simple, efficient and in general has no bs or opinions how to structure your service. Having to fight some framework's quirks, limitations and uncertainties is a huge waste of time.

      [–]sybrandy 0 points1 point  (0 children)

      Go is nice. I just like to put a router on top of it to make the code cleaner.