E
E
e_danilchenko2015-07-15 10:49:26
Software design
e_danilchenko, 2015-07-15 10:49:26

How to build a client-server architecture application?

Friends, the question is this: I would like to create an application (or rather, redesign an existing one) so that the application logic is executed on the server, and the client has an application through which it exchanges information with the server. I have no experience in this, I have developed only local desktop applications. Yes, what kind of experience is there, I even have a vague idea of ​​\u200b\u200bsuch an architecture, created in my subconscious from fragmentary information of the most different levels of abstraction. I would like to know: how is the connection between the application and the server built? Do I need to register a domain, like with sites, or can I simply access the server at the address specified in the application (again, how?). Hence the following question - is it necessary for this additional equipment? Advantages, disadvantages of this approach, possible problems.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
T
Timur Shemsedinov, 2015-07-15
@e_danilchenko

The client can be both a browser and a window application (for example, in C#, Java, but this is rarely used anymore, except in cases where the client application must locally interact with the operating system API or hardware and must display such graphics as a browser application cannot, for example, in some games where you need to work closely with the video card, but you can’t get it from the browser), and the browser application is JavaScript anyway. If it is windowed, then IP for communication is enough (we write IP and port in the config), and browser-based - it will be much more convenient to open it through the domain name. You will need to exchange data between the client and the server, for this you need to select: protocol and serialization format. No matter, whether the client browser or window protocol is best to take HTTP (it can be proxyed and scaled, it will then be easier to access such an API from other applications when system development is needed). But normal HTTP is a one-way flow of requests from the client to the server, and it may turn out that the task also needs a reverse flow, from the server to the client, for example, to transmit events that occur on the server if they were caused by other users or server tasks. To broadcast events, you need a connection-oriented protocol, i.e. one where communication is maintained for a long time and the server can send a message without a request, i.e. so that the client does not have to ask the server every 2 seconds if there is already some data. SSE (Server-Sent Events) is suitable for this, this is an extension of the HTTP protocol, but it is one-way, from the server to the client, and the client must send all its requests separately by making HTTP GET / POST requests. You can also use WebSocket, it is two-way, and through it you can arrange data exchange in both directions, but SSE is much easier to implement and I recommend it. Now you need to organize the API on the server, I advise Node.js for this, this is my choice, and I explain the reasons herehabrahabr.ru/post/204958 Well, choose a DBMS, from relational I recommend PostgreSQL www.postgresql.org and from object (document) MongoDB https://www.mongodb.org/ Well, if all the components are suitable, then here is my application server , in which I have already collected all this habrahabr.ru/post/247543

S
Saboteur, 2015-07-15
@saboteur_kiev

The client and server communicate in any way they like. It is possible to establish communication through mail, and through other protocols, not ip.
If you need the server and client to communicate over the Internet, as in websites, communication by IP address and port will be enough.
Read about the API and its implementation for web technologies.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question