How to organize data

0

Good.

I have a question, not so much about code with data organization.

I have a small automatic backup application and the idea was to have a "task scheduler", where I indicated the hours, the type of database (MySQL, SQL Server) and the connection string itself. The problem now is the access part of these settings. While I could do querys the BD from second to second to see if I have any backup to do, I do not want to do it since, in my opinion it's a lot of "useless" load in the DB. So the option is to create something like an array, list, dictionary. A cache. Where would I store everything I needed.

Perhaps because of lack of experience, all that comes to mind is dictionaries with lists and dictionaries or srtings with minute-by-minute information will be analyzed looking for information, that is, everything in the pipeline.

Here are some examples:

[hora][tipo][connectionString]
[14:00:00][MySQL][server=127.0.0.1;uid=root;pwd=12345;database=test]
[14:15:00][SQLSERVER][Server=myServerAddress;Database=myDataBase;User Id=myUsername;
Password=myPassword;]

I hope to have passed the idea.

What is a good way to save this data?

    
asked by anonymous 18.01.2018 / 14:02

1 answer

1

I understand that you would have a JOB that would run from x to x time to check if it is time to run a task. What would this interval be? If it is more than 1 minute, without thinking much, I already tell you that the best way would be to make a select in the database. Either way, the database is already optimized for this, including creating caches and internal controls. I do not see a problem executing this query on the database.

I understand that you may have some limitation to want to use this strategy, such as application server and database server on different networks, already overloaded database servers, and the like. But my opinion is that the most optimized way to store constant access information is a database. Any config file solution, xml, structured text, will bring you more development and risk to the application, besides the difficulty of maintaining these settings.

    
18.01.2018 / 14:55