D
D
Denis2021-03-05 12:40:08
SQL
Denis, 2021-03-05 12:40:08

How to interact with a database located on a server from a desktop application?

I have a C# application, an Ubuntu server, and a database on that server. What to read about to understand how I can interact with it from the application?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vasily Bannikov, 2021-03-05
@vabka

In a good way, you need to make another web application that will give access to data through the HTTP API.
Since you are already familiar with C#, you can make it on asp net core.
Then from the client it will be necessary to make HTTP requests to this apishka using HttpClient.
Another option (bad, IMHO) is to release the database to the Internet and connect directly to it, but this is not safe in multi-user applications.

V
Vladimir Korotenko, 2021-03-05
@firedragon

My answer is interact directly.
Any modern engine provides the ability to connect using a certificate, however, you can generally throw a connection through a VPN (probably the best solution). And the third is a crutch in the form of a service that you were advised.
I'll go through it separately, why it's TERRIBLE.
1. An extra point of failure, and this is not a proven solution, and all support will always be on you
2. Ping, his majesty ping, you will always have it, roughly speaking, for each request + 160 ms do you need it?
3. Overhead for packing unpacking data. xml, json, grpc, soap inflate your data many times why??
4. Data repacking. In the simplest case, you hang up a SqlDataSource and get all your tables, in the case of others, you need to make a DataAdapter do you need it?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question