Should you start a new project with a front-end or a back-end framework ?4 min read

Iceberg

This question popped into my mind a few days back, during a discussion about projects I’m working on. As a full-stack developer, I’ve had to experience both kind of frameworks, and I have to say that it’s not an easy one.

The fast answer is “start with what you know”. But as experience grows, the area of expertise of a developer grows as well. You become skilled at an increasing number of things, and you get to ask yourself more and more questions before starting a new project. You become picky.

So here is my guide to decide whether I’m going to start with a VueJS project, or a Symfony project. With a React project, or with a Laravel project. But first, I’ll sum up the characteristics of both universes.


Data storage

Will your application allow users to create data to be shared with other client devices ? If the answer is no, go with a front-end framework. That’s what we did when developing BROMSE. It’s basically a meta-search-engine, just for books. Users don’t need to login, nothing about them or their searches is stored, so no database. The list of bookshops is a simple JSON file on our server.

But if your application does need to let users create data, back-end framework is not necessarily the go to answer. Off course your code will be closer to the “source of truth”, almost always on the same server. A back-end application is directly connected to the database(s), so treatments are really fast.

In the case of a front-end application, data can be stored on the client side, with tools like Web Storage or IndexedDB. But it may be deleted if your web browser needs space, or incoherent if you’re using multiple web browser. It’s not data that you can call persistent. You will need to use a distant database if you want your user to not lose their data, or if they want to share them between devices. And there is a lot of fine services for that, like Firebase, Backendless, or Parse. This last one you can even host yourself if you want to.

Computing power

For a front-end application, computing power is something you, as a developer, cannot presume. Whether your users runs your application on a cheap tablet or on a cutting-edge computer may completely change the user experience. Because it is not compiled to machine language, heavy calculus in JavaScript is inefficient, so my advice is to avoid it.

Back-end applications on the other end, will run on a server you chose. So you should know what it is capable of. And you have the authority to upgrade it if it becomes slow. Languages like PHP are also not compiled, but because you are in control of the machine your application runs on, you can write functions in C (just an example), compiled to machine code, and call them from your PHP. This is a good way to speed up heavy processing.

User interface

Applications nowadays tend to embed more and more dynamic elements. Of course if you choose to go with a front-end framework, you are probably aiming for a single page application (SPA), which is all dynamic.

If your application is mostly forms and table to manage data, like a CRM (customer relationship manager) for example, a back-end framework will be great! And you can always add some dynamic stuff by injecting a little JavaScript from places to places. Framework like VueJS or React may even be used in combination with a back-end framework, not to build a whole application, but just to create some dynamic components to use in multiple pages.

SEO

SEO is a big thing to take into account. A Single page application’s content will not be well referenced because google robots do not activate JavaScript. Content is basically not accessible to be referenced in search engines.

So if SEO is something important to you, if you’re building a blog platform for example, go with a back-end framework application.

Real-time Collaboration

This is in the same movement as dynamic user interfaces. Real-time collaboration, like in Google docs where you can see every participant’s cursors, may be a main feature for you. And this means that the user interface must constantly be updated. Or maybe you need real-time in-app notifications?

Although this kind of functionality may be added afterwards on a back-end project using some JavaScript, Ajax calls, web sockets… If you are starting a new project, I’d advise to go with a front-end framework. Interacting with client-side data and syncing it with a back-end database in the background will be much easier this way.

Which to choose ?

Well, for some cases, it’s a no-brainer. Do you need SEO? Do you need to store data ? Is it all dynamic like a collaborative drawing app?

And for some others, it’s kind of hard to choose… You want an SPA but the SaaS back-ends are missing some features important to you. Or you’re developing a real-time collaborative CRM. In those cases, you may have to develop your own back-end in the form of an API, and start a front-end project also.


I hope this was helpful. Thanks for reading me. Have a nice day!

Related Posts

Leave a Reply