How to organise data

Asked

Viewed 51 times

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 programmer", where I indicated the time, the type of database (Mysql, SQL Server) and the Connection string itself. The problem now is the access part to these settings. While I could do BD querys from second to second to see if I have any backup to do, I don’t want to do it since in my opinion it’s a lot of "useless" load in the BD. So the option is to create something like an array, list, dictionary. A cache. Where you would store everything you needed.

Perhaps for lack of experience, all that comes to mind is dictionaries with lists and dictionaries or srtings with the information from minute to minute will be analyzed the search for information, that is, everything at random.

Here are a few 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 I passed on the idea.

What then is a good "way" to store this data?

1 answer

1

I understand that you would have a JOB that would run x in x time to check if it was running a task. What would this interval be? If it’s longer than a minute, without thinking too much, I’ll tell you that the best way would be to select in the database. Anyway, the database is already optimized for this, including creating internal caches and controls. I don’t see how a problem run this database query.

I understand that you may have some more limitations 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.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.