Hello,
I'm writing a blog in Python and have come to the point where I have to decide on the URL scheme to use. It's tempting to just list the entries start to end, like:
http://myblog.com/1
http://myblog.com/2
...
http://myblog.com/1568
And on the server side I would just have the blog entries in a python list. My fear though is that it will become slow to traverse to the requested entry as the list grows. I don't know how big (as in memory) the entries will be so I can't store them in a lower level array (if there even is in python) or fixed size table of any sort.
The other option I'm thinking of is to prefix the entry URLs with a year:
http://myblog.com/2010/1
http://myblog.com/2010/2
http://myblog.com/2011/1
I guess this speeds things up as I could store the entries in a tree structure:
entries = {
'2010': [entry1, entry2, ...],
'2012': [entry1, entry2, ...]
}
How would you do it? I leave the discussion open as I'm interested in how people think here.
Thanks!