sql server - SQL Design - How to store large amount of URLs -
i'm writing application have sql server backend store (among other things) urls. urls mapped users, , urls may common between different users. in absence of true dba, i'm trying design solution can handle hundreds of thousands of urls efficiently possible.
ideas:
create table has id, url
pro: simple, complete.
con: duplicate entries url exist cause table larger needs be.break user , urls separate tables. 1 table containing
user id
, ,url id
. tableurl id
,url
itself.pro: single url in system, seems more "enterprisey"
con: must join 2 tables when trying pull results, , not sure benefit of approach is?expand on 2 idea, except break up. have table domain, path/query string. then,
user
table haveuserid, domain id, path id
.pro: urls share data if unrelated (meaning,
cnn.com/helloworld
,nbc.com/helloworld
have different domain ids, same path ids.. seems useful when running metrics later?con: seems nightmare performance perspective (again, because joins necessary pull url.
any thoughts?
i following in design:
userid urlid 1 1 2 2 1 1 urlid url 1 http://www.google.com 2 http://www.yahoo.com
storing urls in seperate table , creating new entry in url table, if exact match not exist. if have lot of common urls, save space. take step farther , add third table mentioned, e.g.
urlpathid urlid urlpath 1 1 /shopping
...and tieing urlpathid user table. , perhaps further:
urlpathid urlid urlquerystring 1 1 ?product=speakers
...and again, referencing user table.
Comments
Post a Comment