DEV Community

Osagiede Harrison
Osagiede Harrison

Posted on

Introduction to Backend Development

Basically, the web is divided into two major parts. We have the FRONTEND and the BACKEND.

The frontend is what the user interacts with, the visuals, the animations and other stuffs we see as design on a web page. Then what about the backend ?, what is the backend and it's role of any web app?

Let's use the human system as a web app. And with this analogy, The Backend is more like the Brain of a web application, and I mean it literally. Here's why...

Relating backend to the Human Brain.

Doctors tell us the functionalities of the brain , how the brain helps in storing information like wikipedia, helps in collecting information from the environment, processing them and telling us what they are, basically those things we know the brain do. So how does this relate with Backend? Let's use an example

Let us create a web app as a use case and let's call it abc.com

A little information about abc.com.

abc.com, is a social media app like facebook, instagram and also has some payment functionalities like payment with paystack's integration, paypal and e.t.c and after signing up for abc.com, we get an email asking us to confirm our email. Let's do with these features for now.

So, with abc.com, Just like how the brain takes in information from our environment, same way abc.com takes in data from a user, and from our use case, abc.com will have a signup feature and for this feature, data such as username, email, password are all required.

The process of taking these data from a client to a server is made possible with the backend of abc.com, again just like how the brain takes in data from our environment same way abc.com is able to take data from a client (acting as an environment in this case) and it all thanks to the backend.

But, abc.com doesn't just take any data. it has a feature, more like a security feature that tells a user if the data being collected is the right data for use.

That is, just like how the brain processes these information taken from the environment to know which is which, same way the backend does'nt just take data but process these data as well to get full details of data and be able to wrap around on what is needed.

So in terms of integrity of data, the brain does'nt just collect data , it also checks to see if the data will be one that will not compromise it's functionality, imagine the brain using the eye to collect sound ? , that is not how the brain is programmed to function right, and it's the same way our backend tends to correctly take right data for the right use.

To explain more, It will be an error if abc.com takes in numbers as the user's email or rather takes just a string of letters without ensuring the integrity of that input, I mean instead of using this@gmail.com, the user can simply just input this or this.com which will create some errors for the App itself, just like how the eye taking sound will cause a great issue for the human system itself , lol.

Also, we've seen common applications checking if their password length matches with some length to make the app secured, ensuring the right user who registered for the application is the one using the application and not a fraud, checking if extra information such as documents or other accounts given to abc.com confirm user identity and more, this isnt all there is about security but atleast i hope it explains my point.

We've seen from these examples on how the backend is to an Application(web, native, e.t.c) just like how the brain is to the human body. Let's then focus on building backend with 3 main features of backend.

1) Handling Data and Storage
2) Security
3) Third Party Integration.

We've explained Handling Data using the Brain analogy, so we will talk more about Storage.

Storage is a very key essential feature of backend development. Using our app abc.com, we will have users off course and these users will have to create stuffs like posts, images, texts, whatever they will want to create which off course will be okay by our app after "Handling the data" (ensuring the right data for the right use), and we will need to store these data somewhere.

Not just that, but after registration of users, we will need to store user information somewhere so that our users will be able to login with those information stored. This is where Databases comes in.

It is essential as a backend developer we familiarize ourselves with atleast one Database, it can be in category a SQL Database or a No-SQL database. As a beginner getting into backend, it really doesnt matter which type you choose, tho most communities always try to favour one over the other because of their stacks (Python/Django, Js/Node.js) but the main thing is we get to study one database and probably dive deeper as time goes on.

We should try sticking to one tool when learning things like this, else things will become overwhelmed for us and our focus will tend not to be stable and we should just keep toying with time (personal advice).

I use Node.js as my backend tool so i actually chose a No-SQL Database specifically MongoDB, feel free to use the same thing if you like these stacks, off course these tools have their pros and cons needed for scalability but this is beginner friendly so we will skip these for now.

So basically storage is a very important feature on backend, it helps persist data for a long run, and it literally acts like the brain storing information for us using databases and we just need to keep working on it on the long run as users keep increasing , data keep increasing hence the need for more developement as well increases (designing for scalability).

The last, integrating third parties.

Let's go back to our app abc.com, what if we will want our users to login with their gmail account(s), or facebook account or more better a github account lol.

we can't code much here cause this is something we wont have access to, except if someone hacks their database where they store their user information, but this is not ideal and its illegal. Beside that, imagine the stress of doing that.

so what we do here is to find some way to access these data from these other apps, and luckily they do give out access to other companies like abc.com, not that they give out sensitive informatiom, we kind of redirect our user to them in exchange of a token which they give to us to tell us that the user has logged in and is authorized.

Again recall one of the features of abc.com was to send an email to our users after registration or for any reasons at all. Well again, we cant access emailing services without not having to use these companies(gmail, yahoo, e.t.c) services.

Also, for our app, abc.com. We did say , users will be able to pay through paystack and paypal, the main thing is enabling a payment gateway system. Well, it wouldnt be idea for us to build a payment gateway service as that will not just require codes or tech but a whole lot of business plannings as well, so for such a service, it will be best for us to make use of a 3rd party service such as paystack or paypal depending on choice.

Another example is integrating google maps to applications where needed. Most Cab Apps like Uber, Bolt, e.t.c use such 3rd party integration for their project and handling data and security on that 3rd party service is all to the backend.

In summary, we use 3rd party integrations when we can't develop from scracth that particular service which diverges from our niche regarding the business perspective. That is, we tend to just focus on our category of business (social app, e.t.c) and not be a jack of all trades wasting time, resources and labour.

So this comes the end of the first post of my backend series, hope to make awesome posts like these, and please if you will want to share some insights, make corrections or add more points, please do.

And again, this isnt a generalized way of doing backend, the 3 main features are not even the whole features of it, still more into backend, but these are the main primary features we've come to always use for all our applications regarding backend offcourse, have a nice day.

Top comments (0)