🇮🇩 Originally written in Indonesian.
This English version was AI-assisted and adapted for a more natural reading experience. It is not a literal translation.
Open Link
-
When building an application, there are many things to consider.
One of them is how we are going to build the application itself.
Is a single web application enough, or do we need to separate the backend and frontend into different applications?
A Single Web Application
We build a web application where the business logic and presentation layer are part of a single application.
The server receives a request, executes the business logic, and then generates HTML to be sent to the client and rendered by the browser.
With this approach, we have one main application that handles both backend processes and web presentation.
The development and deployment processes are also handled as a single unit.
Separate Backend and Frontend
I'm sure you're already quite familiar with this concept.
Here, the business logic and presentation layer are separated into different applications.
The backend is responsible for handling business logic, managing data, and providing APIs.
Meanwhile, the frontend is responsible for the user interface and interactions.
Remember, frontend doesn't only mean web. It can also be mobile or desktop.
For example, we have one backend that provides APIs, which are then used by both web and mobile applications.
This means the business logic doesn't need to be built repeatedly for each type of client.
The frontend and backend can also be developed and deployed independently.
However, there are certainly some trade-offs. We need to manage API communication, configurations, deployment processes, and each application running separately.
So, What Should We Consider?
Of course, there are several things we need to take into account.
From a development cost perspective, a single web application generally requires fewer applications to build and maintain.
Meanwhile, separating the backend and frontend requires additional work, such as API integration and testing communication between applications.
From a human resources perspective, this separation allows for more specialized task distribution. However, it also requires coordination between developers.
The same goes for deployment. A single web application has a relatively simpler deployment process, while the backend and frontend have their own configurations and deployment processes.
But that doesn't mean they have to run on different servers. Both can still run on the same server.
Now, what happens as the product grows?
For example, we initially have only a web application, but later decide to develop a mobile application.
With a backend that already provides APIs, we can reuse it for new clients without having to rebuild the business logic.
Of course, there are many other things to consider. From business requirements, human resources, budget, infrastructure, to the product's own development plans.
Closing
At the end of the day, each approach has its own characteristics and trade-offs.
The differences are not just about how the code is written or how the applications are structured.
There are many other aspects involved, from development costs, human resources, infrastructure, operational costs, to the direction of the product itself.
And of course, there are still many other architectures and development approaches to explore.
Especially in today's AI era, building something that once seemed complicated is becoming more achievable.
But that doesn't mean we have to make everything complicated just because we now can.
The more important question is: is it really necessary to build it that way?
Don't forget a cup of coffee today.
Top comments (0)