I want to create an application using php and mysql.
Assume i am making api call and getting a list of urls.
I want to store those urls and each url should have one uniqe id( ie. number) so that i can pass that id to some page and I can get url from my db.
Assume i made a api call got five urls for keyword “xyz”
and i got following urls and respective titles
google.com/abc1.html title1
google.com/abc2.html title2
google.com/abc3.html title3
google.com/abc4.html title4
so i want to generate a unique id of each url
like
id1 google.com/abc1.html title1
id2 google.com/abc2.html title2
id3 google.com/abc3.html title3
id4 google.com/abc4.html title4
constraints is url should be unique
database can hold around 12Lacs urls.
can you please guide me how to implement that?
also give some optimization guide lines
Thanks
12Lacs = 1.2 million, right?
For that you can use a regular unsigned integer with auto increment;
An unsigned integer can hold a value up to 4 294 967 295.