If you’ve just started learning web development you’ll probably have heard a lot of talk about frontend and backend programming. But what exactly do we mean by this? If you’re a beginner in the field, it can be hard to know not only which is which, but also what is covered by one or the other.
While frontend and backend development are certainly distinct from one another, they’re also like two sides of the same coin. A website’s functionality relies on each side communicating and operating effectively with the other as a single unit. Is one more important than the other? Nope. They both play very important roles in web development. So where should we start? Let’s flip a coin.
Introducing Frontend Development
The frontend of a website is what you see and interact with on your browser. Also referred to as “client-side”, it includes everything the user experiences directly: from text and colors to buttons, images, and navigation menus.
Let’s say you decide to start a business. You open a gourmet dog treat bakery and need a professional website to present your company to customers and tell them where you’re located. Maybe you’ll include a few photos and some information about your products. All you need are frontend technologies to build your website.
These three languages will do the trick:
HTML - the fundamental coding language that creates and organizes web content so it can be displayed by a browser
CSS - a language that accompanies HTML, and defines the style of a website’s content, such as layout, colors, fonts, etc.
Together these essentials create everything that’s visually presented when you visit a webpage - whether it’s online shopping, reading the news, checking your email or conducting a Google search.
Behind The Scenes
Fast forward a few months. Your business website looks great, and the gourmet dog treat bakery has become incredibly successful. Now customers want to buy large quantities of goodies for their furry friends, and start asking if they can order online.
So you decide to open an online store where people can shop and place orders anytime. This means your site will now have to store information about products, purchases, user profiles, credit cards, and more. How will you manage this data so you can start delivering treats for all those wagging tails? This is where backend development comes in.
Introducing Backend Development
So far, what you have is an example of a static website - its content doesn’t really change much. For static sites, all the necessary information that determines what’s on the web page is in the frontend code itself. Static websites are good for showcasing things like businesses, restaurants, portfolios, or professional profiles. But if you want to turn your site into something that users can interact with, you’ll need to get more in-depth with regard to what’s going on behind the scenes of the website.
The backend (or “server-side”) is the portion of the website you don’t see. It’s responsible for storing and organizing data, and ensuring everything on the client-side actually works. The backend communicates with the front-end, sending and receiving information to be displayed as a web page. Whenever you fill out a contact form, type in a web address, or make a purchase (any user interaction on the client-side), your browser sends a request to the server-side, which returns information in the form of frontend code that the browser can interpret and display.
Your new site will need to have additional backend components to make it a dynamic web application - a website whose content can change based on what is in its database , and that can be modified by user input. This is distinct from a static website, which doesn’t require a database because its content generally stays the same.
Server-Side Set Up
Your website needs a database to manage all the customer and product information. A database stores website content in a structure that makes it easy to retrieve, organize, edit, and save data. It runs on a remote computer called a server. There are many different databases that are widely used, such as MySQL, SQL Server, PostgresSQL, and Oracle.
Your app will still contain frontend code, but it also has to be built using a language that a database can recognize. Some common backend languages are Ruby, PHP, Java, .Net, and Python. These programming languages often run on frameworks that simplify the web development process. Rails, for example, is a framework written in Ruby. “Ruby on Rails” is a popular technology for building dynamic web apps that makes the process much faster.
With all of these parts working together correctly, customers can visit your website and search for the particular kind of snack they want to buy - perhaps they want to pull up a list of treats made especially for small puppies. When they type it into the search box (on the frontend), the application looks through all the product data stored in the database (backend), and returns the appropriate information in the form of frontend code that the browser displays as the user’s requested list.
Open for Business!
So now you’ve got a dynamic web app that makes use of frontend and backend technologies. You use frontend languages to make your website look great and easy to navigate. Behind the scenes, the backend holds together all the frontend components, and makes it possible to do things like store purchase history and product details, create secure editable user accounts, and more. As you can see, both sides have very different roles. But it’s the two working together that ultimately defines user experience and makes it possible for a website to function at all.