0

I need an application which reads some tables and generates some new data from the data read and save it to another tables. It is like: I have a database which gives me information about some clients that comes from one application. According to this information I might create some alerts about the clients in order to show it in another application.

I have got a service which generates the first data, it works fine, it was not developed by me and I do not have to worry about that . But I created a windows service to read and create new data and it uses DataSets like "temp" tables and for communication with database and at the end of the process, everything is saved in database at once, using tableAdapter.update();

I would like to improve this windows service because DataSets do not seem the best option in my point of view and I have studied about Entity Framework and its advantages, but I am not sure if it is the best way to build a windows service. What are the best practices for building an application like that? What is the best way not to go to database every record generated, but save a bunch of records and keep it in memory before? I mean, like to have temp tables in runtime and at the end of process, save everything generated.

1 Answers1

-1

Your question is too broad for SO and it will most likely be closed. I will specify a few tips to get you started. Try them and come back with specific questions (written code, specific errors etc.)

  1. DataSet vs. EF - before code refactorization, take a look here, to see pros and cons of each way. For a simple application (service), it might not be needed at all

  2. Caching - avoiding multiple reads/writes to/from database can be achieved through caching. One way to go is HttpRuntime.Cache as explained here. Don't worry about the Web in the namespace, it can also be referenced to be used in non-Web applications, as explained here.

However, when dealing with caching you should be much more careful to what information is lost if the service stops suddenly.

Community
  • 1
  • 1
Alexei - check Codidact
  • 22,016
  • 16
  • 145
  • 164