DEV Community

Cover image for Backstage with Backend

Backstage with Backend

Hello everyone! Today we are going to dive into the exhilarating world of backend development. The goal is to throw light on how websites really operate, the technologies used, and how they deliver information to users.
Learning backend can be as daunting as it is exciting. While frontend development is mostly focused on what is being displayed to the user and, in a broader sense, the user experience as a whole, backend really defines how a website functions under the hood. It contains all the logic needed for a website to perform tasks like fetching data using APIs, storing and retrieving data from databases, authenticating users, etc. Now that was a mouthful; let’s go over each of these individually and really try to provide a mental model of what actually happens behind the scenes in a website.

Server-Side languages

A programming language is essentially the hammer and nails for a programmer. When it comes to backend development the language that you use depends on the type of functionalities you want to develop. Here are the most common languages that are used for backend development:

JavaScript: According to the 2024 Stack Overflow Developer Survey, it is the most commonly used language by developers for the past decade. Its dominance is primarily because JS can be used for both frontend as well as backend development, making it an appealing choice for beginners.
Python: Popular for its simple English-like syntax and super-fast development times, Python is popular especially among beginners for its simplicity and readability. It also has a wide array of libraries, so developers don’t have to start coding from scratch to develop features.
Java: It is a platform-independent, object-oriented language that comes with several open-source libraries that aid the development process. Known for features like multi-threading, automatic garbage collection and portability, Java is still a popular choice for backend development.
C#: It’s essentially Microsoft’s rendition of Java. It’s scalable and has a wide range of security options, but has a steeper learning curve.
PHP: Today nearly 75% of websites still use PHP (Hypertext Preprocessor). It is popular for its fast-execution speeds, efficiency and scalability.

There are also several other languages like Ruby, Go, Rust, Pearl etc.

What are frameworks?

A web development framework is a set of tools and resources that help in developing and managing websites, web applications and web services. They reduce development times, improve reliability and facilitate debugging. Backend frameworks are focused on streamlining server-side development. Here are some common frameworks used for backend development:

Spring Boot: A Java backend framework that is a go-to for enterprises like Netflix, Uber, Udemy and Paytm. Features like auto-configurations, sensible defaults and support for embedded servers enable developers to build products easily.
Express.js: A JavaScript backend framework that is used primarily because of the language synergy with Node.js. It is hugely popular for its minimalistic design, middleware support and routing capabilities.
Django: A Python backend framework popular for its extensive features, scalability and efficiency. While there are criticisms about performance, it still remains a popular choice because of its ease of use.
Ruby on Rails: A Ruby-based backend framework that is known for its highly secure functionalities like password hashing and Cross-Site Request Forgery (CSRF) protection. It is easy to learn and the code is highly readable and maintainable.
While these are some of the popular backend frameworks, there are numerous others like Laravel, NestJS, Flask, ASP.NET etc.

Application Programming Interfaces (APIs)

APIs or Application Programming Interfaces enable applications to communicate with each other. A very common analogy to understand how API works is a Restaurant where the customer (client) orders food (makes requests), the kitchen (server) processes those requests, and the waiter (API) communicates between the client and the server.

How an API works

Now what type of requests does an API handle? In the context of web development we are mostly going to deal with HTTP (Hyper Text Transfer Protocol) requests. Here are some of the common HTTP request methods:

GET: Retrieves data from a server (fetch resource).
POST: Sends data to a server (create new resource).
PUT: Replace the data in the server (update existing resource).
PATCH: Used when only a part of the data in the server is to be modified (partially update resource).
DELETE: Delete data from a server (delete resource).

By enhancing the power of APIs we can make websites more dynamic, interactive and responsive to user needs.

Databases

A Database is nothing but an organized collection of data stored in a computer system and controlled by a Database Management System (DBMS). Database is basically any collection of inter-related information. There are two main types of DBMS:

  1. Relational DBMS: These are also called as SQL databases. A Relational Database stores data in a tabular format, that is, with rows and columns. It is so called because it allows data to be related across tables, thus making it suitable for applications like business, healthcare and educational systems. Each table has a primary key which is a column with unique data and multiple tables can be combined using foreign keys. Examples include MySQL, Oracle, PostgreSQL, Microsoft SQL Server etc.

  2. Non-Relational DBMS: These are also called as No-SQL databases. As the name suggests the data that is being stored here are not essentially related thus providing flexibility and scalability. They can store data in the form of key-value pairs, documents, graphs etc., thus making them suitable for applications like Social Media Platforms, Gaming Applications, IoT devices etc. Examples include: MongoDB, Cassandra, Redis, DynamoDB etc.

Two common types of databases

Web Security

Protecting networks, servers, users, devices and IT systems from internet-based cyber attacks is crucial in today’s day and age where data is a goldmine. Websites are prone to attacks and data thefts, so security is of utmost importance to protect users from such threats. Some common examples of web security threats include phishing, ransomware, SQL injection, cross-site scripting, spyware, viruses etc. Here are some best practices that a web developer can include to make their website secure and safe:

Authentication and access control: Typically done through passwords, PINs, biometric scans and security tokens. Using Password expiration or rotation to encourage users to keep changing their passwords once in a while can improve security multifold. There are also several authentication techniques like 2 factor authentication which involves two methods of verification and token-based authentication where users receive a unique ‘token’ which they can use to access protected systems. Session cookies are cookies that last for a session, i.e., the time frame between the launch of a website and when the website is closed. They contain information that is stored in a temporary memory location which is deleted after the session ends. JWT’s (JSON Web Tokens) are stateless, self-contained tokens that carry information for authentication and authorization. There are several other methods of authentication like Behavioral Biometrics, Certificate Based Authentication, Risk-Based Authentication etc.
Encryption: Protocols like HTTPS (Hyper Text Transfer Protocol Secured), SSL (Secure Sockets Layer) and TLS (Transport Layer Security) can be used to encrypt data while it is being transmitted thus protecting it from third party intervention.
Network security tools: Network security tools like firewalls, Virtual Private Networks (VPNs) and Intrusion Detection Systems (IDS) can be used to protect private secure networks from the public insecure Internet.

Different types of cyber attacks

The Path Ahead

Ideas don't come out fully formed. They only become clear as you work on them. If I had to know everything about connecting people before I got started, I never would have built Facebook. -Mark Zuckerberg

The path to becoming a successful developer is beset on all sides by countless bugs, challenges and annoyingly vague and complex documentation. But with the help of countless online resources, tutorials and every developer’s best friend, YouTube, it is definitely not impossible. The best way to learn coding is by doing it. When it comes to web development, it is no different and project-based learning is the best way to get a handle on all the different and complicated concepts and topics. All the best and get to coding!

Top comments (0)