JavaRush /Java Blog /Random EN /Servers. Educational program for "dummies"

Servers. Educational program for "dummies"

Published in the Random EN group
Below we provide an adapted translation of the article The non-techie's guide to servers by Kannan Chandrasegaran, a developer from Panopto. Please note that the article is intended for beginners who are little familiar with the concept of the server side of the application and servers. Servers.  Educational program for dummies - 1

From office life

It’s difficult to be a “non-techie” in an IT company, believe me! Marketers, sales managers, accountants - it doesn't matter - from time to time they encounter their technically savvy colleagues. They could be programmers or system administrators.... Either way, "non-techies" feel like they've had an important part of their brain amputated. Or they landed on an unknown planet with intelligent non-humanoid life. Or…
Servers.  Educational program for dummies - 2
Sometimes, of course, everything ends well. For example, a front-end girl is walking down the corridor. Nothing foreshadows trouble: she is heading to the left, you are heading to the right, and as quickly as possible... No, this time it didn’t happen. You are already sitting at the table with her, and trying to overcome the awkward silence, you ask: “And... what exactly do you do?” She starts to say something, but you don’t immediately understand what she’s talking about. The words seem to be familiar: user interface, applications, and - yes, Facebook is a website. Yeah, there are buttons, menus... You somehow figured out the intricacies of her work, nod to her goodbye and your paths diverge in the corridors of a large office.
Servers.  Educational program for dummies - 3
But sooner or later you won't be so lucky: you'll meet a server engineer. Or a back-end developer. Not knowing what kind of jungle you will now find yourself in, you naively ask the same question and... receive abracadabra in response. You hear a lot of foreign words, and thoughts run through your head: “Is it polite to ask what an API is?”, “We use “database” all the time, right?”, “Who the hell is this Jason?” (JSON)??”. Your engineer friend is trying to tell you about servers, but he doesn’t understand how difficult it is for you to understand his speech filled with professional terms. You've probably heard the word "server" before, but it's used in so many different contexts that it's hard to understand its meaning. Well, let's try to understand this term.

Down the rabbit hole

When an ordinary person (that is, not a programmer or administrator) uses an application, all he sees is the interface, a picture that reacts to some obvious (most often) actions. In fact, what users usually understand by “application” is its front-end, that is, the front part, the wrapper with which they interact. But users know very little about what’s inside, that is, about what makes the application work. Let's say you send me a message, for example, via Whatsapp or Viber. It looks like a message is coming from your smartphone to mine. Let's take a closer look at this process. Let's say you send me a message when my phone is turned off, and then you turn off your smartphone yourself. And so, I turn on my phone, and still receive your message, although our phones did not work at the same time. Looks like we're missing something! This is the “something” that we missed—the back-end or server.
Servers.  Educational program for dummies - 4
When programmers talk about front-end and back-end, they usually mean the separation of the user part of the application from the program logic. So, the front-end is the interface part of the application, and the back-end is its server part.

Servers

Essentially, a server is a computing machine, a computer that is connected to the Internet and is constantly turned on.
The two main tasks of the server are data storage and communication.
Servers.  Educational program for dummies - 5
You send a message via Whatsapp or Viber, the application on your smartphone sends the message to the server where it is stored. When Viber installed on my smartphone connects to the server, it sends me all the stored messages.
The server is the “base station” from which the application runs
When an application requires any information, it contacts the server. When an application needs to communicate with another user of the application, it is the server that allows them to communicate. The terms server, back-end, and API are often used interchangeably.

Storage or data storage systems

The main task of the server is data storage. This includes files : photos, videos and documents. The server stores them in a structured way that is similar to folders on your computer, so they can be accessed by applications. Information is also stored on the server . All applications contain information important to their operation.
Servers.  Educational program for dummies - 6
You can present this information as a set of tables. For example, an application needs to store information about a user and their password so that authentication can occur. Your application can be a restaurant guide, in which case the server will store information about each restaurant. In addition to the information itself, the server also records relationships between data. For example, a user likes a restaurant in an application on a smartphone, and the server remembers this connection between the restaurant and the user.
Servers.  Educational program for dummies - 7
This allows you to answer many questions. For example:
  • How many users have liked this restaurant?
  • What restaurants does this user like?
  • What cuisines appeal to several users at once?
Information and relationships between data are stored in a database (DB). There are many types of databases, but they are all:
  • can store information
  • can store relationships between data
  • can receive requests for information and respond to them as single data or a set of data, depending on the request.
There are many types of databases, each with their own advantages and disadvantages. If you hear terms like SQL, MySQL, MongoDB, CouchDB, Redis, then know that we are talking about databases.

Interaction

The key task of the server is interaction with the application and other servers.
Servers.  Educational program for dummies - 8
Many application tasks require interaction with the server. For example, if a user is searching for something, the search query is sent to the server and the result comes from there. If a user sends a message to another user, it first arrives at the server. And then from there it is sent to another user’s application, most often in the form of a sent notification. The interfaces that a server provides so that applications can interact with it are usually called APIs . Well, some interface functions can be associated with endpoints , for example, with search or authorization on the site. To the uninitiated, this interaction may seem strange. The two most common interoperability formats are JSON and XML.
Servers.  Educational program for dummies - 9
XML on the left, JSON on the right At first glance, the formats look difficult to read. It is important to understand that a server is just a computer, like your laptop or smartphone. The app on your phone accepts user input via voice, text, voice recognition, or touch on the screen. The application processes this information and then provides an answer in the form of an image on the screen. A smartphone is a computer that interacts with a person, so input and output are provided in a form convenient for a person. A server is a computer that interacts only with other computers. A person perceives information thanks to such things as: font size, text color and formatting. But this means nothing to the computer.
Interaction between servers occurs in formats that are easy to parse and understand for other computers.

Server application

If you want to create an app that will run on your phone, you will also need an app that will run on the server. Server-side applications are created using server-side programming languages ​​and frameworks, popular options being Java , Ruby on Rails , Node.js , PHP , ASP.NET .
Servers.  Educational program for dummies - 10
You could say that the API is the “door” of your server and the application knows to knock on them. The database stores all your information. And the server application is the “brain” that connects everything together. It receives and responds to requests that are sent to it via the API, adds and retrieves information from the database, and makes decisions. For example, when a user application submits login information, the request comes through the API, the correct login information is stored in the database. The task of the server application is to compare them and respond accordingly to the application using the API.

Hardware

Servers.  Educational program for dummies - 11
When you hear the word “server,” you probably imagine this image: cabinets with flickering lights in a closed room. Probably, to complete the picture, the only thing missing is Tom Cruise, who will come down from the ceiling and steal something. Many large companies own their own servers and entire data centers (those huge rooms with flickering cabinets). Facebook and Google have hundreds of servers around the world. When you run a huge service with millions of users, running your own servers can be significantly cheaper and provide better performance. Instead of maintaining their own servers, many developers use cloud services. Services such as Amazon Web Services, Azure and Digital Ocean offer the ability to use “virtual servers”. These services own and maintain the hardware, and the developer simply loads a server application onto it. Some service providers provide the backend as a service, allowing you to have a simple backend without having to write the backend application yourself.

Do all applications need a backend?

Most apps you're familiar with probably have a backend component. Of course, you can find programs without a server part. For example, some productivity apps. An easy way to find out if an application has a back-end looks like this:
If you switch to Flight mode, will the app still work?
If the answer is “no,” this means that the application definitely has a backend server.
Servers.  Educational program for dummies - 12
I hope you now have an understanding of what the back-end of an application is. Maybe the next time you meet your fellow programmers, you'll be able to not only understand what they're talking about, but also use some damn "Jason" in your conversation.
Comments
TO VIEW ALL COMMENTS OR TO MAKE A COMMENT,
GO TO FULL VERSION