When we upload any photo to Facebook it is renamed by Facebook. The new name generally has the following pattern: 393268_10151029983750034_598680033_21778114_899520598_n.jpg
This name can be split with underscore in 6 parts.
I have the following questions regarding this naming convention:
I don't really know how exactly they handle this naming scheme, but I suspect it has to do with their storage.
Facebook uses a database named RocksDB, on top of a MySQL fork (Created specifically for this database), which is called MyRocks.
They used MySQL until 2012, but then switched to a No-SQL type of because of their 'unique needs'.
RocksDB can only store key-value pairs, and then the data structure must be adapted for this, hence, if you cant have the user's ID in a table, and the photos belonging to that user in other, they can be bound via normalization, which in this case prioritizes speed over storage size.
The advantage of such a system, would be speed, as you save the overhead of a traditional join by calculating beforehand the exact name of every piece of data you want to query.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With