??????????? Square ??????н???????????????????????
????????????????????????
????????????????????????????
???????????????μ??????
????????????????????????????????????????????????о????????????????????????——?????????????????????????????????? ?????????????????????е?????????????????????????????????o??????????????????????????????????????????????????????????????????????????????? ??????????????????????????????????????????????????????????????????????????????????????????????ó??????????????????????????ó????? ???????????????????????????????????????????????????????????????????????????????????? Java??Python?????? Ruby ??????????д????????á????????????????
??????????????????????
?????????????????????????
??????????????????????????ι??????
??????????????????
??????????????У??κν?????洢??????????????????????????????????????? RDBMS ?? NoSQL ?????????? Apache Zookeeper ?? Kafka ?????????
????CAP ????
????CAP ?????????????????????? P≠NP ?????????????????????????????CAP ??????????κη???????????????? CP??????? & ????????????? AP ???????? & ????????????????????????????????????????????????к????????????? ????CAP???????????????
?????????“?????”?????????????????????????????????????????ζ??“?????????е???????????????”????????????????£?????????????????????
???????? CAP ??????????????????????к??????????????????μ?????????????????????????? CAP ?????????????????????????
??????????
??????????????????????????????????????????????????????????????????
????????????????? —— ???????洢??????????
???????????????? —— ????????????????????
???????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????
??????????Ч??
??????????Ч???????????????????????????????????????????? ???κ????????????????????????????????????????????????????1???????洢???????????????????????????????2??????????????????software stack?????????????????? ????????????????????????????????????????????о?????μ????塣????????????????????????????£?????Ч???????????????????????????????д??ó????????? ?????????????????????????????????????????????????????? Paxos ?????????????????????????????????????????????ε??????????????? Redis ?? ElasticSearch ?????????????????????????????????顣 ?????????????Ч????????????????????????????????????????????????????????????????ж???????????raw operations?????????????£?Ч?????????????????????????????????????????????????????Ч????????????????????£???????????????????????????? ???????????Э??????????????????????????????????е?????????á? ????????????????????????Ч????????????????????????ó????????
?????????? ?? ????????? [2]
????????????? ?? IO ?豸????
???????????
??????????????????????fork??execv??malloc??
?????????в????κε??Э?????????????????????????????????kernel hacker?????????????????Щ??????????????????????
????????????
???????????????????????????????????????????????????????????????????????????????????Ч????????ó???????д???????????????????? ??????????????????????????????????????? RDBMS ??????????ACID ?????????????????????????????? RDBMS ???????????????????MySQL ?? Postgres ????????????? ?????????????????????????????????????????????Щ?????????????????????????????????????????????????Lucene ??????????????Solr??ElasticSearch??????????? ??????к??????????????????Щ??????????Ч???????Kafka??Storm??Spark SQL??RabbitMQ ?? Redis ????????? ???п??????????????????????л???????????????????????к?????????? Cassandra ??????????????? ??????leader ????leader election?????????????????????????????????????????? Zookeeper ??????? raft ??? ????????????????????????????й???leaky abstraction?????????????????????????????????????????????????????????????????????????Щ??????????
?????????????????????????????????????[3]?? ??Щ???????????μ????Щ??????
???????????????α??洢?????????Щ????????Ч?????Щ??????Ч???????????????滮??query planner????????????????????????????
?????????????????????????????????з????????????????????????????????????????????
???????????????????
??????????
???????????????е?????????????????????????24*7?????ж???? ?????????????????????? ?????????????????к??С????????????????????????????????3???????????????????籩??????????????????У?
?????????introspect????????????????
????????????????????
?????????????????????????????????????????????????????????????????????????????????????
?????????е?????????????С?????????????????????????????????????е????????κ???????????????????????????????????????????????????????????????????????????????????????????
?????? MySQL 5.6 ??????????????????????????????? pt-online-schema-change ????????????????????MySQL ?????????????????
????Cassandra ?????????????????????????????????Щ???????????????????????????????????
????????????????滻??????????????????????????????????????????????????????????и???????????????????????[4]???????ó??????????????????????????????????????????????????????á?????????洢?????????????????ó?????乲?????????????????????????????????????????????? ????????????????????????????????/???????????Щ?????????????
??????ó??????ū????????? Bug ??
??????????????????????????????????д??????
???????????????????? —— ???磬?????????????????????????? shard ??????????л???compare-and-swap??????????????????й?????
???????й??? —— ?????????????????????????????
???????????[6]??
???????Ч? —— ???????????????????????????
???????????? —— “??????????”??“?????????”??“?????????????”??“?????????????????????”??
??????????Щ???е????????????????????????????????????????? SLA ???????????????????????????Щ?????
??????ó?????????????????????????????
??????д????е??????ó???????????????????????????
????????????????????????????????????????????????????????????DBAs??????????顣
????PS:?? Square ????????????????????????洢??ODS????????Щ????????????????????
???????????????
??????????????????????????檔?????????ingestion??????????????????????????????????????????????????????????????Щ???????????? —— ?????????????乲??????????????? ???????????????????????е??????
??????????????????
??????Χ????????? LSM ????
?????????????????Kafka??HDFS??
?????????????????????????????? SQL?????????????????????????????Ρ?????????????????????????е?????? ???????????????B-trees?? hash tables???? LSM?? (log-structured-merge-trees)????????????????????????洢?????е????????????????Щ????????????磺????????????LSM ??????????е???????????BigTable??HBase?? Cassandra?? LevelDB?? ??? RocksDB ?ж?????????????д?????????????????? ?????????е???????????????????????? Paxos?? Raft?? ????????? Quorum ??/д?? Merkel ???? ??? Vector Clocks ?????Щ???????????顣