Personal Project Architecture Advice.
Hi All,
I am working on a personal project and could do with a little peer review/feedback.
The project is a Media sorter(family photos and videos) it is built in c# and I am using the project as a chance to learn a bit more about microservice architecture and have fun building a little distributed system which eventually I want to tune to high performance and maybe even opensource.
The question is around collecting the EXIF/Metadata of the photos in question, for the system to be able to tag and organise photos based on “takenDate” I need to extract this value from the file(obviously)
A basic overview of my architecture is:
- “FileSystemCrawler” which will watch a local folder, and upload any new files it finds to Minio(S3 type “cloud” filesystem)
- Minio will then generate a new file message onto the event bus.
- “DuplicationService” will sub to this event and check if the file is a duplicate (based on the meta data/SHA checksum)
- “CatalogService” will then take a record of the files
The thing I am undecided on is which service would be responsible/Best to parse the EXIF/SHA checksum?
The options I have are:
-
The “FileSystemCrawler” could parse this, and then include it in the Additional meta data field passed to Minio... I like this idea because it removes the need to pull the file back from the Minio and a service needing to hold the file in memory to parse the meta data… I do not like it because it feels like the service is doing too much!
-
The “duplicationService” reads the EXIF data and generates a SHA hash during its checks for if the file is a duplicate or not.
-
Adding an additional service called “MetaDataParsingService”(Or something like that) This would involve the “FileSystemCrawler” just parsing the SHA checksum and including it with the file upload. The “duplicationChecker” would validate if the file is a duplicate based on the SHAchecksum and if the file is found to not be a duplicate its EXIF data will be parsed and stored(this does require pulling the file over the network to the service though..) This breaks the EXIF functionality into a different service, but it also adds quite a bit of complexity to the whole architecture.
Mainly I am concerned about network traffic, pulling back 20MB RAW photos, and potentially video files which could be 2-3GB big.. seems to be something which should be done while the file is still on the local filesystem… I just hate the idea of having all this functionality in the “FileSystemCrawler” service…
Your views would be really appreciated!
Posted Aug 21, 2020, 7:46 AM UTC
Personally, I'd add it as an additional feature within the file system crawler. At the point at which the file is uploaded, you're already 'opening' and reading the file to send the contents. Adding an extra function there to parse the metadata and send as one packet to Midio seems the most logical to me.
Good arguments for doing it in the other places as well, but that seems he most logical.