DEV Community πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’»

DEV Community πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’» is a community of 966,904 amazing developers

We're a place where coders share, stay up-to-date and grow their careers.

Create account Log in
Cover image for Ultimate 10 Stages to Master Backend Development
Bilal Ahmad
Bilal Ahmad

Posted on • Originally published at billypentester.Medium

Ultimate 10 Stages to Master Backend Development

Background:

Backend development refers to server-side programming in which a developer creates application architecture and business logic to process and store the data and output useful information.

There are multiple backend programming languages, frameworks, and stacks like JavaScript, Python, PHP, Java, Ruby, etc but in this article, I’ll only discuss the complete backend JS stack here.

coding meme


Stage 1: Web Basics

Learning some web basics is the initial stage for every developer. Having networking concepts can help you to better understand how the internet works, what protocols are used, how messages are delivered etc.

Some basics concepts are:

What’s HTTP and how is communication done?

How many types of HTTP requests are and what are their roles?

What is the client/server model?

What is the OSI model?

How does DNS work?

Add a little more and learn about basic HTML tags, CSS styling, and DOM manipulation:

Task:

  • Create a simple web page using HTML tags
  • Add different styles, Use DOM to change the styles of HTML elements

Stage 2: OS knowledge

Operating System manages all of the software and hardware on the computer. It performs memory and process management, handling input and output, etc.

An operating system runs a server that further runs a complete web app. So, it is necessary to learn about OS operations to maximize performance and optimize memory.

In this stage, you need to learn about OS architecture, file system, basic CLI commands, memory and process management, OS threads, etc.

Task:

  • Open window / Linux terminal
  • Try file/folder commands (rm, md, ren, del, copy, move)
  • Try path traversal commands (dir, ls, cd)
  • Try some networking commands (ipconfig, tracert, arp, netstat, ping)
  • Try some system and process commands also.

Stage 3: Runtimes

The next stage is to learn a backend framework/language to work with. As I mentioned earlier that I’m discussing JS stack here, so the first step is to learn JavaScript. Learn basics about JS like data types, loops, selection, functions, objects, classes, arrays, strings, regular expression, etc.

JavaScript consist of three parts:

  1. ECMAScript β€” Core javascript
  2. DOM β€” Interact with the document using JS
  3. BOM β€” Interact with browser using JS

ECMAScript is a scripting language specification on which JavaScript is based. It introduced new javascript features like arrow function, async-await, template literals, etc. It is also called advanced javascript. Learn some important JS features which can be helpful in efficient coding.

Node.js is an open-source, cross-platform, back-end JavaScript runtime environment that runs on a JavaScript Engine and executes JavaScript code. Learn some basic node js modules like fs, path, os, etc.

Task:

  • Use the fs module to create, delete, and update file /folder
  • Use the path module to set the path for static files/ folders.
  • Use the OS module to get the statistics of the operating system.
  • try async-await and arrow function

Stage 4(a): Server Framework

The main role in backend development is a server framework. It’s a communication gateway between the frontend and backend (node app) with the integration of the database.

Server framework provides you full control over incoming and outgoing requests/responses, provides endpoints, executes middleware functions, etc.

Some famous server frameworks are Express JS(recommended), Nest JS, and Koa JS.

Task:

  • Setup a basic server
  • Interact with req & res callbacks
  • create middleware functions
  • Use different HTTP requests (GET, POST, DELETE, PUT/PATCH)

Stage 4(b): API development

This is a type of practical stage in which you learn how to create a simple REST API using Express JS and node JS and perform CRUD operations. Use express middleware for validating incoming requests, routers for handling endpoints, etc.

Here’s the practical implementation of API development:

Postman is helpful in testing API endpoints. Add more and learn about swagger and Open API.

Task:

  • create a folder structure for API
  • Manage routes and data in separate folders.
  • Use middleware to filter and validate the input data.
  • Use proper status code and error message for results.

Stage 5: Template Engine

Usually, communication between the frontend (React app) and backend (express app) is done using API calls in the MERN stack. Client requests the data from the server and the server sends the requested data back to the client.

But if your project is small and you don’t have good knowledge of React or another frontend framework, use a template engine.

Template engine helps you to create the static HTML template files and replaces variables in a template file with actual values at runtime which makes it a dynamic website. Template Engine works with the integration of Express JS. It gets data values from the database and renders these in an HTML template file.

Some template engines are hbs(recommended), ejs, pug, etc.

Task:

  • Integrate template engine with node js.
  • create a static template in the template engine.
  • Output express values in the template engine.
  • Use if/else and loops in the template engine.
  • Use partial to create reusable components like navbar, header, footer, etc.

Stage 6: Database

Database has the biggest role in backend development. It is used for storing the data in a structured way and accessing and maintaining the data.

Some famous databases to learn about:

  • SQL database: MYSQL, SQLSERVER, POSTGRESQL
  • NoSQL database: MongoDB, Cassandra
  • Cached database: Redis
  • Real-time database: Firebase

Backend apps directly interact with the database by querying the database using third-party npm packages like MongoDB, MySQL, etc

if you don’t know SQL or database language, you need to learn any ORM / ODM as a middleware that translates object methods to complex database queries. It provides you with a complete structure called model to validate data before entering data into the database. Moreover, it provides an extra security layer on top of the object model.

Sequelize is a famous ORM used for SQL databases like MySQL, SQL Server, SQLite, PostgresSQL, etc.

mongoose is also a good ODM used for NoSQL databases like MongoDB etc.

There are some other concepts to learn about databases like ACID properties, backup/migration techniques, applying normalization and indexing, data replication and sharding, etc.

Task:

  • Try some basic SQL queries
  • Understand the difference between SQL and NoSQL database
  • Check how ORM/ODM works with the database

Stage 7: Security

Security is a big concern for enterprise-level web applications. A single vulnerability causes the leakage of data or failure of the application. There should be proper validation, authentication, and authorization in a web app.

Some techniques to make your app secure better:

  • JWT: Use a token to prevent unwanted access to a protected resource.
  • Cookie: Use to store information about visits to the webpage.
  • Session: Use to maintain a secure connection with the server.
  • CORS: Use cors to make requests from one website to another website
  • hashing: Use middleware to hash the password using salt.
  • encrypt/decrypt: Use middleware to encrypt and decrypt important data.
  • SSL: Use SSL certification to secure the transaction.
  • Limiting: Use middleware to apply request limits to prevent DDOS attacks.

Task:

  • try injecting some malicious js scripts in input tags.
  • try sending multiple requests at a time.
  • check how JWT token, cookies, encryption, and hashing work

Stage 8: Message Brokers

Modern applications are complex. Due to large time-complexity, CPU-intensive operations, large amounts of data processing, and API communication between multiple services are some time-consuming issues that leave a bad user experience. Message Broker is one of the solutions that can help to overcome some of these difficulties.

Message Broker is a type of middleware software that allows services and applications to communicate with one another through the use of messages.

Point-to-point messaging and Publish/subscribe messaging are famous models of message brokers.

Message broker consist of 3 components:

  • Producer: Producers send messages on a topic. One or many publishers can publish on the same topic.
  • Consumer: Subscribers subscribe to topics, and all messages published to the topic are received by all subscribers on the topic.
  • Queue/topic: Queue holds the message published by the producer and accessed by the consumer.

RabbitMQ and Kafka provide the implementation of a message broker.

Task:

  • create a newsletter subscription using Kafka message broker.

Stage 9: Testing

Testing is important before deploying a web application on a live server. A single wrong input or missing data can cause the failure of a running server.

Testing can be done on multiple levels based on multiple criteria. For example, you can check if the web app returns a proper status code, error message, data, etc.

Jest is a famous unit testing framework to test both web apps and APIs. It provides multiple methods to automate the testing process, check responses on wrong or missing data, etc.

Supertest is used for APIs testing with the integration of other testing libraries and is easy to use.

Task:

  • Use jest to test a complete API

Stage 10: Server / Cloud deployment

Final stage of application development is deploying the web app on a live server/ cloud.

Before deploying a web app, it’s necessary to learn version control like git, Github, and Github actions to make your deployment flexible and scalable.

  1. Git is used for version control to create multiple branches, track changes in the source code, and enable multiple developers to work together.

  2. GitHub is a code hosting platform for version control and collaboration. It lets you and others work together on projects from anywhere.

  3. GitHub Actions help you automate your software development workflows. Individual actions are reusable pieces of code that let you build, test, package, or deploy projects on GitHub. It can also be used to automate any step of your workflow.

Deploying a complete web app is more complex. You’ll need a dedicated server to respond to the HTTP requests that it will be receiving and work with an online database.

Some famous PaaS are:

Heroku: If you’re a beginner, your project is small and you want to deploy, Heroku is good to start with.

I personally don’t recommend Heroku as there are multiple problems with this cloud platform like issues with environmental variables, slow bandwidth, etc.

Instead, use Vercel or netlify which provides more control and flexibility over the deployed app.

AWS, Docker, and Kubernetes: If you’re seeking a career in full-stack web development or DevOps, now’s a good time to familiarize yourself with Amazon Web Services and/or container platforms like Docker and Kubernetes.

Azure: If you’re a C# or .NET developer, Azure appears to be a seamless way to deploy your apps without having to leave the safety of the Microsoft ecosystem.

Task:

  • deploy a complete API on Vercel cloud

programming meme


Conclusion:

The learning process will never end. It continues until you’re alive. These stages are just the initial step to start as a beginner/intermediate level backend development and there are a lot of other things to learn and it depends on your project requirement and problem-solving techniques.

KEEP LEARNING, STAY PASSIONATE ALWAYS AND EXPLORE THE THINGS


Top comments (0)

This post blew up on DEV in 2020:

js visualized

πŸš€βš™οΈ JavaScript Visualized: the JavaScript Engine

As JavaScript devs, we usually don't have to deal with compilers ourselves. However, it's definitely good to know the basics of the JavaScript engine and see how it handles our human-friendly JS code, and turns it into something machines understand! πŸ₯³

Happy coding!