Answer the question
In order to leave comments, you need to log in
How do applications eventually communicate with the database server, pass the query text to it, and get the result?
That is, what is under the hood api that are provided for different languages. If possible, a link to an article or book where this can be described. Tried to find in documentations of different relational DBMS, but did not find
Perhaps there is some protocol?
Answer the question
In order to leave comments, you need to log in
The direct connection of the application to the database that you are advised above is possible, but not secure. An attacker can extract connection data from the application and execute arbitrary queries in the database.
The normal practice is to use the API. For example, hosting has a database. Scripts are also placed on the hosting to interact with the database (in php or js, it doesn’t matter). These scripts receive information from the outside and execute certain queries to the database. Those. they should return strongly typed information for strongly typed queries. This is called the API.
The application sends a request to such a script. The request usually contains a token that confirms the legitimacy of the user. The script determines what actions need to be performed, and after receiving data from the database, it sends a response to the application (for example, in json format). Further, the application already uses this data according to internal logic.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question