After reading several of the hits on a quick google search, it seems there is not a whole lot of consistency when it comes to determining average URL length.
I know IE has a maximum URL length of 2083 characters (from here) - so I have a good maximum to work with.
My concern is that I am writing a URL-shortener in PHP (similar to some other questions on SO), and want to make sure I am not likely to exceed the storage capability of the server hosting it.
If all URLs are the IE maximum, then 2^32
won't fit comfortably anywhere - it'd take 2K x 4B ~= 8TB
of storage: an unrealistic expectation.
Without adding-in a trimming function (ie, purging "old" shortened URLs), what is the safest way to calculate storage usage of the app?
Is ~34 characters a safe guess? If so, then a fully-populated (using an int
type for a primary key) database would chew 292GB of space (double 146GB for any meta data that may want to be stored).
What is the best-guess for an application such as this?