Search code examples
c#sql-server.net-4.0client-serverlan

Client sends informations to server and saves to database


In my C# app client should send logs to server and the same logs must be save in SQL Server database. How should I do this:

  • client saves log in DB and server read from DB - rather not (long delay)
  • client saves log in DB and simultaneously sends them to the server
  • client only send to server and server saves them in DB

which way is more correct?

EDIT
There's many clients in the LAN network


Solution

  • Have the client communicate only with the server. The server would analyze the information from the client. The server then writes the information to the database and/or takes action on the client. This way you get the ability to immediately act on the client and save the information in the database for possible use later. It also makes sense because then only one computer is able to write to SQL instead of your many clients all writing individually...