2
I am developing a robot that reads all lines of various files contained in a folder. But I need to know which was the last file and line read so I can resume when I need to.
I thought I’d put it in the database, but assuming I have 10 million+ lines, it wouldn’t be cool to keep updating all the time. Then I got the idea to insert it in my configuration file.
<appSettings>
<add key="LastFileReaded" value="xpto1.sql"/>
<add key="LastLineIndex" value="29990"/>
</appSettings>
But taking into account this approach would need to update these values, the question is:
Looking at it semantically, is it incorrect to use this approach? And how would I update the value of that key directly on the web.config or app.config?
Asked 50sec ago, the person neither reads or criticizes and already negative rsrs
– Leonardo Bonetti
I don’t quite understand, you’ll get "+10 million lines" and prefer to save in a configuration file that in a database, which already has its own structure to manage millions of reads/writes?
– Ricardo Pontual
Ricardo I have several SQL files and I will receive all the lines(INSERT) the idea would go through and go running to the end so I need to store... You recommend me manage via database?
– Leonardo Bonetti
humm understood... in your SQL files comes the command ready (
insert...
) or the data comes and you have to assemble the commands to execute?– Ricardo Pontual
It makes more sense to persist this information in the database... Create a table with this information and keep updating as the execution. Then consult her when executing a new routine
– Leandro Angelo
@Ricardopunctual already comes the ready commands, but I can’t run SQL directly because they are GIANT files
– Leonardo Bonetti
got it, just one more question: which database are you using? maybe a Bulk Insert work better, faster and performative
– Ricardo Pontual
Mysql, I just need to store an index and a filename...
– Leonardo Bonetti
published a reply with a suggestion, use the configuration file, but an alterative file
– Ricardo Pontual