36
45 Comments

How many of you are using JavaScript for your whole stack?

I’m currently building a mobile app and the entire stack is Javascript/Typescript. React-Native FE with a node backend. It’s nothing fancy just a simple API that sits in front of a PostgresDB. So far it’s going amazing. Since I’m constantly switching between BE and FE having them both in the same language saves my brain from a massive context switch.
I’m just wondering if it’s all too good to be true and I’ll eventually hit some bottleneck where the JS solutions don't scale.

Would love to hear what other people’s experiences are.

EDIT:
Wow, this is my first post on IH and i'm absolutely blown away with the response I'm getting. What a great introduction to this kind and open community. Thanks for the help everyone!

posted to Icon for group Developers
Developers
on November 16, 2019
  1. 5

    I used all JS to build/maintain Zigpoll (https://www.zigpoll.com) and JQBX (https://www.jqbx.fm). So far there are no bottlenecks that have been uncovered. I started off as a frontend developer so sticking with JS throughout the whole stack gave me a lot of flexibility and less friction when it comes to building new features. Full stack looks something like this (if you're interested):

    • React (Frontend, only if necessary. Vanilla JS for the homepages for instance).
    • Express JS (Server)
    • Utility Node scripts that run via CRON for maintenance and other misc tasks
    • MongoDB (I use Atlas but you can get a lot of milage hosting your own instance).
    • React Native for Mobile apps (we have an android and ios app for JQBX)

    This keeps everything 100% in JS from the DB to the Server to the Browser. We haven't gotten to this point yet but it should make hiring decisions a bit easier as well since you can just hire JS specialists and forget about the BE / FE divide.

  2. 3

    My background is on a ruby/rails stack, but for my current project, I've jumped in the deep end with full JS stack and have to learn everything pretty much from scratch:

    • Next.js, with served Express
    • Apollo GraphQL (server and client)
    • Heroku mostly, and some DigitalOcean, because I generally don't want to manage infra myself

    Next.js actually takes care of a lot of the boilerplate, and dealing with SSR, so it was somewhat easier than expected to get things done.

  3. 3

    We do, next.js SSR react, nodejs backend made up of lambdas, api gateway and dynamo db, also working on a react native app so full stack es6 bitcompare.net

  4. 2

    You are not likely to got any bottlenecks any time soon. Unless you're trying to do some ai or heavy number crunching, you'll be fine. I've worked at many companies that run node for hundreds of thousands of customers with no problem. If there is some crazy intense processing you have to do early in that locks the thread, you can delegate that work to another service written in whatever language is appropriate for the task.

    That doesn't mean you won't have to think about how to architect your services as your demands increase just as you would if you were running in Java or C#. But you should just work with what is most ergonomic to you while you get your idea validated a-sap and making some cash-money😆.

  5. 2

    I used an entire JS stack to build Pivalink (https://pivalink.com). I think the main reason I made that decision was because it was what I am most proficient with, so it allowed me to build out the MVP very quickly, but it's also a largely performant stack. With regards to your scaling and bottleneck question, I've also worked on a number of teams that built their entire product line in JS-only tech and they've always been able to scale it exponentially without issue. I think like with most technologies, if it's done right (i.e. with scaling in mind as you architect stuff initially), you shouldn't run into any real bottlenecks.

    In terms of specifics for my personal stack, I used:

    • React (For anything UI)
    • ExpressJS / Node.js (for the server / microservices / lambas)
    • MongoDB (for the database layer)
  6. 2

    My background is in .NET, but for sideprojects I'm using Typescript on both ends and I love it. If you're not planning on doing heavy calculations or image processing it's perfect.

  7. 2

    Node.js+Apollo server+React is probably the most frictionless way to implement React + SSR.. and you also can write end-to-end integration tests with this stack

  8. 2

    Personally, Javascript gives me nightmares. Yes I know it is required on the frontend but if I can avoid it, I do. So I don't use nodejs at all. The closest I have got to loving JS is through vuejs. But the entire build system (npm/webpack and all that) still gives me nightmares. I use it but VERY unwillingly.

    1. 1

      Javascript gives me nightmares.
      Can you give more details, why?
      I worked with many languages/frameworks and found JS pretty easy-to-use. My favourite language is C# but nowadays I wanted to switch to more popular JS and Python (what's not bad too :)

  9. 2

    I use vuejs in the front and nodejs in the back.
    I have past experience with very large scale system that was in node and it worked very well. The parts that were not in node where those that had to run heavy algorithms or that had rich ecosystem in other languages (hacking tools and frameworks that require os low-level access are more popular in phyton then in node)

  10. 2

    I use Node.js/Express/GraphQL for backed, Angular for frontend, Cordova/Ionic for mobile, and MongoDB for the database.

    So far, I've not run into any issues when scale and JavaScript. I think it is very possible to have a large scale JS SaaS. I've heard of a couple large companies using Node.js for high-scale products.

  11. 2

    I have a few projects where pretty much all my code is javascript. My main stack today is:

    • Postgres for database
    • AWS for Infra manged by the Serverless framework
    • Serverless Framework with Nodejs for backend
    • React for frontend hosted in S3

    It's so much easier to start and manage projects this way, a lot less boilerplate to do. For mobile, i also use React Native, so javascript all the way! :D

    It does have some challenges like i had to learn AWS Cloudformation for the infrastructure and AWS has a lot of limitations that i pretty much learn to go around one by one.

    One thing that is important to talk about is that i have a financial system in javascript that i had some challenges but nothing that it couldn't be fixed. Other than that, all my production projects are actually going great, including the financial one!

  12. 1

    my entire stack at https://podshownotes.com is javascript. So far so good with me, haven't hit any issues that couldn't be solved with javascript

  13. 1

    Thanks for asking the question, these answers are great 👍

  14. 1

    I used to do everything in JS, too. First it was Backbone+Node, later React + Node. I've never seen a case where Node can't scale, though Java, Golang , Elixir or low level languages have a considerable edge.

    The reasons I've moved away from Node are productivity and ease of reasoning about more complex code bases (TypeScript will help with the later, also)

    1. 2

      Oh TypeScript does help a ton. I would have never gotten this far without it. Vanilla JS is a nightmare to maintain in a large code base.

  15. 1

    I'm using React + Capacitor to make an iOS/Android/web app!

  16. 1

    Vuejs for the front and nodejs express on backend. With few lambdas we at helpninja.com fully running on js stack

  17. 1

    Do you use Knex.js and/or an ORM like Sequelize or Objection.js?

    1. 1

      Im using sequelize. Great for simple queries, migrations, model/db sync, but is a horrible querybuilder (v3+ at least). I use knex in some areas and raw in others.

  18. 1

    I read Netflix moved from Java to Node so they could scale with less hardware. Maybe someone else can confirm that. Netflix is responsible for ~40% of ALL Internet traffic.

    1. 3

      Netflix doesn't even make up a majority of AWS traffic. Google, Tencent and others are operating at an order of magnitude more (as is Amazon).

      Netflix hasn't stopped using Java, either.

    2. 2

      I would like some links for both of these claims if you can find it. Node is not faster than Java so that sounds weird?

      1. -1

        This comment has been voted down. Click to show.

        1. 1

          You got the Java part wrong. I know very well the technical differences in their approach yet I fail to believe Node would perform better - certainly not on a beefy multi-core machine. Maybe in a very specific case and I doubt that's Netflix. But hey if you can point us at some Netflix eng blog post on this, I am all ears.

    3. 1

      Looks like Netflix did move to Node (at least for some things). Largely because they could use a single language but also startup performance. https://hackernoon.com/how-netflix-and-paypal-did-product-transformation-using-node-js-22074e13caad

    4. 1

      This does sound weird. Node can be faster in certain use-cases. But Netflix being 40% of all traffic? I don't think so.

      1. 1

        I was thinking of this article https://www.washingtonpost.com/news/the-switch/wp/2015/05/28/netflix-now-accounts-for-almost-37-percent-of-our-internet-traffic/ "Netflix now accounts for almost 37 percent of our Internet traffic" but that was back in 2015 and only North American Web users during primetime.

        Here are current stats https://www.sandvine.com/blog/netflix-vs.-google-vs.-amazon-vs.-facebook-vs.-microsoft-vs.-apple-traffic-share-of-internet-brands-global-internet-phenomena-spotlight looks like Google and Netflix are each around 12% of total Internet traffic.

        1. 2

          Yeah, that's kinda what I figured. A highly specific statistic stated without context of the specifics.

        2. 1

          Netflix runs on AWS. The blogger also seems to leave out Chinese internet giants entirely. I'd take the post with a huge grain of salt.

  19. 1

    My preference is also using Javascript whereever possible.

    I use meteorjs for quick setup of my MVP's, like https://read15minsaday.com and https://meetingtasks.com.

    I don't event need to think in 'Backend' and 'Frontend'. Just type all in Javascript, that's it.

    Scalability is important but also don't to earyl optimization. Especially if you are an indie founder like most of us here, you should focus on validating your idea first.

    If you have traction, you will have time (and even money!) to think about scalability.

    1. 1

      I mostly agree with this, with the caveat that you still need to consider back-end vs front-end distinctions.

      If you want any kind of security or permission model at all, don't share secrets with the front-end!

      1. 2

        oh yes of course, you cannot omit some basic rules.

  20. 1

    Yes. I have a full stack framework I built myself that's backed by PostgreSQL database, queue workers, command line tools, webpack built in, and uses GraphQL with React server rendered and rehydrated on the frontend.

  21. 1

    Js can definitely scale. I work for a company doing JS for its backend in a service that gets thousands of requests a day. Also there’s threading now, which helps.

    You may have to throw up a load balancer and use some type of managed cluster eventually, but you’d probably have to do that anyway.

    Also, as at least one person here mentioned, doing your app as serverlesly as possible (e.g. API Gateway, lambdas) helps to scale out of the box, but it's a completely different paradigm, and you can't really do a relational DB serverlessly. However, the serverless model does help a lot scaling your API layer.

    If you're interested, Production Ready Serverless by Yan Cui is a great course in designing completely scalable, serverless systems. But again, it is a paradigm shift.

  22. 1

    I use Next.js for the frontend and Express for the backend in combination with PostgreSQL. It is quite an easy stack to master and can do almost everything. npm just has a package for everything.

    For hosting, I use DigitalOcean (Homepage, Referral Link). It is just a $10 instance but actually that is more than enough.

    At work, we also use a full-stack JavaScript stack with Node.js in the backend (also using express) and in the frontend React.js.

    1. 1

      Wow $10 a month! I’m paying $30 on Heroku to run hevyapp.com. What are you using to manage deployments? And logging? And performance metrics?

      1. 1

        Managing deployments: Nothing right now but it is basically just a yarn install + yarn build and restarting the application with pm2. Never had any problems until now. Logging is something I need to look into actually. Performance metrics are done via DigitalOcean. If I get to a lot of traffic, I think I would move my app to AWS though.

    2. 1

      Do you use Knex.js and/or an ORM like Sequelize or Objection.js?

      1. 1

        Did anyone try TypeORM?

      2. 1

        Sequelize, and I am quite happy with it. The only problem are migrations but I am more of a fan of adding columns anyway.

        1. 1

          What is wrong with sequelize migrations? One of my fave features of sequelize

          1. 1

            Nothing, but its a lot of manual work, so I skipped this part for now.

Trending on Indie Hackers
I've been building for months and made $0. Here's the honest psychological reason — and it's not what I expected. User Avatar 170 comments Agencies charge $5,000 for a 60-second product demo video. I make mine for $0. Here's the exact workflow. User Avatar 152 comments This system tells you what’s working in your startup — every week User Avatar 52 comments 11 Weeks Ago I Had 0 Users. Now VIDI Has Reviewed $10M+ in Contracts - and I’m Opening a Small SAFE Round User Avatar 46 comments 7 years in agency, 200+ B2B campaigns, now building Outbound Glow User Avatar 16 comments Show IH: WeProcess. Integrated platform or another all-in-one stretched too thin? User Avatar 9 comments