mysql is only used to store metada:
- who has permission to see / do what
- what images are in what album
- item comments, descriptions, titles, ..
- all but binary image data
on the disk, we store the binary image data, the files.
reason:
the database is already the bottleneck for most database based applications and using it to store a lot of binary data would increase the load and resource usage on the database server dramatically. that is not specific for g2, but a quite general statement.
the filesystem on the other side is predestined to store ... files. that's why.
why use a database at all then?
for performance / scaling. without a database, you can't create a photo album management application that scales well with a lot of users, albums, photos, permissions.
besides: you wouldn't save any webspace on your server if you stored the files in the database. you'd just use diskspace for the database instead.