SAF(Store and forward)æ©è½ã«ã¤ãã¦
ãã°ããæ´æ°ãæ»ã£ã¦ãã¾ããããRubyConf2006ã¾ã§ã«ãã¼ã¸ã§ã³ã¢ãããã¹ãã追å æ©è½ãå®è£
ä¸ã§ãã
次ã®ãã¼ã¸ã§ã³ã§ã¯ä»¥ä¸ã®æ©è½ãå ããã¾ãã
- éåæé£æºãããã³ã«ã®æ¡å
AP4Rã§ã¯ãéåæå¦çã®ããªã¬ã¼ã¨ãªãæãå±ã¹ã¬ãããDBï¼ãªãããã¡ã¤ã«ï¼ã«æ°¸ç¶åãããã¡ãã»ã¼ã¸ãåãåºãã¦Webãµã¼ãã«éä¿¡ãã¦ãã¾ãããã®ã¨ãã®ãããã³ã«ã«å¾æ¥ã¾ã§ã¯XML-RPCã使ç¨ãã¦ãã¾ããããæ°ãã«SOAPã¨ã¹ããªHTTPã追å ãã¾ãã
ï¼XML-RPCãSOAPãHTTP POSTã¡ã½ããçµç±ãªã®ã§å¾®å¦ãªè¡¨ç¾ã§ãã...ãï¼ï¼¾ï¼¾ï¼
XML-RPCã§ã¯å¤æ¸¡ãã«Structãå¿
è¦ã«ãªãã¾ãããSOAPã§ã¯wsdlããµã¼ãå´ã«å®ç¾©ããå¿
è¦ãããã¾ãããã®ããããé¢åãªã®ã§ã¹ãã«HTTPã§éãå£ãç¨æãã¾ããã詳ãã話ã¯ã¾ãã®ã¡ã»ã©...
- SAF(Store and forward)ã«ããä¿¡é ¼æ§ã®åä¸
éåæã¡ãã»ã¼ã¸ã³ã°ã§éè¦ãªæ¦å¿µã«ãQoS (Quality of Service)ãããã¾ãããã¾ãã¾ãªMOM (Message-Oriented Middleware)ã§ãµãã¼ãããã¦ãããã®ã§ãããã¤ãã®ç¨®é¡ã¨ã¬ãã«ãããã¾ããããã®ã²ã¨ã¤ã«ãããã¯ã¼ã¯é害ããµã¼ãã¯ã©ãã·ã¥æã®ã¡ãã»ã¼ã¸ä¿éã«é¢ããã¬ãã«ãããã¾ãã
BEAã®WebLogicãä¾ã«ãããã¨ã以ä¸ã®ããã«å®ç¾©ããã¦ãã¾ãã
- Selecting a Quality-of-Service (QOS) Level
http://edocs.bea.com/wls/docs92/bridge/design.html#wp1174403
ã ããããããªæãã®å 容ã§ãã
- at-most-once: ã¡ãã»ã¼ã¸ãéè¤ãã¦é ä¿¡ããããã¨ããªããã¨ãä¿è¨¼ãã¾ãï¼å¤±ããããã¨ã¯ããå¾ããã¨ã«æ³¨æï¼ã
- at-least-once: ã¡ãã»ã¼ã¸ã失ããããã¨ããªããã¨ãä¿è¨¼ãã¾ãã
- exactly-once: æãé«ãQoSã¬ãã«ã§ãat-least-onceãã¤at-most-onceã§é ä¿¡ãã¾ããã¤ã¾ãã¡ãã»ã¼ã¸ã¯å¿ ããã ï¼åº¦é ä¿¡ããããã¨ãä¿è¨¼ãã¾ããonce-and-only-onceã¨ãå¼ã°ãã¾ãã
â»é«ãQoSã¬ãã«ãè¦æ±ããã¨ãããã¨ã¯ãã®ããã®å¶å¾¡ãå¿ è¦ã¨ããããã¯ããªãã¡ããã©ã¼ãã³ã¹ã«å½±é¿ãã¾ããé«ãQoSã¯ããã©ã¼ãã³ã¹ã¨å¸¸ã«ãã¬ã¼ããªãã®é¢ä¿ã«ããã¾ãã
ä»åã®æ©è½è¿½å ã§ã¯reliable-msgã®ã¯ã©ã¤ã¢ã³ãå´ã§SAFã®ä»çµã¿ãå°å
¥ããat-least-onceãå®ç¾ãã¦ãã¾ããããªãã¡ãã¡ãã»ã¼ã¸ã失ããããã¨ããªããã¨ãä¿éãã¾ãã
ï¼at-most-onceã®ä»çµã¿ãå®ã¯æºåãã¦ããã®ã§ãããã¾ã¨ããªã¢ããªã±ã¼ã·ã§ã³ã§ããã°åä¸ã®å¦çã2度å®è¡ãããå ´åã®ãã³ããªã³ã°ã¯ãã¦ããã¯ããªã®ã§ãç¡é§ãªãªã¼ãã¼ããããçãã¹ãä»åã¯æ¢ãã¦å
¥ãã¦ãã¾ãããéç¨é¢ã¸ã®èæ
®ãå¿
è¦ã«ãªã£ã¦ããã®ã§ããèãã¦ã¿ã¾ãã
ããããã©ããã¦ã¡ãã»ã¼ã¸ã失ãããå ´åãããã®ãã«ã¤ãã¦ã¯ãSAFãã¨ãã§ãããã°ããããã§ã¦ããã¨æãã¾ãããï¼ï¼¾ï¼¾ï¼
ã¯ããã£ã¦èª¬æããã¨ããã
ã¢ããªã±ã¼ã·ã§ã³ã®æ°¸ç¶åå
ã¨MOMã®æ°¸ç¶åå
ãç°ãªãå ´åãããããã®æ°¸ç¶åå
ã¸ã®commitã¿ã¤ãã³ã°ã«å·®ãã§ã¾ãããã®å·®ã®éã«é害ãçºçãããã¨ã¡ãã»ã¼ã¸ã失ãããããä¸è¦ãªã¡ãã»ã¼ã¸ãçºçãããã¨ã«ãªãã¾ãã2ãã§ã¼ãºã³ããã(2PC)ãå©ç¨ãããã¨ã§ãã®å·®ãåãããã¨ã¯ã§ãã¾ãããä¸è¬ã«2PCã®ã³ã¹ãã¯é«ããé害æã®ãªã«ããªãé£ãããªãã®ã§ãã¾ããå§ãã§ãã¾ããã
ããã§ç»å ´ããã®ãSAFã§ãã
ã¢ããªã±ã¼ã·ã§ã³å´ã®æ°¸ç¶åå
ã«SAFç¨ã®ãã¼ãã«ãè¨ããããã«MOMã«æ°¸ç¶åäºå®ã®ã¡ãã»ã¼ã¸ã¨ãã®ä»éæ
å ±ããã£ããæ ¼ç´(store)ãã¾ããããã¦ããã®ã¿ã¤ãã³ã°ã§ãã£ããã¢ããªã±ã¼ã·ã§ã³å´ã®æ°¸ç¶åå
ãcommitãã¾ãï¼æ ¼ç´ã«å¤±æããããã¡ããrollbackãã¾ãï¼ããã®å¾ãMOMã«ã¡ãã»ã¼ã¸ãæ°¸ç¶åãã¦commitãSAFãã¼ãã«ã®ã¹ãã¼ã¿ã¹ãæ´æ°ãã¦commitãã¨ããæµãã«ãªãã¾ã(forward)ã
ã1.ã¢ããªç¨ã®DBå
ã®å種ãã¼ãã«ã®æä½ï¼ç»é²/æ´æ°/åé¤ï¼
ã2.ã¢ããªç¨ã®DBå
ã®SAFãã¼ãã«ã¸ç»é²
ã3.ã¢ããªç¨ã®DBã®commit
ã4.MOMç¨ã®DBå
ã®ã¡ãã»ã¼ã¸æ ¼ç´ç¨ãã¼ãã«ã¸ç»é²
ã5.MOMç¨ã®DBã®commit
ã6.ã¢ããªç¨ã®DBå
ã®SAFãã¼ãã«ã®æ´æ°
ã7.ã¢ããªç¨ã®DBã®commit
ãããããã¨ã«ãã£ã¦ãåå¦çãã¨ã©ã¼ã«ãªã£ãå ´åã¯å¾å¦çã¯ãã£ãã¦å®è¡ãããéã«åå¦çãæ£å¸¸ã ã£ãå ´åã«ã¯ç¢ºå®ã«å¾å¦çã®ããã®ã¡ãã»ã¼ã¸ãæ®ããã¨ã«ãªãã¾ããcommitæã®å¾®å¦ãªã¿ã¤ãã³ã°ã§é害ãçºçãã¦ãå®å¿ã§ããããããSAFãã¼ãã«ã¯ã¢ããªç¨ã®DBå ã«ããã®ã§ã2PCã®ããã«ã³ã¹ããé«ããªããã¨ãããã¾ããã
Railsã«ãã©ã°ã¤ã³ããéã®å©ç¨æ¹æ³ã«ã¤ãã¦ã¯ã次åã®ã¨ã³ããªã§ç´¹ä»ãããã¨æãã¾ãâª