What kind of versioning are your referring to? I know some databases has it but not sure if I understand it.
Personally I use S3 or similar for this. At the number of files I'm working with storing it in a relational database would be crazy expensive.