What’s the difference between frontend and backend?
Frontend and backend are two different specializations in web development. Years ago, a frontend developer was the same person who designed the site, while the rest were backend developers.
Now in a medium or big company there are many more roles involved. But in small companies (also called start-ups), it is normal to have two developers: one for the frontend and one for the backend.
The frontend developer is not a designer. This is a misconception. The designer is the professional who draws the design on paper or uses an application like Photoshop. The designer must provide the final design as an image format, also delivering the rest of the graphic elements of the web.
If the web must change drastically between different devices (using responsive design), the designer is also responsible for designing what those different versions will look like.
To make the job easier, frontend developers usually use some kind of CSS framework, being Twitter Bootstrap the most popular. This represents having a series of files that define the basis of the style, and the frontend developer can customize it.
The backend is what you can’t see directly in the browser. It is something that is computing information and preparing it in the background.
Nowadays nobody implements a backend from scratch (except those big internet companies you already know). To make the job easy, it is common to use a framework. For Ruby the most common framework is Ruby on Rails, which provides an MVC pattern. The V is where the backend can overlap with the frontend, as we saw before.
But if the application must offer a simple API, it is common to use a micro-framework like Sinatra, which allows to implement routing and controllers in a single file.
The backend developer should normally be in charge of the database, which can be relational (such as PostgreSQL) or document-oriented (such as MongoDB). The latter type is also known as NoSQL. When a database is large enough to be the core of the company, another role takes over: the DBA.
But not everything is about providing information to the current user who is browsing the web. Sending email notifications is something that is managed by a queuing system that runs asynchronously to improve concurrency. There are several solutions to this matter. In Ruby’s world a popular system is Sidekiq, which uses Redis to get quick access to what needs to be processed.
Finally, the application must be transferred to the server. Except for Microsoft web technologies, the rest use Linux servers, so the backend developer needs to have the knowledge to setup and optimize this operating system. So, with the help of a deployment tool (like Capistrano), only the changes are transferred.
Finally we come to the Full stack developer role, which groups the backend and the frontend. This type of developer is the most common in development teams. In the end we must all work in this way, making the development process more agile.
In this case there may be several frontend developers who support the work of the full stack, even leading the development of the frontend part, setting the guidelines to follow.
When you start learning about web development, you need to be clear about which way to focus, because both the backend and frontend are already big and are making huge progress.
If you feel more comfortable working with databases and serving requests, the backend is for you. You may also need to manage the operating system and deployments (transfer the updated code to the server). But the most important thing is to choose a language that you like. Ruby is a good choice. In fact, Ruby’s slogan is “the programmer’s best friend” 🙂