CEDEC2017ãåªããã¨ã³ã¸ãã¢ãéã¾ãç¶ç¶çã«æé·ããä¼ç¤¾ã«ããæ¹æ³ ï½çµç¹ãæ¥æ¡å¤§ãããæ¡ç¨è²æè©ä¾¡ã¬ã¤ãï½ãè¬æ¼è³æã§ãã
CEDEC2017ãåªããã¨ã³ã¸ãã¢ãéã¾ãç¶ç¶çã«æé·ããä¼ç¤¾ã«ããæ¹æ³ ï½çµç¹ãæ¥æ¡å¤§ãããæ¡ç¨è²æè©ä¾¡ã¬ã¤ãï½ãè¬æ¼è³æã§ãã
ååã®ç¶ã ActiveRecordãå®éã«DBã«ã¯ã¨ãªãçºè¡ããå ´åActiveRecord::Base.connectionãçµç±ããã話ãåç´ã«ããçºã«ãã¯ã¨ãªã®å®è¡ã ãã«éå®ãã¦Shardingãå®ç¾ãããã¨æã£ãå ´åãã®ã¡ã½ãããããããã®Shardã«å¯¾ãã¦ç¢ºç«ãããã³ãã¯ã·ã§ã³ãè¿ãã°è¯ãã ä¸çªå¤ãæ¡ç¨ããã¦ããå®ç¾æ¹æ³ã¯connectionã¡ã½ãããä¸æ¸ããã¦proxyãçµç±ããããã¿ã¼ã³ã§ãå¤ãã®Gemã§æ¡ç¨ããã¦ããããã®ä»ã«ãã³ãã¯ã·ã§ã³ã®ç¢ºç«æ¹æ³ã»ç®¡çãªã©ã§æ¢åã®Gemãã©ããã£ã¦å®ç¾ãã¦ããããããã¤ãç´¹ä»ããã Octopus ããããä¸çªæåãªã®ãããããªãGemãkovyrin/db-charmerã®å½±é¿ãå°ãªãããåãã¦ããã å®éã«ç½®ãæãã¦ããã®ã¯ãActiveRecord::Baseã«Octopus::Modelãextendããéã«å®è¡ãããhij
ActiveRecordã®Shardingã©ã¤ãã©ãªãè¨è¨ããéã«ã対å¿ããå¿ è¦ãããã³ãã¯ã·ã§ã³ç®¡çã¨å®éã«ã³ãã¯ã·ã§ã³ãã©ã®ããã«ä½¿ç¨ããã¦ããã®ãã®é¨åã«ã¤ãã¦æ¸ãçãã¦ããã 対象ã®ãã¼ã¸ã§ã³ã¯4.2.4ã ãã©4ç³»ãªã大ä½åããªã®ã§åé¡ãªãã¨æãã ãã¼ã¿ãã¼ã¹ã¸ã®æ¥ç¶ã¯initializerã§è¡ãããã # active_record/railtie.rb initializer "active_record.initialize_database" do |app| ActiveSupport.on_load(:active_record) do self.configurations = Rails.application.config.database_configuration begin establish_connection rescue ActiveRecord:
ã·ãªã¢ã«ã³ã³ã½ã¼ã«æ¥ç¶ãç¡ãã¯ã©ã¦ããªãã¦ã´ãã ã¨æã£ã¦ãã¾ããã©ããçãããå æ°ã§ãããåã§ãã AWSãAzure ã§ä½ããããã©ãã«ãèµ·ããã¨å®å ¨ã«è©°ããã§ããããã³ã³ã½ã¼ã«æ¥ç¶ãç¡ãã°ããã«ã èµ·åã«å¤±æãããããããµãã¼ãã»ã³ã¿ã¼è¡ãã§ããã®ãAWSãAzure ã©ã¡ãã¨ã¯è¨ãã¾ãããããµãã¼ãã¨ä½æéãããåãããçµæãã¤ã¡ã¼ã¸ãã³ãã¼ãã¦ãVM ãä½ãç´ãã¦ããããªãã¦ãã¨è¨ããããã§ããã ã´ãã¿ããã«åªããããã©ãé ããããããããããªãã®ä½ãããã ï¼ã¨éçºè ã®è³ã¿ãã®åºæ¥ãçã人é¡å²ä¸æä½ã® ShellãPower Shellãå©ãã¾ãããã¨ã«ãªããã§ãããããã©ã£ã¡ããã¬ãã GCP ã«ã¯ã³ã³ã½ã¼ã«æ¥ç¶ãããã¾ããiptables ã§å¤ãªè¨å®ãå ¥ã㦠SSH ãåæãããã¨ãã¦ããã©ãã«ã§ããªãã¾ãã æã¯ãããã¤ã³ã¿ã¼ãããã«ãã³ã³ã½ã¼ã«æ¥ç¶ããªãã¦ãåèµ·åãã¦ãã
This is a time-honored topic, and thereâs no shortage of articles on the topic on this blog. I wanted to write a post trying to condense and clarify those posts, as it has taken me a while to really understand this relationship. Some basic facts Most of us know that writing into Innodb updates buffer pool pages in memory and records page operations in the transaction (redo) log. Behind the scenes
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}