> If someone deletes their image, read the filename from the 
> database and delete it from the server.

If you're worried about ending up with thousands and thousands of images
in a single directory (which slows down seek times the further you go
through the list, and hence read times), you can always break that up.

What I've done is create a UUID for an image, then split into
directories based on the first four characters of that UUID.  So it
means I get the following sort of directory structure:

8B5F/
    8B5F0DD6-8A11-29EE-1465E040BDFCB1F7.jpg
    8B5F25C3-8A11-29EE-14B2A7C86802D979.jpg
    8B5F4CF2-8A11-29EE-131CFD1D6180E087.jpg
8B61/
    8B61CA53-8A11-29EE-15FCE78482A034A5.jpg
    8B61E944-8A11-29EE-1811DBF7A8720ECC.jpg
8B62/
    8B620EAE-8A11-29EE-1968B90B32DE205E.jpg

The increase in speed of this is all to do with the tree structure --
for trees with a lot of nodes (files) it's faster to have a "wide tree"
(i.e. a/b/c/def.jpg) rather than a "tall tree" (all data in one or two
directories).  It's quicker to search through 200 entries in one
directory, followed by 300 in another, rather than just going through
60000 in one directory.

Tim.

--
-------------------------------------------------------
Badpen Tech - CF and web-tech: http://tech.badpen.com/
-------------------------------------------------------
RAWNET LTD - Internet, New Media and ebusiness Gurus.
WE'VE MOVED - for our new address, please visit our
website at http://www.rawnet.com/ or call us any time
on 0800 294 24 24.
-------------------------------------------------------
This message may contain information which is legally
privileged and/or confidential.  If you are not the
intended recipient, you are hereby notified that any
unauthorised disclosure, copying, distribution or use
of this information is strictly prohibited. Such
notification notwithstanding, any comments, opinions,
information or conclusions expressed in this message
are those of the originator, not of rawnet limited,
unless otherwise explicitly and independently indicated
by an authorised representative of rawnet limited.
------------------------------------------------------- 

--
These lists are syncronised with the CFDeveloper forum at 
http://forum.cfdeveloper.co.uk/
Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/

CFDeveloper Sponsors and contributors:-
*Hosting and support provided by CFMXhosting.co.uk* :: *ActivePDF provided by 
activepdf.com*
      *Forums provided by fusetalk.com* :: *ProWorkFlow provided by proworkflow.com*
           *Tutorials provided by helmguru.com* :: *Lists hosted by gradwell.com*

To unsubscribe, e-mail: [EMAIL PROTECTED]

Reply via email to