# Building own media library - php mysql - performance

**URL:** <https://forum.kirupa.com/t/building-own-media-library-php-mysql-performance/328810>\
**Category:** programming\
**Created:** [June 19, 2012, 1:22pm UTC](https://forum.kirupa.com/t/building-own-media-library-php-mysql-performance/328810 "2012-06-19T13:22:49Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jerome\_chevreau](https://avatars.discourse-cdn.com/v4/letter/j/53a042/32.png) [@jerome\_chevreau](https://forum.kirupa.com/u/jerome_chevreau)\
**Post date:** [June 19, 2012, 1:22pm UTC](https://forum.kirupa.com/t/building-own-media-library-php-mysql-performance/328810/1 "2012-06-19T13:22:49Z")

</div>

Hi there,  
I was wondering if anybody could give me some tips and hints when building my media library.  
For the moment, i keep reading my folder and sort the whole arrray to get tree structure.

but it is a bit slow and i would like to rewrite it to gain more performance.  
will it be better to store the whole folder tree within the DB and from the db read i go ahead thus avoiding me to always perform a folder read??  
other action copy, move, rename, delete go to folder then Db update.

thanks for all the help,  
will really apreciate it,

Jerome
