Railsã®ãã©ã³ã¶ã¯ã·ã§ã³ã£ã¦ãåã§æ¸ããã¡ã§ãèªåã®ç解ã¯ä¸è¨ãããã ã£ãã®ã§ãå°ãçé¢ç®ã«æãããã¨æãã¾ããã ã¾ãã¯å¦ã¶ãã¨ã決ãã¦ããã¾ãã
ä»ã®ã¨ããã®èªåã®è§£å度
- 2å以ä¸ã®ã¬ã³ã¼ãCRUDæä½ã®æ´åæ§ãä¿ã¤ç®ç
- ãã©ã³ã¶ã¯ã·ã§ã³ä¸ã«ä¾å¤ãææãã¦ãã¾ãã¨ãã¼ã«ããã¯ãããªã
ææ§ãªæ¦å¿µï¼ããããªããã¨ï¼
æ´¾çã§ããæ¦å¿µãå«ãã¦ãããªã¨ããã§ãããã
- ããããActiveRecordã®è©³ç´°å®è£
- requires_newãªãã·ã§ã³
- ãã¹ããããã©ã³ã¶ã¯ã·ã§ã³ã®æå
- ã»ã¼ããã¤ã³ãã®æ¦å¿µ
- 楽観çããã¯/æ²è¦³çããã¯ã®ä½¿ãæ
- after_commit/after_rollbackã³ã¼ã«ããã¯ã®ä½¿ãæ¹
ï¼ActiveRecordã®å é¨å®è£ ï¼
ããã«é¢ãã¦ã¯æéãã»ããã£ãã®ã§Claudeã«èãã¦ã¿ã¾ããã
https://github.com/rails/rails/tree/main/activerecord ç¹ã« lib/active_record/transactions.rb ãéç¹çã«
Connection Pool ã®ä»çµã¿
- ãã¼ã¿ãã¼ã¹ã¢ããã¿ã®å®è£
- åæ£ãã©ã³ã¶ã¯ã·ã§ã³
- ãããããã¯ã®æ¤ç¥ã¨å¯¾ç
- connection.transaction ã®å®è¡ããã¼
- ãã¼ã«ããã¯ã®çºçæ¡ä»¶ã¨æå
- ãã¼ã¿ãã¼ã¹ã¸ã®å®éã®ã¯ã¨ãªçºè¡ã¿ã¤ãã³ã°
- ãã©ã³ã¶ã¯ã·ã§ã³åé¢ã¬ãã«
- ORMã®ä¸»è¦ãã¿ã¼ã³ï¼ActiveRecord, DataMapper, Repositoryï¼
- ã¬ã³ã¼ãã®èªã¿è¾¼ã¿ï¼é 延ãã¼ã vs å³æãã¼ãããã£ãã·ã¥æ¦ç¥ï¼
- é¢é£ã®åãæ±ãï¼has_many, belongs_toã®å®è£ ãçµåãã¼ãã«ã®å¦çï¼
- ã³ã¬ã¯ã·ã§ã³ã®ç®¡çï¼é åã®ãããªæä½ããããå¦çï¼