I have a central file that gets pushed to a server regularly. The file is very large.
I also have a couple hundred observers that need to be alerted when a change has been made to said file.
However due to certain requirements the notification mechanism involves accessing one large file per observer and modifying a flag on it to alert the observers there was a change. So in essence the observers are all observing their own separate notifier, which is alerted by the singular subject.
I am concerned about scalability of this solution, particularly with PHP as the medium.
The files to which the observers are subscribed are around 7 MB each and will continue to grow over time.
Even though we are only changing a flag on said file (per observer), the flag update process involves parsing the text file into json updating the flag then rewriting the file to the server
At what number of observers will this become an issue on the server?
I know a better solution would be to have a centralized singular file which gets updated to which all the observers listen but that is not possible due to requirements.
Is there a better solution short of using a database for the flag setting?
Aucun commentaire:
Enregistrer un commentaire