mysql - Best way to store U.S. phone numbers ( NANP) -


i have requirement store nanp(north american numbering plan) numbers. means don't care , no need bother international numbers.

numbering plan goes : npa-nxx-xxxx

i filter & strip space or dash(-) make 10 digit correct format. use mysql , couchdb other stuff prefer keep in mysql db preferred storage system. i'm looking fast read operation match numbers during runtime , write can little slow insert/update happen in off hours.

since given npa & nxx never start 0 if can separate them , can used integer type in case of want breakdown.

for nosql case, possible generate separate document each area code , further isolate nxx & xxxx. rdbms case, full number can stored indexed integer fast accessibility.

what best database design store these numbers ?

thanks in advance.

i'm looking fast read operation match numbers during runtime

with couchdb can store every number id of doc e.g.

{   _id: "npa-nxx-xxxx",   _rev: "1-..." } 

to match number send lightweight

head path/to/couchdb/dbname/npa-nxx-xxxx 

and respond statuscode 200 (has matched) or 404 (no match).

write operations can done in big bulks (/dbname/_bulk_docs).

because numbers stored id's primary index of couchdb can used head requests (as described above) - means every write available reads.


Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -