1
1
1melnik2016-05-22 23:13:44
MySQL
1melnik, 2016-05-22 23:13:44

How it is more logical to make application architecture (client/server + DB)?

Good afternoon,
I'm starting to learn C #, now I'm trying to make a client-server application, which in turn works with the database.
The client requests data from the server, the server processes the data, reads / writes to the database.
At this moment, I want to do this: the tcp / ip port is opened in the main thread and the client connection is waiting in the loop, as soon as the client sends a connection request, a new thread is created that processes the request, then work with the database starts in the same thread and returns the answer, after the answer the stream is beaten.
All work with logic, sessions and other things is done through the database.
I wanted to ask if such a scheme is logical? Or is it better to do something differently, for example, a child client thread creates another thread and works with the database in it.
Thank you!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
NeoCode, 2016-05-22
@1melnik

Yes, it seems to be the simplest standard scheme. Why create another thread to work with the database, if the main thread still needs to wait for the completion of work with the database to give a response to the client?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question