Unless there is a good reason, I think in that situation I would probably try to avoid storing those tens of millions of small json files directly on the filesystem. For example : have you considered storing that data in jsonb/postgresql
https://www.compose.com/articles/faster-operations-with-the-... ? (or even just in an sqlite db
https://www.sqlite.org/fasterthanfs.html )