Do you REALLY need a backend?
Introduction
In the world of web development, having a backend has always been a common practice. Backends allow developers to handle complex business logic, manage databases, and process user inputs, among other things. However, with the rise of modern front-end technologies, it has become possible to create dynamic and interactive applications without a traditional backend. In this article, we will explore whether you REALLY need a backend for your next project.
Advantages of a Backend
A backend enables you to have full control over the server-side of your application. It allows you to store data securely, manage user authentication and authorization, and handle complex operations that cannot be done on the client-side. A backend also provides a scalable infrastructure, making it easier to accommodate an increasing number of users and handle large amounts of data.
The Rise of Frontend Technologies
In recent years, front-end technologies such as React, Vue.js, and Angular have become incredibly popular. These frameworks enable developers to build highly interactive and seamless user interfaces without relying heavily on a backend. With the help of APIs, front-end applications can communicate with external services and databases, reducing the need for extensive backend development.
Backend as a Service (BaaS)
Backend as a Service, also known as BaaS, is a cloud computing model that allows developers to outsource backend infrastructure and concentrate more on the front-end development. BaaS providers offer pre-built backend functionalities like user management, database storage, and API integrations, eliminating the need to build everything from scratch. This approach is particularly useful for small to medium-sized projects with limited resources.
When Do You Really Need a Backend?
While modern frontend technologies and BaaS platforms provide a feasible alternative, there are still scenarios where a traditional backend is necessary. If your application requires complex business logic, real-time data processing, or extensive interaction with server-side resources, opting for a backend is the way to go. Additionally, applications that handle sensitive user data or require secured transactions usually benefit from having a dedicated backend.
Conclusion
In conclusion, whether or not you REALLY need a backend depends on the nature and requirements of your project. The advancement of frontend technologies and the availability of BaaS platforms have made it possible to create powerful applications without extensive backend development. However, for more complex scenarios and sensitive data handling, a traditional backend offers the necessary control and security. Consider your project’s specific needs and evaluate the available options before making a decision.
According to React docs Next.js is a full stack framework, which makes sense to me.
Pretty Much like MVC for C#, Razor Pages for Front-End while the server handles the 'Routing' and 'Model Binding' etc.
As soon as you said "Rails" everything for me clicked. I've worked with Ruby On Rails and basically NextJS is a similar environment for Javascript. As a newbie coming to your channel recently, this is where NextJS clicks more for me, as before NextJS didn't have the api routes at the time of using NextJS.
Would you also consider Sveltekit as a backend framework?
so we can say that NextJS is a NodeJS (back-end) templating engine library, and instead of vanilla JS or its own thing (like JSP or PHP for instance), it uses React.
is that accurate?
It's often weird to me when you answer so many questions that I didn't realize I had.
PRisma cant do joins … it is useless for big applications
Why am I not understanding how you would go about supporting a mobile app if your backend is integrated with your web app?
Vercel limits you to 60 seconds for each invocation (Serverless,Cron edge etc ) tops even if you are on the pro plan. Giving you 900secs only on the enterprise plan. When I contacted them, they stated that the enterprise level is 5 digits USD. If you think your BE would do more heavy-lifting than just exposing a DB underneath it. I would highly recommend you to avoid vercel to deploy it
At least, as a backend, It lacks a DI for enterprise-grade projects.
Absence of decorators also limits you when you need to apply shared logic over all endpoints, so you need to rewrite repetitive trycallcall blokcs again and again.
I doubt that all this can be substituted just with trpc, when you have 15+ integrations, several DBs, and misc microservices to gather data from.
To some degree, it's achievable with self-written abstractions, but it's much more pleasant to do in an organized and scalable way that NeSt provides.
Will be glad to see someday Next.js with the main features of Nest on the backend.
This was super helpful.
yes I need backend because my services not only consists of website, it's mobile app, it's desktop apps etc.
For my understand are you saying that we should not use solution like Strapi as our CMS and that we should be using a database instead
NextJs is good as BFF (Backend for frontend) and for non critical small/middle size APIs… Also if your team know only Javascript there is no much choise… Sometimes requirement is to have one container sometimes it does not metter… Sometimes backend need to scale and you will use different language for APIs…
Man I'm going in circles. Noob learning all this stuff. Got flask as my backend. Looking for a front end. Found out about React. Went to their website just now. And their get started page directs me to Next. Now I end up here. 🤷♂Edit: Might be bad wording on the React website: "If you want to build a new app or a new website fully with React, we recommend picking one of the React-powered frameworks popular in the community" – doesn't make clear they are talking about back end support here.
Muja q lag raha hai k is banda na naswaar rakhi hoi hai.,😅😅😅😅
Thank you for your content, it enlightend me literally. 👏
Some people may mistakenly consider Next.js as a backend framework due to misunderstanding its purpose and functionality. This could be because Next.js has some backend-like features, such as server-side rendering, static site generation, code splitting, etc.
Additionally, Next.js can also be used to build full-stack applications by integrating with backend frameworks such as Nest.js or Express.js to implement server-side functionality. Hence, some people may consider Next.js as a backend framework, but this is a misconception.
Overall, Next.js is a React framework primarily used for building client-side and server-side rendering applications, rather than a backend framework.
Do you store user sessions in a remote database? One thing I like about having my own stateful server is that I can store sessions in a local Redis DB, which makes them very fast to retrieve.
Another reason is that Express has useful middleware that I'm missing for NextJS API routes, like express-rate-limit.
Next time bother to mention what CRA stands for. Thumb down lad !