directory-structure


Ideal directory structure for web application


I'm about to create a user based website and will have to store photo, docs and other data for each user.
If I take a silly number like 1 000 000 000 users, I believe than one folder with 1 000 000 000 won't be the fastest thing in the world! So I was thinking of creating something like
1st level : [a-z]
2nd level : [a-z]
3rd level : [a-z]
Therefor bobby will be in /b/o/b/by
But this also mean that it won't be spread equaly, because there will be very few user starting with a z and many more with a m,s,l ...
so I was thinking of using a user id
such as "000000000001", "000000000001" etc...
1st level : [000-999]
2nd level : [000-999]
3rd level : [000-999]
therefore data of the user 000000000001 will be store in /data/000/000/000/001
then I will be sure to have a maximum of 1000 folder in each level.
What do you guys think about it, what I should do or not do ?
The server will be running Centos 5.4 with EXT3 on raid 1, if the I/O get's too bad
i will probably go for a raid 10.
A hash function provides a way to distribute large amounts of data across an easily searchable structure.
See this related question: Why use hashing to create pathnames for large collections of files?
And also try looking through Google results for Directory Hashing.

Related Links

can I place the js,css,images files under resources folder and place this resource folder under src/main/webapp folder?
VMS directory issue
SaltStack: Use directory as source only if it exists
Is it safe to clone a git repository into its own .git directory?
CAB Files MAKECAB.exe Way to store directory structure
how do I create the URL “m.mysite.com” from mysite.com?
URL structure for inner pages?
Ideal directory structure for web application
Development directory Structure [closed]

Categories

HOME
keras
minimum-spanning-tree
tesseract
sqlite-net-extensions
amazon-ecs
python-unittest
dax
google-cloud-ml
windows-azure-storage
jplayer
visual-studio-2005
pc
finite-automata
google-static-maps
oracle-coherence
reverse-proxy
mps
angular2-aot
xpages-ssjs
javacv
bootstrap-duallistbox
fopen
strncpy
maquette
sql-server-2012-express
javascriptcore
http-status-code-503
siesta-swift
pim
force-layout
android-ble
theano.scan
hue
leading-zero
bootstrapper
node-gyp
estimote
total-commander
node-sass
long-polling
dotcover
datastax-startup
powercli
rdfs
gabor-filter
forever
python-cryptography
orthogonal
pycaffe
log4c
slicknav
gstreamer-0.10
disque
prettytensor
hover-over
bgp
design-by-contract
uid
srand
prerequisites
mutation-observers
pundit
quicklisp
streambase
python-green
rdtsc
client-side-templating
zend-route
project-planning
rebol3
valueconverter
valuechangelistener
html5-notifications
padarn
mylyn
comaddin
mhtml
browser-detection
chuck
isnullorempty
qtkit
dotnethighcharts
amazon-appstore
doh
infobox
celltable
coda-slider
rescale
brewmp
javap
virtual-functions
procedural-music
putchar
genealogy
w3wp
lzh

Resources

Encrypt Message



code
soft
python
ios
c
html
jquery
cloud
mobile