I have a set of database documents (a few thousand) for which I would like to run some data migration activities. Each of these documents holds a reference to a different file in a Windows filesystem. These files are stored in a file server that is accessed through a shared folder. What I would like to do is to move the files to a different location in the filesystem, rearranging them based on properties in the documents.
I have thought of the following design:
- Have one actor that queries the database and that spawns one actor per document
- Each of these actors would be responsible for copying their related file to its new location, and of handling any exceptions
- When each of these actors finishes its task, it will inform a central actor of the outcome (success / failure)
Is this a naïve design? Should I throttle how many actors are created, or does Akka regulate the assigned resources based on processor availability? Could there be any problems on the filesystem side, having too many requests active simultaneously?