I chose file/folder system for my office-managing-site (1M workers throughout USA and Brazil) which was my first project (as a job).
Actually it was the most irresponsible but luckily most suitable decision I took ever since.
To deal with this file system I made a php function set as well to simplify stuff. Things I consider to make those functions were:
- Creating table file (like csv)
- Creating folder containing those files,
- Letting repeat a function for each row in a selected file,
- Letting change / delete selected column/row data in a selected file iteratively
- And save binary files as separate files
That's all.
But when using it I had to think about optimizing so much. For example when it comes to last seen of someone..
When someone X
user want to see lastseen
of a some other Y
I made a folder called dataRequestingCluster
and under X
which contains everything that X
wants to see last seen (maybe X
's friendlist if X
is viewing his friends page) and added that cluster in to Y
's last seen table (which contains all "Y
's last seen requesters separate clusterFiles" and updates every time Y interact with server)
And then added a mechanism to remove dataRequestClusters when not used for 3mins (WHEN X Leaves his friends page no need to update last seen for him)
I had to follow this approach because updating last seen in the ALL_USERS File is a complete joke when it comes to time.
Most important thing is this method is way faster than using a database system with MySql ... But you have to use the brain and 30% more time but happiness and completeness ibatined by this is awesome
This is just a one case "last seen"
So many times I used different algorithms to succeed each problem and it was always efficient than sql/ db system.
Conclusion: File systems make stuff complex but its the only way to improve the quality in a shocking way...if you are not good at thinking or have less time or you are not interested about what you do you should probably go SQL/DB system.
After 6 months my server data storage became 20GB (Without media files.. just user info ) but any individual file never exceeded 200kb.. it was amazingly successful with least time for processing.