????TAG??
????tag????????????????????????????????????????????е????????????????????????????redis????????????
??????????????????
?????????????book??????????tag???????????tag????????????tag??
????mysql> select * from book;
????+------+-------------------------------+----------------+
????| id   | name                          | author         |
????+------+-------------------------------+----------------+
????|    1 | The Ruby Programming Language | Mark Pilgrim   |
????|    1 | Ruby on rail                  | David Flanagan |
????|    1 | Programming Erlang            | Joe Armstrong  |
????+------+-------------------------------+----------------+
????mysql> select * from tag;
????+---------+---------+
????| tagname | book_id |
????+---------+---------+
????| ruby    |       1 |
????| ruby    |       2 |
????| web     |       2 |
????| erlang  |       3 |
????+---------+---------+
????????????????????????ruby????web??????鼮?????????????????????????
????select b.name?? b.author from tag t1?? tag t2?? book b
????where t1.tagname = 'web' and t2.tagname = 'ruby' and t1.book_id = t2.book_id and b.id = t1.book_id
????tag???????2??????book?????????sql?????????????????ruby????????web??????鼮???
??????????????????????????Щ?????????
????redis?????
????????book??????????洢??????????????
????set book:1:name ”The Ruby Programming Language”
????Set book:2:name ”Ruby on rail”
????Set book:3:name ”Programming Erlang”
????set book:1:author ”Mark Pilgrim”
????Set book:2:author ”David Flanagan”
????Set book:3:author ”Joe Armstrong”
????tag????????ü??????洢?????????????ó???????????
????sadd tag:ruby 1
????sadd tag:ruby 2
????sadd tag:web 2
????sadd tag:erlang 3
???????????????ruby??????web?????
????inter_list = redis.sinter("tag.web"?? "tag:ruby")
??????????ruby??????????web?????
????inter_list = redis.sdiff("tag.ruby"?? "tag:web")
????????ruby??????web????????
????inter_list = redis.sunion("tag.ruby"?? "tag:web")
???????????а???
??????????2???????????????Щ????????????????????????????????????????????????????????о???????????????????о???
?????????????????????????????????????????????????????ddl(????????)?п???????м??????????????sql???ò??????м??????????????????????????????????sql?????????DBA????????????е?sql???????????????????????oracle??????????????DBA?????????????????MySQL????????ddl???????(?????????online ddl?????)??????????DBA?賿?????????????????????????????????????????????redis????????DBA????????????????????ɡ?
????δ????OLTP???????kv?????????????