丸山å
çã®ã¸ã§ãã©ã«ã»ãã·ã§ã³。å
容çã«ã¯Eric Brewerã®è³æ(CAP Theorem/Eventually Consistent)ãã¯ã©ã¦ãã®ç«å ´ããçºãã、ã¨ãã£ããã®。
Scalabilityã¨Availability
Scalabilityã¯、Scal-outã«ãã£ã¦éæã§ããã、Scale-outã«ã¯æè¡çãªè£æã¡ãå¿ è¦ã§ãã、ãã¦ãã¦ã®èç©ãå¿ è¦。
Availabilityã¯、æ éã«å¯¾ããé©åãªå¯¾å¦ã«ãã£ã¦éæã§ããã、ããã«ã¯è¤è£½ãä½æããæ¦ç¥(Replication)ãåºæ¬ã«ãªã。è¤è£½ãä½ã£ã¦ãã¾ãã¨、åæã®åé¡、ããªãã¡ä¸è²«æ§ã«é¢ããåé¡ãçºçãã。
[ã¡ã¢]
CAPå®çã§è¨ãã¨、ScalabilityãããããPartitionã«、Availabilityããã®ã¾ã¾Availabilityã«、ä¸è²«æ§ãConsistencyã«ãããã¨èãã¦ããã¨æã。ä¸è¨ã¯、ã¯ã©ã¦ãã«ãããCAPã®é¢ä¿ããããããã説æãã¦ããã¦ããã¨è¨ãã。
Partitionãå¿ é ã¨ãªãèæ¯
High-endã³ã³ãã¥ã¼ã¿ã¨Commodityã³ã³ãã¥ã¼ã¿ã®ä¾¡æ ¼æ§è½æ¯ã¯、ç´1:33。çµæ¸çãªé¸æãããã¨、å¿ ç¶çã«Partitionãé¸æãããã¨ã«ãªã。å®ããã¼ãã¦ã§ã¢ã¯ãããªãã®è½åããæããªãã、é害ã«å¼·ãã½ããã¦ã§ã¢ã、å®ããã¼ãã¦ã§ã¢ãå½¹ã«ç«ã¤ãã®ã«å¤ãã。
[ã¡ã¢]
ãã ã、ããããèããã¨、Partitionã¨、Partition度åãã容æã«å¢æ¸ã§ãããã©ãã(=Scalability)ã¯、éã£ãç¹æ§ã®ããã«ãæãã。ã»ããã¼ã§ã、ä¸å£ã«ã¯ã©ã¦ãã¨ãã£ã¦ã、ãªã½ã¼ã¹ãåçã«å¢æ¸ã§ãããã®(Hot Scalable)ã¨ã§ããªããã®ã¨ã§ããªããã®(éçã«ã®ã¿å¯è½、Scalable)ããã、ã¨è¨ã£ã¦ãã。
CAPå®çã¨ã¯ã©ã¦ã
ããã¯、å ±æãã¼ã¿ãæã¤ã·ã¹ãã ã«ããã¦ã¯、Consistency, Availability, Partitionã®3ã¤ã®ãã¡、æ大ã§ã2ã¤ã®ç¹æ§ããæã¤ãã¨ãã§ããªã、ã¨ãããã®。
ã¯ã©ã¦ãã§ã¯Partitionã¯å¿ é ã«ãªããã、ConsistencyãAvailabilityã®ã©ã¡ãããé¸ã°ãªããã°ãªããªã。…ã、ãã®é¸æã¯ã·ã¹ãã å ¨ä½ã«ä¸å¾ã«é©ç¨ããªããã°ãªããªãããã§ã¯ãªã、ã¨ããã®ãéè¦ãªç¹。åä¸ã®ã·ã¹ãã å ã§ã、ã«ã¼ãã«ååãå ¥ãã段éã§ã¯Availabilityãåªå ã、注æã®æ®µéã§ã¯ä¸è²«æ§ãåªå ãã、ã¨ãã£ãããã«、é¨åãã¨ã«å¿ è¦ã¨ãªãç¹æ§ã¯å¤ãã。
ã¾ã、ä¸è¨ã§Availabilityã「åªå ãã」ã¨æ¸ããããã«、Aã¨Cã¯ã©ã¡ãããåãã°ããä¸æ¹ãå®å ¨ã«å¤±ããã、ã¨ãããã®ã§ã¯ãªã、Aã¨Cã®é åã«ã¯ä¸éçãªé¸æè¢ãæ°å¤ãåå¨ãã。ç¹ã«、Consistencyã«ã¯ããã¤ãã®ã¬ãã«ããã、ããã«ã¯ååãã¤ãããã¦ããããã 。以ä¸、çµåããã®ç¿»è¨³ãµã¤ãããã®å¼ç¨。
ãã®ãããª、ãªãã©ã¤ããã¼ãåé¤ã®æ©è½ã¯、å¾æ¥ãã¼ã¿ãã¼ã¹è£½åãæ ã£ã¦ããã®ã ã、ãããã¯æ¬æ¥OSãæ ã£ã¦ãè¯ãé¨å。ç¾æ®µéã§ãã®é¨åãOSãæ ã£ã¦ããªãã®ã¯、åã«æ´å²çãªçµç·¯ã«ãããã®ã ã¨æããã。å°ãªãã¨ãã¯ã©ã¦ãã®åéã§ã¯、OSã¨ãã¼ã¿ãã¼ã¹ã®çµ±åãã¯ãã¾ã£ã¦ãã。
ãã®ãããª、å³å¯ã«ACIDãæºãããªããããªæ°ããªãã©ã³ã¶ã¯ã·ã§ã³ã¢ãã«ãBASE(Basically Available, Soft-state, Eventually-Consistent)ã¨è¨ã。ACIDã¯ãã¼ã¿ãã¼ã¹è£½åãªã©ãæ å½ããæ¯è¼çå±å°çãªãã©ã³ã¶ã¯ã·ã§ã³ã¢ãã«ã§ããã®ã«å¯¾ã、BASEã¯ããå°ãåºã、ã·ã¹ãã ã¬ãã«ã®ãã©ã³ã¶ã¯ã·ã§ã³ã¢ãã«ããã。
Soft-State
åæ£ã·ã¹ãã ã«ããã¦、ç¶æ ãå®å ¨ã«å®ãããã®ã¯ä¸å¯è½。丸山å çã®èª¬æã¯ããããããªãã£ãã®ã§、ãããã§èª¿ã¹ã¦ã¿ãã¨、ãããªã®ãã§ã¦ãã。ã¹ãã¼ãã¨ç¶æ ããã¶ã£ã¦ããã®ãæ°ã«ãªãã、丸山å çããããããããã£ã。
Eventually Consistency by Example
ãã¦、ããã§、2ã¤ã®ã·ã¹ãã è¦ç´ (A, B)ãæã¤åæ£ã·ã¹ãã ä¸ã§、ã·ã¹ãã Aãèªèº«ã®ç¶æ ãæ´æ°ã、ãã®ç¶æ ããã¨ã«Bã®ç¶æ ãæ´æ°ããã±ã¼ã¹ãèãã¦ã¿ã。
極端ãªä¾ã¨ãã¦、ã·ã¹ãã è¦ç´ Aã¨Bãéæ²³ãã¾ããã§é¢ãã¦ãããããªã±ã¼ã¹ãèããã¨、å é度ã®å¶ç´ããããã、Aã®ç¶æ å¤æ´ã¨Bã®ç¶æ å¤æ´ãACIDã«è¡ããã¨ããã¨、使ãç©ã«ãªããªããªã£ã¦ãã¾ã。ãã®å ´å、ã¾ãã¯Aã®ç¶æ ã(ACIDã«)å¤æ´ã、ãã®å¾ã§Bã«ç¶æ å¤æ´ãéç¥ããã®ãç¾å®çã«ãªãã ãã。ãã®é、Aãéç¥ãéã£ã¦ããBã«å±ãã¾ã§ã®é、ã·ã¹ãã ã¯ä¸æ´åãªç¶æ ã¨ãªã。Bã«éç¥ãå±ããå¾ã¯æ´åæ§ãå復ããã¨èãããã¨ãã§ã、Eventually Consistentã¨ãªã。éã«ããããåä½ãåæã«ããã¨、ACIDãã©ã³ã¶ã¯ã·ã§ã³ãã³ã¼ãã£ãã¼ããããããªTransaction Managerã¯ä¸è¦ã«ãªã。
ããããç¶æ³ãç¾å®ã®åæ£ã·ã¹ãã ã«ãã¦ã¯ãã¦èãã¦ã¿ãã¨、ACIDãã©ã³ã¶ã¯ã·ã§ã³ã¯BASE(Eventually Consistent)ãã©ã³ã¶ã¯ã·ã§ã³ã®ç¹æ®ãªå½¢æ (Consistencyãã»ã¼å®å ¨ã«æºãããã¨ãã§ããã±ã¼ã¹)ã¨ã¿ãªããã¨ãã§ãã。
ã¯ã©ã¦ãã«ãããæä»æ¦ç¥
æ²è¦³ããã¯ãã楽観ããã¯ã ãã、ã¨ãã話。Scalabilityã®ããã«ã¯æ¥½è¦³ããã¯。ããæå³å½ããå?
ã¯ã©ã¦ãã¨æ°¸ç¶å
ã¯ã©ã¦ãã®ãããªã·ã¹ãã ã®ãã¼ãã¯、è½ã¡ããã¨ãªãåãç¶ãã。ã§ããã°、ã¡ã¢ãªãPersistencyãæ ããã¨ãã§ããã®ã§ã¯ãªãã?ã¨ããçºæ³ãåºã¦ãã。ã¨ãªãã¨、DBã®ã¤ã³ããã¯ã¹ã®ãããªãã®ã¯ããã·ã¥ãã¼ãã«ã¨ãã¦å®è£ ããããã¨ã«ãªã、èªç¶ã«åæ£ããã·ã¥ãã¼ãã«(Distributed Hash Table)ã¸ã®æ³¨åã¸ã¨ã¤ãªãã£ã¦ãããã¨ã«ãªã。
ç¾å®ã®Enterprise Systemã¸ã®Eventually Consisitencyæ¦å¿µã®å¿ç¨
ã·ã¹ãã å ¨ä½ãåä¸ã®ãã©ã³ã¶ã¯ã·ã§ã³ã¢ãã«(ç¹ã«ACID/Immediate Consistency)ã§ã«ãã¼ããã®ã§ã¯ãªã、ã±ã¼ã¹ã«å¿ãã¦ä¸è²«æ§ã¬ãã«ãé¸æãããã¨ã§、PartitionãAvailability、ç¹ã«Partitionãå¢ããã¨ãã§ãã。ããããå½¢ã§å¿ç¨ããã¨è¯ãã®ã§ã¯ãªãã、ã¿ãããªè©±ã ã£ã。
Eventually ConsistentãSoft Stateã¯、æ å ±ã·ã¹ãã ã«ãããç©ççãªéçç¹ã示ãããã®ã§ãã、åºæ¬åçã¨ãªããã、èæ ®ããã®ã¯å¿ ç¶、ã¨ãã£ã話ãã¡ãã£ã¨æå¾ã«åºã¦ãã¦ãã。
ç®æ¬¡:
QCon Tokyo 2009ã«è¡ã£ã¦ãã
Scalabilityã¨Availability
Scalabilityã¯、Scal-outã«ãã£ã¦éæã§ããã、Scale-outã«ã¯æè¡çãªè£æã¡ãå¿ è¦ã§ãã、ãã¦ãã¦ã®èç©ãå¿ è¦。
Availabilityã¯、æ éã«å¯¾ããé©åãªå¯¾å¦ã«ãã£ã¦éæã§ããã、ããã«ã¯è¤è£½ãä½æããæ¦ç¥(Replication)ãåºæ¬ã«ãªã。è¤è£½ãä½ã£ã¦ãã¾ãã¨、åæã®åé¡、ããªãã¡ä¸è²«æ§ã«é¢ããåé¡ãçºçãã。
[ã¡ã¢]
CAPå®çã§è¨ãã¨、ScalabilityãããããPartitionã«、Availabilityããã®ã¾ã¾Availabilityã«、ä¸è²«æ§ãConsistencyã«ãããã¨èãã¦ããã¨æã。ä¸è¨ã¯、ã¯ã©ã¦ãã«ãããCAPã®é¢ä¿ããããããã説æãã¦ããã¦ããã¨è¨ãã。
Partitionãå¿ é ã¨ãªãèæ¯
High-endã³ã³ãã¥ã¼ã¿ã¨Commodityã³ã³ãã¥ã¼ã¿ã®ä¾¡æ ¼æ§è½æ¯ã¯、ç´1:33。çµæ¸çãªé¸æãããã¨、å¿ ç¶çã«Partitionãé¸æãããã¨ã«ãªã。å®ããã¼ãã¦ã§ã¢ã¯ãããªãã®è½åããæããªãã、é害ã«å¼·ãã½ããã¦ã§ã¢ã、å®ããã¼ãã¦ã§ã¢ãå½¹ã«ç«ã¤ãã®ã«å¤ãã。
[ã¡ã¢]
ãã ã、ããããèããã¨、Partitionã¨、Partition度åãã容æã«å¢æ¸ã§ãããã©ãã(=Scalability)ã¯、éã£ãç¹æ§ã®ããã«ãæãã。ã»ããã¼ã§ã、ä¸å£ã«ã¯ã©ã¦ãã¨ãã£ã¦ã、ãªã½ã¼ã¹ãåçã«å¢æ¸ã§ãããã®(Hot Scalable)ã¨ã§ããªããã®ã¨ã§ããªããã®(éçã«ã®ã¿å¯è½、Scalable)ããã、ã¨è¨ã£ã¦ãã。
CAPå®çã¨ã¯ã©ã¦ã
ããã¯、å ±æãã¼ã¿ãæã¤ã·ã¹ãã ã«ããã¦ã¯、Consistency, Availability, Partitionã®3ã¤ã®ãã¡、æ大ã§ã2ã¤ã®ç¹æ§ããæã¤ãã¨ãã§ããªã、ã¨ãããã®。
ã¯ã©ã¦ãã§ã¯Partitionã¯å¿ é ã«ãªããã、ConsistencyãAvailabilityã®ã©ã¡ãããé¸ã°ãªããã°ãªããªã。…ã、ãã®é¸æã¯ã·ã¹ãã å ¨ä½ã«ä¸å¾ã«é©ç¨ããªããã°ãªããªãããã§ã¯ãªã、ã¨ããã®ãéè¦ãªç¹。åä¸ã®ã·ã¹ãã å ã§ã、ã«ã¼ãã«ååãå ¥ãã段éã§ã¯Availabilityãåªå ã、注æã®æ®µéã§ã¯ä¸è²«æ§ãåªå ãã、ã¨ãã£ãããã«、é¨åãã¨ã«å¿ è¦ã¨ãªãç¹æ§ã¯å¤ãã。
ã¾ã、ä¸è¨ã§Availabilityã「åªå ãã」ã¨æ¸ããããã«、Aã¨Cã¯ã©ã¡ãããåãã°ããä¸æ¹ãå®å ¨ã«å¤±ããã、ã¨ãããã®ã§ã¯ãªã、Aã¨Cã®é åã«ã¯ä¸éçãªé¸æè¢ãæ°å¤ãåå¨ãã。ç¹ã«、Consistencyã«ã¯ããã¤ãã®ã¬ãã«ããã、ããã«ã¯ååãã¤ãããã¦ããããã 。以ä¸、çµåããã®ç¿»è¨³ãµã¤ãããã®å¼ç¨。
- å¼·ãæ´åæ§(Strong consistency): æ´æ°ãå®äºããã, ç¶ãã¢ã¯ã»ã¹(A, B, C ããããã«ãã) ã¯æ´æ°ãããå¤ãèªã¿åºã
- å¼±ãæ´åæ§(Weak consistency): ã·ã¹ãã ã¯ç¶ãã¢ã¯ã»ã¹ãæ´æ°ãããå¤ãèªã¿ã ããã¨ãä¿è¨¼ããªã. æ´æ°ããå¤ãè¿ãããåã«ã¯æ§ã ãªæ¡ä»¶ãæºããå¿ è¦ããã. å¤ãã®å ´å, ãã®æ¡ä»¶ã¯çµéæéã§ãã. æ´æ°ãããæå»ããæ´æ°ããå¤ã®èªã¿ã ãã観測è ã«ä¿è¨¼ããã¾ã§ã®ééã ä¸æ´åã¦ã£ã³ãã¦(inconsistency window) ã¨å¼ã¶.
- çµææ´åæ§(Eventual consistency): ã¹ãã¬ã¼ã¸ã·ã¹ãã ã¯, ãªãã¸ã§ã¯ãã«(ä¸æ´åã¦ã£ã³ãã¦ãéãããã¨ã)æå¾ã¾ã§å¤æ´ãå ããããªãã£ããªã, å ¨ã¦ã®ã¢ã¯ã»ã¹ãæå¾ã®æ´æ°å¤ãèªã¿ã ããã¨ä¿è¨¼ãã. çµææ´åæ§ãå®è£ ããæãããç¥ãããã·ã¹ãã 㯠DNS ã . ååã®æ´æ°ã¯åæ£ãã¦ãã, è¨å®ã®ãã¿ã¼ã³ããã£ãã·ã¥å¶å¾¡ã®çµåãã§æ¯èããããã. ã¯ã©ã¤ã¢ã³ãã¯æçµçã«æ´æ°ãããå¤ãè¦ããã¨ã«ãªã.
- å ææ´åæ§(Causal consistency): ããã»ã¹ A ãããã»ã¹ B ã¨éä¿¡ãè¡ã, ãã® B ããã¼ã¿è¦ç´ ãæ´æ°ããã¨ã, B ãç¶ãã¦ã¢ã¯ã»ã¹ãããã¨æ´æ°ãããå¤ãæ»ã. ã¾ãæ¸è¾¼ã¿ã¯ãã®åã®æ¸è¾¼ã¿ãä¸æ¸ãããã¨ãä¿è¨¼ããã. ããã»ã¹ A ã¨å æé¢ä¿ããããªãããã»ã¹ C ã¯é常ã®å ææ´åæ§ã«å¾ã.
- Read-your-wrie consistency: ãã®ã¢ãã«ã¯éè¦ã . ããã»ã¹ A ãæ¸è¾¼ã¿ãããã¨ããã¨, ãã®ã㨠A ã¯å¸¸ã«æ´æ°ãããå¤ã«ã¢ã¯ã»ã¹ã§ãã. å¤ãå¤ã¯æ±ºãã¦è¦ããªã. ããã¯å ææ´åæ§ã®ç¹å¥ãªå ´åã .
- ã»ãã·ã§ã³æ´åæ§(Session consistency): ä¸ã®ã¢ãã«ã®å®ç¨çãªãã¼ã¸ã§ã³. ããã»ã¹ã¯ããã»ãã·ã§ã³ã®ä¸ã§ã¹ãã¬ã¼ã¸ã·ã¹ãã ã«ã¢ã¯ã»ã¹ãã. ã»ãã·ã§ã³ã®ããé, ã·ã¹ãã 㯠Read-your-wrie consistency ãä¿è¨¼ãã. ä½ããã®æ éã·ããªãªã§ã»ãã·ã§ã³ãç ´æ£ãããå ´åã¯æ°ãã«ä½ããªããå¿ è¦ããã. ã¾ãä¿è¨¼ã¯ã»ãã·ã§ã³ãã¾ãããªã.
- å調èªã¿åºãæ´åæ§(Monotonic read consistency): ããããã»ã¹ããªãã¸ã§ã¯ãããããå¤ãèªã¿ã ããã, ãã以éã«ã¯ããå¤ãå¤ãèªã¿åºããªã.
- å調æ¸ãè¾¼ã¿æ´åæ§(Monotonic write consistency): ãã®å ´åã¯ã·ã¹ãã ãåãããã»ã¹ããã®æ¸è¾¼ã¿ãç´ååãããããä¿è¨¼ãã.ãã®ã¬ãã«ã®ä¿è¨¼ããããªãã·ã¹ãã ã§ããã°ã©ã ãæ¸ãã®ã¯é£ãããã¨ã§æªåé«ã.
ãã®ãããª、ãªãã©ã¤ããã¼ãåé¤ã®æ©è½ã¯、å¾æ¥ãã¼ã¿ãã¼ã¹è£½åãæ ã£ã¦ããã®ã ã、ãããã¯æ¬æ¥OSãæ ã£ã¦ãè¯ãé¨å。ç¾æ®µéã§ãã®é¨åãOSãæ ã£ã¦ããªãã®ã¯、åã«æ´å²çãªçµç·¯ã«ãããã®ã ã¨æããã。å°ãªãã¨ãã¯ã©ã¦ãã®åéã§ã¯、OSã¨ãã¼ã¿ãã¼ã¹ã®çµ±åãã¯ãã¾ã£ã¦ãã。
ãã®ãããª、å³å¯ã«ACIDãæºãããªããããªæ°ããªãã©ã³ã¶ã¯ã·ã§ã³ã¢ãã«ãBASE(Basically Available, Soft-state, Eventually-Consistent)ã¨è¨ã。ACIDã¯ãã¼ã¿ãã¼ã¹è£½åãªã©ãæ å½ããæ¯è¼çå±å°çãªãã©ã³ã¶ã¯ã·ã§ã³ã¢ãã«ã§ããã®ã«å¯¾ã、BASEã¯ããå°ãåºã、ã·ã¹ãã ã¬ãã«ã®ãã©ã³ã¶ã¯ã·ã§ã³ã¢ãã«ããã。
Soft-State
åæ£ã·ã¹ãã ã«ããã¦、ç¶æ ãå®å ¨ã«å®ãããã®ã¯ä¸å¯è½。丸山å çã®èª¬æã¯ããããããªãã£ãã®ã§、ãããã§èª¿ã¹ã¦ã¿ãã¨、ãããªã®ãã§ã¦ãã。ã¹ãã¼ãã¨ç¶æ ããã¶ã£ã¦ããã®ãæ°ã«ãªãã、丸山å çããããããããã£ã。
ãã¼ã・ã¹ãã¼ãç¶æ 管ç
ãã¼ã¿éä¿¡ã管çããæ¹æ³ã®ä¸ç¨®。ä¸è¬ã«、éä¿¡ä¸ã®ã³ã³ãã¥ã¼ã¿ãéä¿¡ããã°ã©ã ãçµäºããéã«、「ãã¼ ã¿éä¿¡ã®çµäº」ãéç¥ããªãã¨、ãããæ£å¸¸ã«çµäºããã®ãã©ããç¸æã«ãããã¾ãã。ãã®ãã、éä¿¡ããã°ã©ã ã®åä½ã«ã¯é«ãä¿¡é ¼æ§ããã¦ã¾ãã。ãã㫠対ãã¦、「ãã¼ã¿éä¿¡ã®çµäº」ãç¸æã«éç¥ãã¦ããçµäºãããããªããã°ã©ã ã§ããã°、ãã®ã³ã³ãã¥ã¼ã¿ã®åä½ã«ã¯é«ãä¿¡é ¼æ§ãæå¾ ã§ãã¾ã(çµäºéç¥ãª ãã«çµäºããã°äºæ ã ã¨ããã)。ãããã£ã¦、ãã®ãããªããã°ã©ã ã«å¯¾ãã¦ã¯、éä¿¡ãå§ããã¨ãã«ã ãç¶æ ã確èªãã¦ããã°、以éã®åä½ã«ã¯ä¿¡é ¼æ§ãã ã¦ã¾ã。
ãã®ããã«、éä¿¡ã®éå§ã®ã¨ãã ãç¸æããã°ã©ã ã®åä½ã確èªãããã¼ã¿é信管çææ³ã、ãã¼ã・ã¹ãã¼ãç¶æ 管çã¨è¨ãã¾ã。æ¢åã® é»è©±ã·ã¹ãã ã、ãã®ä¾ã§ã。å対èªã¯、éä¿¡ä¸ã«çµ¶ããç¸æã®åä½ã確èªããã½ãã・ã¹ãã¼ãç¶æ 管çã§、ã¤ã³ã¿ã¼ããããããã«å½ããã¾ã。
Eventually Consistency by Example
ãã¦、ããã§、2ã¤ã®ã·ã¹ãã è¦ç´ (A, B)ãæã¤åæ£ã·ã¹ãã ä¸ã§、ã·ã¹ãã Aãèªèº«ã®ç¶æ ãæ´æ°ã、ãã®ç¶æ ããã¨ã«Bã®ç¶æ ãæ´æ°ããã±ã¼ã¹ãèãã¦ã¿ã。
極端ãªä¾ã¨ãã¦、ã·ã¹ãã è¦ç´ Aã¨Bãéæ²³ãã¾ããã§é¢ãã¦ãããããªã±ã¼ã¹ãèããã¨、å é度ã®å¶ç´ããããã、Aã®ç¶æ å¤æ´ã¨Bã®ç¶æ å¤æ´ãACIDã«è¡ããã¨ããã¨、使ãç©ã«ãªããªããªã£ã¦ãã¾ã。ãã®å ´å、ã¾ãã¯Aã®ç¶æ ã(ACIDã«)å¤æ´ã、ãã®å¾ã§Bã«ç¶æ å¤æ´ãéç¥ããã®ãç¾å®çã«ãªãã ãã。ãã®é、Aãéç¥ãéã£ã¦ããBã«å±ãã¾ã§ã®é、ã·ã¹ãã ã¯ä¸æ´åãªç¶æ ã¨ãªã。Bã«éç¥ãå±ããå¾ã¯æ´åæ§ãå復ããã¨èãããã¨ãã§ã、Eventually Consistentã¨ãªã。éã«ããããåä½ãåæã«ããã¨、ACIDãã©ã³ã¶ã¯ã·ã§ã³ãã³ã¼ãã£ãã¼ããããããªTransaction Managerã¯ä¸è¦ã«ãªã。
ããããç¶æ³ãç¾å®ã®åæ£ã·ã¹ãã ã«ãã¦ã¯ãã¦èãã¦ã¿ãã¨、ACIDãã©ã³ã¶ã¯ã·ã§ã³ã¯BASE(Eventually Consistent)ãã©ã³ã¶ã¯ã·ã§ã³ã®ç¹æ®ãªå½¢æ (Consistencyãã»ã¼å®å ¨ã«æºãããã¨ãã§ããã±ã¼ã¹)ã¨ã¿ãªããã¨ãã§ãã。
ã¯ã©ã¦ãã«ãããæä»æ¦ç¥
æ²è¦³ããã¯ãã楽観ããã¯ã ãã、ã¨ãã話。Scalabilityã®ããã«ã¯æ¥½è¦³ããã¯。ããæå³å½ããå?
ã¯ã©ã¦ãã¨æ°¸ç¶å
ã¯ã©ã¦ãã®ãããªã·ã¹ãã ã®ãã¼ãã¯、è½ã¡ããã¨ãªãåãç¶ãã。ã§ããã°、ã¡ã¢ãªãPersistencyãæ ããã¨ãã§ããã®ã§ã¯ãªãã?ã¨ããçºæ³ãåºã¦ãã。ã¨ãªãã¨、DBã®ã¤ã³ããã¯ã¹ã®ãããªãã®ã¯ããã·ã¥ãã¼ãã«ã¨ãã¦å®è£ ããããã¨ã«ãªã、èªç¶ã«åæ£ããã·ã¥ãã¼ãã«(Distributed Hash Table)ã¸ã®æ³¨åã¸ã¨ã¤ãªãã£ã¦ãããã¨ã«ãªã。
ç¾å®ã®Enterprise Systemã¸ã®Eventually Consisitencyæ¦å¿µã®å¿ç¨
ã·ã¹ãã å ¨ä½ãåä¸ã®ãã©ã³ã¶ã¯ã·ã§ã³ã¢ãã«(ç¹ã«ACID/Immediate Consistency)ã§ã«ãã¼ããã®ã§ã¯ãªã、ã±ã¼ã¹ã«å¿ãã¦ä¸è²«æ§ã¬ãã«ãé¸æãããã¨ã§、PartitionãAvailability、ç¹ã«Partitionãå¢ããã¨ãã§ãã。ããããå½¢ã§å¿ç¨ããã¨è¯ãã®ã§ã¯ãªãã、ã¿ãããªè©±ã ã£ã。
Eventually ConsistentãSoft Stateã¯、æ å ±ã·ã¹ãã ã«ãããç©ççãªéçç¹ã示ãããã®ã§ãã、åºæ¬åçã¨ãªããã、èæ ®ããã®ã¯å¿ ç¶、ã¨ãã£ã話ãã¡ãã£ã¨æå¾ã«åºã¦ãã¦ãã。
ç®æ¬¡:
QCon Tokyo 2009ã«è¡ã£ã¦ãã
ã³ã¡ã³ã