Backend Guide for Beginners
“What is what” in Backend?
I have seen a lot of developers, not only beginners but also some intermediate programmers, get confused with different Backend technology, as in, what is what. They might have worked with that particular technology for days without even realizing what kind of technology it is, whether it is a framework or a library. So with this blog post, I would like to highlight what is what in the backend domain.
Databases
Database is a structured system to store data with rules, conditions and constraints based on one’s needs. It does many things without realizing, like security and integrity. It provides many benefits, like storing a lot of data in less space, better data integration, minimizing data redundancy & inconsistency, and faster data access.
APIs
Many people say API is Application Programming Interface, but what does that mean?
In simple words, it allows two applications to interact with each other.
You may have noticed weather data in various websites or apps we use today. Most of this data is sourced using APIs from other websites/servers (weather data sources).
When any person or organization which collects data wants to make that data publicly accessible, but with restrictions, they develop APIs and release the endpoints to the public. These can be free or paid, and they may have usage restrictions.
To build a public API, one will need the following:
- Backend architecture with routes and HTTP functions.
- Database to store and read the data, such as MySQL, PostgreSQL, MongoDB, Firebase etc.
- Server to host the API may be a local server host deployed on a network or a cloud service like Digital Ocean, Amazon AWS, Microsoft Azure or Google Cloud Platform.
Node.js
I have worked with many developers who have worked on Node.js for months but don’t know what Node.js exactly is.
When you search Node.js on Google, you will most likely get this result: “Node.js is an open-source, cross-platform, backend JavaScript runtime environment that runs on the V8 engine and executes JavaScript code outside a web browser, which was designed to build scalable network applications”.
This is okay, but what does it mean? For a beginner, it sounds like Greek.
Node.js is a runtime environment. It includes everything you need to run a program written in Javascript
Node.js started when the Javascript developers extended Javascript beyond the browser so that you can run Javascript code on your local machine to create standalone applications.
After the creation of Node.js, you can do a lot more with javascript than making a website. Browsers we use have their Javascript engines to convert Javascript into machine-understandable code. Back in 2009, the creators of Node.js put the fastest Javascript engine, i.e., V8 and stuffed it in a C++ wrapper to create a program called Node.js to convert Javascript into machine-understandable code on a standalone machine.
When you read about Node.js anywhere, you will encounter a lot of buzz and technical jargon. So here’s a breakdown of everything.
“Node.js uses a non-blocking I/O model that makes it lightweight and efficient.”
I/O stands for Input/Output, which refers to any data your program tries to access or edit beyond itself. Once we start an application, it is loaded into the system’s primary memory. Accessing any data that is within the primary memory is very quick. But often, applications need to access data from the network and secondary memory (files stored on drives), and these I/O operations are prolonged and block other functions from operating. Here comes the role of non-blocking I/O.
Using Non-blocking I/O, one can put multiple requests in parallel without multi-threading. It is implemented using multi-queue architecture. When a function is running, it sends all the callbacks to a queue to ensure that the main request is not held for the callbacks. When the function is complete, callbacks are removed from this queue and added to another queue that stores all pending requests. Whenever the active queue becomes free, the engine takes a callback from this queue and processes it — making it asynchronous, fast, and reliable.
Node.js comes with NPM (Node package manager), a specially designed tool to manage libraries built by various developers to fasten the development process of Node.js applications. You can easily install these libraries in your project and then use them using the require function and built-in modules like file system and HTTP. The require function handles it all by breaking down your code into modules and using them.
Express.js
Express.js is a fast and lightweight backend web application framework for Node.js. It was designed for building web applications and APIs with ease. It provides all the features of web applications without shadowing the power of Node.js. As this framework is user-friendly and has an extensive community, it is also called the de-facto standard server framework for Node.js.
It provides a minimal interface with all the tools required to build a web application. On top of this, it allows access to the massive range of npm modules available on npm to attach to express to make it even more powerful.
It provides a mechanism to define functions for multiple URL endpoint requests with specific actions like GET, POST, DELETE, PUT etc., and sets standard application settings like PORTs, templates etc.
Conclusion
Now that you know some of the basic terminologies used in backend software development, you hopefully understand What is what in Backend better. This is just a starter guide. So keep reading more blogs and exploring to better understand technologies discussed in the above context.
Thank you for reading!