ãã®èšäºã§ã¯ãç§ãã¡ã®ããŒã ãCQRSãšã€ãã³ããœãŒã·ã³ã°ã®ã¢ãããŒãããªã³ã©ã€ã³ãªãŒã¯ã·ã§ã³ãµã€ãã§ãããããžã§ã¯ãã«é©çšããããšã決å®ããæ¹æ³ã«ã€ããŠã話ããŸãããããŠãããããäœãåŸãããã®ããç§ãã¡ã®çµéšããã©ã®ãããªçµè«ãå°ãåºãããšãã§ããã®ãããããŠã©ã®ã¬ãŒããCQRSãšESãå©çšãã人ã®ããã«èžãŸãªãããšãéèŠã§ããã®ãã«ã€ããŠãã§ãã
ãã¬ãªã¥ãŒã
ãŸããå°ãæŽå²ãšããžãã¹ã®èæ¯ã顧客ã¯ãããããã¿ã€ã ããªãŒã¯ã·ã§ã³ãéå¬ããããã®ãã©ãããã©ãŒã ãæã£ãŠç§ãã¡ã®ãšããã«ãã£ãŠæ¥ãŸããããã®ãã©ãããã©ãŒã ã¯ããã§ã«çç£ãããŠããŠãããçšåºŠã®ãã£ãŒãããã¯ãåéãããŸãããã¯ã©ã€ã¢ã³ãã¯ãã©ã€ããªãŒã¯ã·ã§ã³çšã®ãã©ãããã©ãŒã ãäœæããããšãæãã§ããŸããã
ä»å°ãçšèªããªãŒã¯ã·ã§ã³ãšã¯ãç¹å®ã®ã¢ã€ãã ã販売ããããšã-ãããã§ããããã€ã€ãŒïŒå ¥æè ïŒãå ¥æããŸãããããã®ææè ã¯ãæãé«ãå ¥æããããã€ã€ãŒã§ããæéãªãŒã¯ã·ã§ã³ã¯ãåãããã«äºåã«æ±ºããããç· ãåãæå»ãããå Žåã§ãããã€ã€ãŒã¯è³ããããŸããããæç¹ã§ããããã¯ééãããŸãã ebayã«äŒŒãŠããŸãã
æéãã©ãããã©ãŒã ã¯ãCRUDã䜿çšããŠå€å žçãªæ¹æ³ã§äœæãããŸããããããã¯ãäºå®éãã«éå§ãããå¥ã®ã¢ããªã±ãŒã·ã§ã³ã«ãã£ãŠã¯ããŒãºãããŸãããããããã¹ãŠã¯éåžžã«ç¢ºå®ã«æ©èœããŸããã§ããïŒããã€ãã®è³ãã¯å€±ãããŸãããããã€ãã¯ééã£ãè²·ãæã«ä»£ãã£ãŠãããããéããããªãã£ãããæ°åéããããããã«è¡ãããŸããã
ã©ã€ããªãŒã¯ã·ã§ã³ã¯ãã€ã³ã¿ãŒããããä»ããŠãªã¢ãŒãã§å®éã®ãªãã©ã€ã³ãªãŒã¯ã·ã§ã³ã«åå ããæ©äŒã§ããéšå±ïŒå éšçšèªã§ã¯ãéšå±ãïŒãããããã³ããŒãšèŽè¡ããããªãŒã¯ã·ã§ã³ã®ãã¹ããå«ãŸããŠããŸããã©ãããããã®ããé£ã«ããããäºåå¡ã座ã£ãŠããŸããäºåå¡ã¯ãã€ã³ã¿ãŒãã§ã€ã¹ã®ãã¿ã³ãæŒããšããªãŒã¯ã·ã§ã³ã®ã³ãŒã¹ãã€ã³ã¿ãŒãããã«ãããŒããã£ã¹ãããæ¥ç¶ãããŠããŸãããªãŒã¯ã·ã§ã³ã®æç¹ãŸã§ã«ããã€ã€ãŒã¯ãªãã©ã€ã³ã«ãªã£ãŠããå ¥æã確èªããå ¥æãè¡ãããšãã§ããŸãã
ã©ã¡ãã®ãã©ãããã©ãŒã ãååãšããŠãªã¢ã«ã¿ã€ã ã§æ©èœããŸãããæéå¶éã®ãããã¹ãŠã®è²·ãç©å®¢ãåãç«å Žã«ããå Žåãã©ã€ãã®å Žåã¯ãªã³ã©ã€ã³ã®è²·ãç©å®¢ã宀å ã®è²·ãç©å®¢ãšããŸã競äºã§ããããšãéåžžã«éèŠã§ããã€ãŸããã·ã¹ãã ã¯éåžžã«é«éã§ä¿¡é Œæ§ã®é«ããã®ã§ãªããã°ãªããŸãããæéãã©ãããã©ãŒã ã®æ²ããçµéšã¯ãå€å žçãªCRUDã¯ç§ãã¡ã«é©ããŠããªãããšãã¯ã£ãããšèªã£ãŠããŸãã
ç§ãã¡ã«ã¯ãCQRSãšESã䜿çšããç¬èªã®çµéšããªãã£ããããCQRSãšESã䜿çšããŠããååïŒç§ãã¡ã¯å€§äŒæ¥ã§ãïŒã«çžè«ãã圌ãã«ããžãã¹ã®çŸå®ã瀺ããå ±åã§CQRSãšESãç§ãã¡ã«é©ããŠãããšããçµè«ã«éããŸããã
ä»ã«ãªã³ã©ã€ã³ãªãŒã¯ã·ã§ã³ã®è©³çŽ°ã¯äœã§ããã
- â . , « », , . â , 5 . .
- , , .
- â - , , â .
- , .
- ãœãªã¥ãŒã·ã§ã³ã¯ã¹ã±ãŒã©ãã«ã§ãªããã°ãªããŸãã-è€æ°ã®ãªãŒã¯ã·ã§ã³ãåæã«éå¬ã§ããŸãã
CQRSãšESã®ã¢ãããŒãã®æŠèŠ
CQRSãšESã®ã¢ãããŒãã®æ€èšã«ã€ããŠã¯è©³ãã説æããŸãããããã«ã€ããŠã¯ã€ã³ã¿ãŒããããç¹ã«ããã¬ã«é¢ããè³æããããŸãïŒããšãã°ãããïŒCQRS +ã€ãã³ããœãŒã·ã³ã°ã®æŠèŠïŒããã ããäž»ãªãã€ã³ãã«ã€ããŠç°¡åã«èª¬æããŸãã
- ã€ãã³ããœãŒã·ã³ã°ã§æãéèŠãªããšïŒã·ã¹ãã ã¯ããŒã¿ãä¿åããŸããããå€æŽã®å±¥æŽãã€ãŸãã€ãã³ããä¿åããŸããã·ã¹ãã ã®çŸåšã®ç¶æ ã¯ãã€ãã³ãã®é 次é©çšã«ãã£ãŠååŸãããŸãã
- ãã¡ã€ã³ã¢ãã«ã¯ãéåäœãšåŒã°ãããšã³ãã£ãã£ã«åå²ãããŸãããŠãããã«ã¯ããŒãžã§ã³ããããŸããã€ãã³ãã¯éèšã«é©çšãããŸããéçŽã«ã€ãã³ããé©çšãããšãããŒãžã§ã³ãå¢å ããŸãã
- write-. , .
- . . , , . «» . .
- , , - ( N- ) . «» . , .
- - , , , , write-.
- write-, read-, , . read- . Read- .
- , â Command Query Responsibility Segregation (CQRS): , , write-; , , read-.
. .
æéãç¯çŽããããããŸãç¹å®ã®çµéšããªããããCQRSãšESã«ã¯äœããã®ãã¬ãŒã ã¯ãŒã¯ã䜿çšããå¿ èŠããããšå€æããŸããã
äžè¬çã«ãç§ãã¡ã®æè¡ã¹ã¿ãã¯ã¯Microsoftãã€ãŸã.NETãšCïŒã§ããããŒã¿ããŒã¹-Microsoft SQL Serverããã¹ãŠãAzureã§ãã¹ããããŠããŸãããã®ã¹ã¿ãã¯ã§æéãã©ãããã©ãŒã ãäœæãããŸããããã®äžã«ã©ã€ããã©ãããã©ãŒã ãäœæããããšã¯è«ççã§ããã
åœæãç§ãèŠããŠããããã«ãæè¡ã¹ã¿ãã¯ã«é¢ããŠã¯ããã³ãã©ãã»ãšãã©å¯äžã®éžæè¢ã§ãããããã§ç§ãã¡ã¯åœŒå¥³ãé£ããŠè¡ããŸããã
ãªãCQRSãšESãã¬ãŒã ã¯ãŒã¯ãå¿ èŠãªã®ã§ããïŒåœŒã¯ããã®ãŸãŸããã®ãããªåé¡ã解決ãã次ã®ãããªå®è£ ã®åŽé¢ããµããŒãã§ããŸãã
- ãšã³ãã£ãã£ãã³ãã³ããã€ãã³ãã®éçŽãããŒãžã§ã³ç®¡çã®éçŽãåæ°Žåãã¹ãããã·ã§ããã®ã¡ã«ããºã ã
- ããŸããŸãªDBMSãæäœããããã®ã€ã³ã¿ãŒãã§ãŒã¹ãã€ãã³ããšã¢ã°ãªã²ãŒãã®ã¹ãããã·ã§ãããæžã蟌ã¿ããŒã¹ïŒã€ãã³ãã¹ãã¢ïŒã«ä¿å/ããŒãããŸãã
- ãã¥ãŒãæäœããããã®ã€ã³ã¿ãŒãã§ãŒã¹-ã³ãã³ããšã€ãã³ããé©åãªãã¥ãŒã«éä¿¡ãããã¥ãŒããã³ãã³ããšã€ãã³ããèªã¿åããŸãã
- WebSocketãæäœããããã®ã€ã³ã¿ãŒãã§ãŒã¹ã
ãããã£ãŠããã³ãã©ã®äœ¿çšãèæ ®ããŠãã¹ã¿ãã¯ã«è¿œå ããŸããã
- ã³ãã³ãããã³ã€ãã³ããã¹ãšããŠã®Azure Service Busã§ããChinchillaã¯ããã®ãŸãŸã§ãµããŒãããŸãã
- æžã蟌ã¿ããã³èªã¿åãããŒã¿ããŒã¹ã¯Microsoft SQL Serverã§ããã€ãŸããã©ã¡ããSQLããŒã¿ããŒã¹ã§ããããã¯æèçãªéžæã®çµæã§ã¯ãªããæŽå²çãªçç±ã«ãããšã¯èšããŸããã
ã¯ããããã³ããšã³ãã¯Angularã§äœæãããŠããŸãã
ãã§ã«è¿°ã¹ãããã«ãã·ã¹ãã ã®èŠä»¶ã®1ã€ã¯ããŠãŒã¶ãŒãèªåã®ã¢ã¯ã·ã§ã³ã®çµæãšä»ã®ãŠãŒã¶ãŒã®ã¢ã¯ã·ã§ã³ã«ã€ããŠã§ããã ãæ©ãåŠç¿ããããšã§ããããã¯ã顧客ãšåºå¡ã®äž¡æ¹ã«åœãŠã¯ãŸããŸãããããã£ãŠãSignalRãšwebsocketã䜿çšããŠãããã³ããšã³ãã®ããŒã¿ããã°ããæŽæ°ããŸããChinchillaã¯SignalRçµ±åããµããŒãããŠããŸãã
ãŠãããã®éžæ
CQRSãšESã®ã¢ãããŒããå®è£ ãããšãã«æåã«è¡ãããšã®1ã€ã¯ããã¡ã€ã³ã¢ãã«ãéçŽã«åå²ããæ¹æ³ã決å®ããããšã§ãã
ç§ãã¡ã®å Žåããã¡ã€ã³ã¢ãã«ã¯æ¬¡ã®ãããªããã€ãã®äž»èŠãªãšã³ãã£ãã£ã§æ§æãããŠããŸãã
public class Auction
{
public AuctionState State { get; private set; }
public Guid? CurrentLotId { get; private set; }
public List<Guid> Lots { get; }
}
public class Lot
{
public Guid? AuctionId { get; private set; }
public LotState State { get; private set; }
public decimal NextBid { get; private set; }
public Stack<Bid> Bids { get; }
}
public class Bid
{
public decimal Amount { get; set; }
public Guid? BidderId { get; set; }
}
2ã€ã®éèšããªãŒã¯ã·ã§ã³ãšãããïŒå ¥æããïŒããããŸãããäžè¬çã«ãããã¯è«ççã§ããã1ã€ã®ããšã¯èæ ®ããŠããŸããã§ããããã®ãããªåå²ã«ãããã·ã¹ãã ã®ç¶æ ã¯2ã€ã®ãŠãããã«åæ£ãããå Žåã«ãã£ãŠã¯ãäžè²«æ§ãç¶æããããã«ã1ã€ã§ã¯ãªãäž¡æ¹ã®ãŠãããã«å€æŽãå ããå¿ èŠããããŸããããšãã°ããªãŒã¯ã·ã§ã³ãäžæåæ¢ã§ããŸãããªãŒã¯ã·ã§ã³ãäžæåæ¢ãããŠããå Žåã¯ãå ¥æã§ããŸããããããèªäœãäžæåæ¢ããããšã¯å¯èœã§ãããäžæåæ¢ããããªãŒã¯ã·ã§ã³ã¯ãäžæåæ¢è§£é€ã以å€ã®ã³ãã³ããåŠçã§ããŸããã
ãããã¯ã1ã€ã®éåäœããªãŒã¯ã·ã§ã³ããã¹ãŠã®ããããšå ¥æãäœæããããšãã§ããŸãããããããªãŒã¯ã·ã§ã³ã«ã¯æ倧æ°åã®ããããããã1ã€ã®ãããã«æ°åã®å ¥æãããããããã®ãããªãªããžã§ã¯ãã¯éåžžã«å°é£ã«ãªããŸãããªãŒã¯ã·ã§ã³ã®åç¶æéäžããã®ãããªã¢ã°ãªã²ãŒãã«ã¯å€ãã®ããŒãžã§ã³ããããã¢ã°ãªã²ãŒãã®ã¹ãããã·ã§ãããäœæãããŠããªãå Žåããã®ãããªã¢ã°ãªã²ãŒãã®åæ°ŽåïŒãã¹ãŠã®ã€ãã³ãã®ã¢ã°ãªã²ãŒããžã®é 次é©çšïŒã«ã¯ãããªãé·ãæéãããããŸããããã¯ç§ãã¡ã®ç¶æ³ã«ã¯åãå ¥ããããŸãããã¹ãããã·ã§ããã䜿çšããå ŽåïŒç§ãã¡ã¯ã¹ãããã·ã§ããã䜿çšããŸãïŒãã¹ãããã·ã§ããèªäœãéåžžã«éããªããŸãã
äžæ¹ãåäžã®ãŠãŒã¶ãŒã¢ã¯ã·ã§ã³ã®åŠçå ã§2ã€ã®ã¢ã°ãªã²ãŒãã«å€æŽã確å®ã«é©çšãããããã«ããã«ã¯ããã©ã³ã¶ã¯ã·ã§ã³ã䜿çšããŠåãã³ãã³ãå ã§äž¡æ¹ã®ã¢ã°ãªã²ãŒããå€æŽããããåããã©ã³ã¶ã¯ã·ã§ã³å ã§2ã€ã®ã³ãã³ããå®è¡ããå¿ èŠããããŸããã©ã¡ããæŠããŠãã¢ãŒããã¯ãã£éåã§ãã
ãã¡ã€ã³ã¢ãã«ãéåäœã«å解ãããšãã¯ããã®ãããªç¶æ³ãèæ ®ããå¿ èŠããããŸãã
ãããžã§ã¯ãã®é²åã®ãã®æ®µéã§ã¯ãAuctionãšLotãšãã2ã€ã®ãŠãããããããããã€ãã®ã³ãã³ãå ã§äž¡æ¹ã®ãŠããããå€æŽããããšã§ã¢ãŒããã¯ãã£ãå£ããŠããŸãã
ãŠãããã®ç¹å®ã®ããŒãžã§ã³ã«ã³ãã³ããé©çšãã
è€æ°ã®ãã€ã€ãŒãåæã«åããããã«å ¥æããå Žåãã€ãŸãããå ¥æãã³ãã³ããã·ã¹ãã ã«éä¿¡ããå Žåã1ã€ã®å ¥æã®ã¿ãæåããŸããå€ãã¯éåäœã§ãããããŒãžã§ã³ããããŸããã³ãã³ãã®åŠçäžã«ãã€ãã³ããçæããããããããéçŽã®ããŒãžã§ã³ãå¢åããŸãã2ã€ã®æ¹æ³ããããŸãã
- é©çšããã¢ã°ãªã²ãŒãã®ããŒãžã§ã³ãæå®ããã³ãã³ããéä¿¡ããŸãããã®åŸãã³ãã³ããã³ãã©ã¯ãã³ãã³ãã®ããŒãžã§ã³ããŠãããã®çŸåšã®ããŒãžã§ã³ãšããã«æ¯èŒããäžèŽããªãå Žåã¯ç¶è¡ã§ããŸããã
- ã³ãã³ãã§ãŠãããã®ããŒãžã§ã³ãæå®ããªãã§ãã ããã次ã«ãéèšãããã€ãã®ããŒãžã§ã³ã§åæ°Žåããã察å¿ããããžãã¹ããžãã¯ãå®è¡ãããã€ãã³ããçæãããŸãããããŠãããããä¿åããããšãã®ã¿ããã®ãããªããŒãžã§ã³ã®ãŠãããããã§ã«ååšãããšããå®è¡ãããã¢ããã衚瀺ãããŸããä»ã®èª°ãã以åã«ãã£ãããã§ãã
2çªç®ã®ãªãã·ã§ã³ã䜿çšããŸããããã«ãããããŒã ã¯å®è¡ãããå¯èœæ§ãé«ããªããŸããã³ãã³ããéä¿¡ããã¢ããªã±ãŒã·ã§ã³ã®éšåïŒãã®å Žåãããã¯ããã³ããšã³ãã§ãïŒã®ããããã確çã§ãã¢ã°ãªã²ãŒãã®çŸåšã®ããŒãžã§ã³ã¯ãããã¯ãšã³ãã®å®éã®ããŒãžã§ã³ãããé ããŸããç¹ã«å€§éã®ã³ãã³ããéä¿¡ããããŠãããã®ããŒãžã§ã³ãé »ç¹ã«å€æŽãããç¶æ³ã§ã¯ã
ãã¥ãŒã䜿çšããŠã³ãã³ããå®è¡ãããšãã®ãšã©ãŒ
ç§ãã¡ã®å®è£ ã§ã¯ããã³ãã©ã«ãã£ãŠå€§ããé§åãããã³ãã³ããã³ãã©ãŒããã¥ãŒïŒMicrosoft Azure Service BusïŒããã³ãã³ããèªã¿åããŸããããŒã ãæè¡çãªçç±ïŒã¿ã€ã ã¢ãŠãããã¥ãŒ/ããŒã¹ãžã®æ¥ç¶ãšã©ãŒïŒã§å€±æããå Žåãšãããžãã¹äžã®çç±ïŒãã§ã«åãå ¥ããããŠããã®ãšåãéé¡ã§å€ãã®å ¥æãè©Šã¿ãå Žåãªã©ïŒãæ確ã«åºå¥ããŸããæåã®ã±ãŒã¹ã§ã¯ãã³ãã³ãã¯ãã¥ãŒèšå®ã§æå®ãããç¹°ãè¿ãåæ°ã«éãããŸã§ã³ãã³ãã®å®è¡ãç¹°ãè¿ããããã®åŸã³ãã³ãã¯ãããã¬ã¿ãŒãã¥ãŒïŒAzure Service Busã§ã®æªåŠçã¡ãã»ãŒãžã®å¥ã®ãããã¯ïŒã«éä¿¡ãããŸããæ¥åå·è¡ã®å ŽåãããŒã ã¯å³åº§ã«ãããã¬ã¿ãŒãã¥ãŒã«éãããŸãã
ãã¥ãŒã䜿çšããŠã€ãã³ããåŠçãããšãã®ãšã©ãŒ
ã³ãã³ãã®å®è¡ã®çµæãšããŠçæãããã€ãã³ãã¯ãå®è£ ã«å¿ããŠãã€ãã³ããã³ãã©ãŒã«ãã£ãŠãã¥ãŒã«éä¿¡ããããã¥ãŒããååŸãããŸãããŸããã€ãã³ããåŠçãããšãã«ãšã©ãŒãçºçããŸãã
ãã ããã³ãã³ããå®è¡ãããªãç¶æ³ãšã¯å¯Ÿç §çã«ãããã§ã¯ãã¹ãŠãæªåããŠããŸããã³ãã³ããå®è¡ãããã€ãã³ããæžã蟌ã¿ããŒã¹ã«æžã蟌ãŸãããããã³ãã©ãŒã«ããåŠçã倱æããå¯èœæ§ããããŸãããŸãããããã®ãã³ãã©ãŒã®1ã€ãèªã¿åãããŒã¹ãæŽæ°ããŠããèªã¿åãããŒã¹ã¯æŽæ°ãããŸãããã€ãŸããäžæŽåãªç¶æ ã«ãªããŸããèªã¿åãã€ãã³ããåè©Šè¡ããã¡ã«ããºã ã®ãããã»ãšãã©ã®å ŽåãããŒã¿ããŒã¹ã¯æåŸã«æŽæ°ãããŸããããã¹ãŠã®è©Šè¡åŸã«ããŒã¿ããŒã¹ãå£ãããŸãŸã«ãªãå¯èœæ§ã¯ãŸã æ®ã£ãŠããŸãã
ç§ãã¡ã¯ãã®åé¡ã家ã§çµéšããŸããããããããã®çç±ã¯ãã€ãã³ãåŠçã«ããã€ãã®ããžãã¹ããžãã¯ããããæ¿ããè³ãã§æã 倱æããå¯èœæ§ãé«ãããã§ããæ®å¿µãªãããããã¯é ãããããšã«æ°ã¥ããããžãã¹å®è£ ãè¿ éãã€ç°¡åã«ããçŽãããšã¯äžå¯èœã§ããã
ãã®çµæãäžæçãªå¯ŸçãšããŠãã¢ããªã±ãŒã·ã§ã³ã®æžã蟌ã¿éšåããèªã¿åãéšåã«ã€ãã³ãã転éããããã®Azure Service Busã®äœ¿çšãåæ¢ããŸããã代ããã«ãããããã€ã³ã¡ã¢ãªãã¹ã䜿çšãããŸããããã«ãããã³ãã³ããšã€ãã³ãã1ã€ã®ãã©ã³ã¶ã¯ã·ã§ã³ã§åŠçããé害ãçºçããå Žåã¯ãã¹ãŠãããŒã«ããã¯ã§ããŸãã
ãã®ãããªãœãªã¥ãŒã·ã§ã³ã¯ã¹ã±ãŒã©ããªãã£ã«ã¯è²¢ç®ããŸããããäžæ¹ã§ãèªã¿åãããŒã¹ãå£ããŠããã³ããšã³ããæ éãããã¹ãŠã®ã€ãã³ããåçããŠèªã¿åãããŒã¹ãåäœæããªããšãªãŒã¯ã·ã§ã³ãç¶è¡ã§ããªããªãç¶æ³ã¯é€å€ããŸãã
ã€ãã³ãã«å¿çããŠã³ãã³ããéä¿¡ãã
ããã¯ååãšããŠé©åã§ããããã®2çªç®ã®ã³ãã³ãã®å®è¡ã«å€±æããŠãã·ã¹ãã ã®ç¶æ ãå£ããªãå Žåã«éãããŸãã
1ã€ã®ã³ãã³ãã®è€æ°ã®ã€ãã³ããåŠçãã
äžè¬ã«ã1ã€ã®ã³ãã³ããå®è¡ãããšãããã€ãã®ã€ãã³ããçºçããŸããã€ãã³ãããšã«ãèªã¿åãããŒã¿ããŒã¹ã«å€æŽãå ããå¿ èŠããããŸãããŸããã€ãã³ãã®ã·ãŒã±ã³ã¹ãéèŠã§ãããééã£ãã·ãŒã±ã³ã¹ã§ã¯ãã€ãã³ãåŠçãæ£åžžã«æ©èœããŸãããããã¯ãã¹ãŠãããšãã°ããã¥ââãŒããã¡ãã»ãŒãžãèªã¿åãã³ãŒãã®ç°ãªãã€ã³ã¹ã¿ã³ã¹ã䜿çšããŠããã¥ãŒããèªã¿åãã1ã€ã®ã³ãã³ãã®ã€ãã³ããåå¥ã«åŠçããããšãã§ããªãããšãæå³ããŸããããã«ããã¥ãŒããã®ã€ãã³ããããã«éä¿¡ãããã®ãšåãé åºã§èªã¿åãããããšãä¿èšŒãããŠããå¿ èŠããããŸãããŸãã¯ãæåã®è©Šè¡ã§ãã¹ãŠã®ã³ãã³ãã€ãã³ããæ£åžžã«åŠçãããããã§ã¯ãªããšããäºå®ã«åããå¿ èŠããããŸãã
è€æ°ã®ãã³ãã©ãŒã§1ã€ã®ã€ãã³ããåŠçãã
ã·ã¹ãã ã1ã€ã®ã€ãã³ãã«å¿çããŠè€æ°ã®ç°ãªãã¢ã¯ã·ã§ã³ãå®è¡ããå¿ èŠãããå Žåãéåžžããã®ã€ãã³ãã®è€æ°ã®ãã³ãã©ãŒãäœæãããŸãããããã¯ã䞊è¡ããŠãŸãã¯é 次ã«åäœã§ããŸããé 次起åã®å Žåããã³ãã©ãŒã®1ã€ã倱æãããšãã·ãŒã±ã³ã¹å šäœãåéãããŸãïŒããã¯ãã³ãã©ã®å Žåã§ãïŒããã®ãããªå®è£ ã§ã¯ãäžåºŠæ£åžžã«å®è¡ããããã³ãã©ãŒã®2åç®ã®å®è¡ã倱æããªãããã«ããã³ãã©ãŒãã¹ãçã§ããããšãéèŠã§ããããããªããšã2çªç®ã®ãã³ãã©ãŒããã§ãŒã³ããèœã¡ããšãã«ãæåã®ãã³ãã©ãŒã2åç®ïŒããã³ãã以éïŒã®è©Šè¡ã§èœã¡ãããããã§ãŒã³ïŒãã§ãŒã³ïŒã¯å®å šã«æ©èœããŸããã
ããšãã°ãèªã¿åãããŒã¹ã®ã€ãã³ããã³ãã©ãŒã¯ã5ã«ãŒãã«ã®å€ãã«å ¥æãè¿œå ããŸãããããè¡ãæåã®è©Šã¿ã¯æåãã2åç®ã¯ããŒã¿ããŒã¹ã§å¶çŽãå®è¡ã§ããŸããã
çµè«/çµè«
çŸåšãç§ãã¡ã®ãããžã§ã¯ãã¯ãç§ãã¡ã«æãããããã«ãç§ãã¡ã®ããžãã¹ã®è©³çŽ°ã«é¢é£ããæ¢åã®ã¬ãŒãã®ã»ãšãã©ã«ãã§ã«èžã¿èŸŒãã 段éã«ãããŸããäžè¬çã«ãç§ãã¡ã®çµéšã¯ããªãæåããŠãããšèããŠããŸããCQRSãšESã¯ããã®åéã«é©ããŠããŸãããã³ãã©ã®æŸæ£ã«ããããããžã§ã¯ãã®ãããªãçºå±ãèŠãããããæè»ãªå¥ã®ãã¬ãŒã ã¯ãŒã¯ãæ¯æãããŸããããã ãããã¬ãŒã ã¯ãŒã¯ã®äœ¿çšããŸã£ããæåŠããããšãã§ããŸãããŸããäžæ¹ã§ã¯ä¿¡é Œæ§ãšãä»æ¹ã§ã¯ãœãªã¥ãŒã·ã§ã³ã®é床ãšã¹ã±ãŒã©ããªãã£ãšã®éã®ãã©ã³ã¹ãèŠã€ããæ¹åã«ããã€ãã®å€æŽãçããå¯èœæ§ããããŸãã
ããžãã¹ã³ã³ããŒãã³ãã«é¢ããŠã¯ãããã§ãããã€ãã®è³ªåãæªè§£æ±ºã®ãŸãŸã§ããããšãã°ããã¡ã€ã³ã¢ãã«ãéèšã«åå²ããŸãã
ç§ãã¡ã®çµéšã誰ãã®ããã«åœ¹ç«ã¡ãæéãç¯çŽããçæãé¿ããã®ã«åœ¹ç«ã€ããšãé¡ã£ãŠããŸãããæž èŽããããšãããããŸããã