db tech showcase tokyo 2018 D17 Session "æ¥æ¬çºï¼MySQL UDFã¨Goè¨èªã§ä½ãããã°ãã¼ã¿åå¦çåºç¤" äºæ¥ç´¹ä» & æè¡è§£èª¬ ã®å®å ¨çè³æã§ãã
1. LINEã®MySQLéç¨ã«ã¤ãã¦Kentaro Kitagawa, IT service center - database department - db1 team DB Tech Showcase 2018 2018/09/20 2. l åå· å¥å¤ªé / Kentaro Kitagawa l LINEæ ªå¼ä¼ç¤¾ l IT Service Center - Database dept.- DB1 Team l ãã¼ã¿ãã¼ã¹ã¨ã³ã¸ã㢠l MySQL / Oracle Database / Redis l MySQLéæ®è«: http://gihyo.jp/dev/serial/01/mysql-road-construction-news Introduction @keny_lala
In MySQL ecosystems, it has been a very common practice to shard MySQL databases by application keys, and to manage multiple small sized MySQL instances. Main reason of the sharding was that a single server could not handle so much data. 10 years ago, typical commodity servers had only 16GB RAM, and typical storage configuration was RAID10 with 6~12 SATA HDDs. There was no affordable flash storage
Orchestratorã¨ãããã¼ã«ãæè¿ç¥ããMHAãmysqlfailoverã®ãããªèªåãã§ã¼ã«ãªã¼ãã¼ãã§ããã¨ãããã¨ã§è©¦ãã¦ã¿ã¾ããã Orchestratorã¨ã¯ github/orchestrator MySQLãåã³MariaDBãPerconaServerçã®MySQLäºæã®DBã®ã¬ããªã±ã¼ã·ã§ã³æ§æ(Replication topology)ã管çãããã¼ã«ã§ãã¬ããªã±ã¼ã·ã§ã³æ§æã®åæã»ãã¸ã¥ã¢ã©ã¤ãºãã¹ã¬ã¼ãã®ä»ãæ¿ããèªåãã§ã¼ã«ãªã¼ãã¼ãªã©ã®æ©è½ãããã¾ããPerconaã®ã¨ã³ã·ã¹ãã (PMM)ã«ãexperimentalãªããæ¡ç¨ãããããGitHubã®ããã¯ã¨ã³ãã§ãæ´»èºãã¦ããããã§ãã ä¸ã大è¦æ¨¡ããããã¯è¤éãªã¬ããªã±ã¼ã·ã§ã³æ§æã®ã¯ã©ã¹ã¿ã管çããããããããã®ãã¼ã«ãã¨ãã£ãæãã§ãã以ä¸ã®ãããªæ©è½ã»ç¹å¾´ãããã¾ãã GTID, éGTID(b
æè¿ãElastic BeanstalkãECSã¨æ¦ã£ã¦ããSREãã¼ã ã®è åã§ãã P5ãããããã®ã«PS3ãPS4ãæã£ã¦ããªãã®ã§æããããã¦ç¾¨ã¾ããã£ã¦ããæ¯æ¥ã§ãã ãã®è¨äºã§ã¯ãçªç¶ã®ã¢ã¯ã»ã¹å¢ã«åããããã«ãMySQLã®ã¹ã¬ã¼ããï¼ãï¼æéã§ã¹ã±ã¼ã«ã¢ã¦ãã§ããããã«ãã話ãæ¸ãã¾ãã MySQL on EC2 ã¯ãã¯ãããã¯å¨ç¥ã®éãAWSãå©ç¨ãã¦ãã¾ããã主è¦ãªãã¼ã¿ã¼ãã¼ã¹ã«ã¤ãã¦ã¯Amazon RDSã§ã¯ãªãMySQL on EC2ã使ã£ã¦ãã¾ãã ããã¯ä»¥ä¸ã®ãããªçç±ã«ãããã®ã§ãã æ´å²çãªçµç·¯: AWS移è¡å½æãRDSãç¡ãã£ããã¾ãã移è¡å¾ããã°ããã¯Tritonnã使ã£ã¦ãããããRDSã使ããã¨ãã§ããªãã£ã ãªã³ã©ã¤ã³ã¡ã³ããã³ã¹ã®å®ç¾: VPCã«ã¼ããã¼ãã«ã使ã£ãä»®æ³IPã¨MHA for MySQLã使ã£ã¦ãã¦ã³ã¿ã¤ã ã¼ãã®ãã¹ã¿DBã®åãæ¿ãã
Weâve represented the old version in red and the new row version in green. Under the hood, Postgres uses another field holding the row version to determine which tuple is most recent. This added field lets the database determine which row tuple to serve to a transaction that may not be allowed to see the latest row version. With Postgres, the primary index and secondary indexes all point directly
MySQL ã¯åæ£DBã®å¤¢ãè¦ãããGoogle F1 è«æãå®è£ ãã TiDB ã使ã£ã¦ã¿ã ããã«ã¡ã¯ãã¤ã³ãã©ã¨ã³ã¸ãã¢ã® nobuh ã§ã åæ£DBã¨ãã夢 ã¯ã©ã¦ãã®ãã¼ã¿ãã¼ã¹çéã§ã¯æ¨å¹´ããããã MySQL äºæã®ã¯ã©ã¦ãã§ã®ãã¼ã¿ãã¼ã¹ãAmazon Aurora ã Google Cloud SQL ãããããªè©±é¡ã ã¨æãã¾ãã ããã¯ãã¼ã¿ãã¼ã¹ã®é»ææããç 究ã®å ´ã§ã¯åæ£ãã¼ã¿ãã¼ã¹ã¨ããã®ã大ããªç 究åéã«ãªã£ã¦ãã¦ãRDBMS ã§ãããªãããã¹ã±ã¼ã«ã¢ã¦ããå¯è½ã§èé害æ§ããããããã¦å®ç¨çãªé度ã§ç¨¼åã§ãããã¼ã¿ãã¼ã¹ã¨ããã®ããã¼ã¿ãã¼ã¹ã¨ã³ã¸ãã¢ã®ç´æã®å°ãæå¾ã®æ¥½åã¨ãªã£ã¦ããããã§ããã¾ããã®åæ£ãã¼ã¿ãã¼ã¹ã MySQL äºæ㧠WordPress ãåãã°ããæé«ã§ãã Google Cloud SQL ã®å ã¨ãªã£ã¦ããããã Google ã® F
1 MySQL SQLãªããã£ãã¤ã¶ã®ã³ã¹ãè¨ç®ã¢ã«ã´ãªãºã InnoDB Deep Talk #1 2012/03/10 å¹³å¡ è²å¤« 2 èªå·±ç´¹ä» ⢠DBã¨ã³ã¸ãã¢ãã£ã¦ã¾ããå°éã¯Oracleã¨MySQLã â ã·ã¹ãã ã¤ã³ãã°ã¬ã¼ã¿ã§ä¸»ã«RDBMSã®ãã©ãã«å¯¾å¿ããã¦ãã¾ãã â ä»äºã®å²åã¯Oracleï¼MySQLï¼8ï¼2ãããã§ãã ⢠Twitterï¼@sh2nd ⢠ã¯ã¦ãªï¼id:sh2 ⢠åçã¯å®å®¶ã§é£¼ã£ã¦ãããããã¥ã¢ããã¯ã¹ã®ãªã¹ãã¢ãã ã§ãã 3 æ¬æ¥ã®ãé¡ â¢ MySQLã®ã¹ãã¼ã¿ã¹å¤æ°ã«Last_query_costã¨ãããã®ãããã¾ãã¦ããããåç § ããã¨ç´åã«å®è¡ããSQLã®ã³ã¹ãã確èªãããã¨ãã§ããããã«ãªã£ã¦ãã¾ããã ã®å¤ã¯å®ç¸¾å¤ã§ã¯ãªããSQLãªããã£ãã¤ã¶ãSQLå®è¡è¨ç»ãé¸æããããã«ç® åºããæ¨å®å¤ã表ãã¦ãã¾ãã ⢠æ¬æ¥ã¯ãã¿ãªããã«ã
ãã³ãã©ãªã¼ãã¼ãã«ã¯ãã®åã®ã¨ãããDBä¸ã«ä¸æçã«ãã¼ã¿ãæ ¼ç´ãããã¼ãã«ãä½æããæ©è½ã§ãã ãã³ãã©ãªã¼ãã¼ãã«ã¯ãcreate temporary table ãã¼ãã«åãã¨create tableæã«temporaryãæå®ãããã¨ã§ä½ããã¨ãã§ãã¾ãã ãã®ä½æããããã¼ãã«ã¯ãåä¸ã®DBã³ãã¯ã·ã§ã³å ã§æå¹ã§DBã³ãã¯ã·ã§ã³ãåããã¨èªåçã«åé¤ããã¾ãããã¤æå®ããããã¼ãã«åãåä¸DBã³ãã¯ã·ã§ã³å ã§ã®ã¿æå¹ãªãã®ã¨ãªãã¾ãã ã¾ããcreate temporary table ãã¼ãã«å selectæã¨ãããã¨ã§æå®ããSELECTæã®ãã¼ã¿ãä½æããtemporary tableã«æ ¼ç´ãããã¨ãã§ãã¾ãã å®ã¯ãMySQLã®ãµãã¯ã¨ãªã¼ã¯ãå é¨çã«ãã®ãã³ãã©ãªã¼ãã¼ãã«ãä½ã£ã¦ãã¾ãã éã«è¨ãã°ããã®ä½ã¬ãã«ã®æä½ããã³ãã©ãªã¼ãã¼ãã«ã®æä½ãèªåã§è¡ããã¨ã«
We have a legacy system in our production environment that keeps track of when a user takes an action on Causes.com (joins a Cause, recruits a friend, etc). I say legacy, but I really mean a prematurely-optimized system that I'd like to make less smart. This 500m record database is split across monthly sharded tables. Seems like a great solution to scaling (and it is) -- except that we don't need
MySQL 8.0 ã§ã¯ãALTER TABLE pt EXCHANGE PARTITION p WITH TABLE nt ã使ç¨ãã¦ããã¼ãã«ãã¼ãã£ã·ã§ã³ã¾ãã¯ãµããã¼ãã£ã·ã§ã³ããã¼ãã«ã¨äº¤æã§ãã¾ããããã§ãpt ã¯ãã¼ãã£ã·ã§ã³åããããã¼ãã«ãp ã¯ãã¼ãã£ã·ã§ã³åããã¦ããªããã¼ãã« nt ã¨äº¤æãã pt ã®ãã¼ãã£ã·ã§ã³ã¾ãã¯ãµããã¼ãã£ã·ã§ã³ã§ã (次ã®è¨è¿°ã true ã§ããå ´å)ã ãã¼ãã« nt èªä½ã¯ãã¼ãã£ã·ã§ã³åããã¦ããªãã ãã¼ãã« nt ã¯ä¸æãã¼ãã«ã§ã¯ãªãã ãã¼ãã« pt ããã³ nt ã®æ§é ã¯ãã以å¤ã®ç¹ã§åãã§ããã ãã¼ãã« nt ã¯å¤é¨ãã¼åç §ãå«ã¾ããã»ãã®ã©ã®ãã¼ãã«ã nt ãåç §ããå¤é¨ãã¼ãæããªãã nt å ã« p ã®ãã¼ãã£ã·ã§ã³å®ç¾©ã®å¢çã®å¤ã«åå¨ããè¡ããªãã ãã®æ¡ä»¶ã¯ãWITHOUT VALIDATION ã使ç¨ã
MySQL 5.7ã®æ°æ©è½ã§ããä»®æ³åãMariaDBã§ãå©ç¨å¯è½ã¨ãªã£ã¦ãã¾ãã両è ã«ã¤ãã¦æ¯è¼ããPercona Data Performance Blogå ã®è¨äºãç´¹ä»ãã¾ãã åºå ¸ã«ã¤ã㦠ãã®è¨äºã¯Percona Data Performance Blogå ã®Stephane Combaudonæ°ã«ããVirtual columns in MySQL and MariaDB(2016/3/4)ã翻訳ãããã®ã§ãã ãã®ããã°æ稿ã§ã¯ãMySQLã¨MariaDBã®ä»®æ³åã«ã¤ãã¦æ¯è¼ãããã¨æãã¾ãã ä»®æ³åã¯ç§ãMySQL 5.7ã§æãæ°ã«å ¥ã£ã¦ããæ©è½ã®1ã¤ã§ããåããã¼ãã«ã®1ã¤ãããã¯è¤æ°ã®ä»ã®ãã£ã¼ã«ãç±æ¥ã®å¤ãæ°ãããã£ã¼ã«ãã«ä¿åã§ããæ©è½ã§ããé¢æ°ã¤ã³ããã¯ã¹ãä½æããã«ã¯é常ã«è¯ãæ¹æ³ã§ãããã®æ©è½ãMariaDBã§å©ç¨ã§ããããã«ãªã£ã¦ãããã°ããçµéãã¾ããã®ã§
ãã¥ã¼ãã³ã°ã®åºç¤ ããã§ã¯ãå ·ä½çã«InnoDBã§ã©ãããã¥ã¼ãã³ã°ããã¹ãããè¦ã¦ãããã ãããã¡ãã¼ã« æãåºæ¬ã¨ãªãã®ããããã¡ãµã¤ãºã®èª¿æ´ã ãã¯ã¼ãã³ã°ã»ãããå ¨ã¦ãããã¡ã«åã¾ããªãéãããããã¡ãã¼ã«ã¯å¤§ãããã°å¤§ããã»ã©è¯ãããã®åãã£ã¹ã¯ã¢ã¯ã»ã¹ãæ¸ãããã ããããã¡ãµã¤ãºãå°ããã¨ããã£ãã·ã¥ãã¹æã«ãã£ã¹ã¯ããReadããã®ã«æéãããããI/Oãããã«ããã¯ã«ãªã£ã¦ãã¾ããäºç®ã®ããéãã¡ã¢ãªãç®ãã£ã±ãæè¼ãããããã¡ãã¼ã«ã«å²ãå½ã¦ãããInnoDBã®ãããã¡ãã¼ã«ã¯ãinnodb_buffer_pool_sizeãªãã·ã§ã³ã§è¨å®ãããå©ç¨å¯è½ãªã¡ã¢ãªã¯ãä»ã®å¦çã«å¿ è¦ãªåãé¤ãããã¹ã¦ãInnoDBã®ãããã¡ãã¼ã«ã«å²ãå½ã¦ããã innodb_buffer_pool=32G ããã§ä¸ã¤æ³¨æããããinnodb_buffer_pool_sizeã¯ãããã¡ãã¼
EnterpriseZineï¼ã¨ã³ã¿ã¼ãã©ã¤ãºã¸ã³ï¼ç·¨éé¨ã§ã¯ãæ å ±ã·ã¹ãã æ å½ãã»ãã¥ãªãã£æ å½ã®æ¹ã åãã«ãEnterpriseZine DayãSecurity Online DayãDataTechã¨ããã3ã¤ã®ã¤ãã³ããéå¬ãã¦ããã¾ããããããç·¨éé¨ç¬èªã®åãå£ã§ãæ¥çãã¬ã³ããææ°äºä¾ãç¶²ç¾ ãææ°ã®ååãç¥ããã¨ãã§ããå ´ã¨ãã¦ã好è©ãå¾ã¦ãã¾ãã
MySQL Performance Blogã®ç¿»è¨³ãMySQLããµãã¼ããã4ã¤ã®ãã©ã³ã¶ã¯ã·ã§ã³åé¢ã¬ãã«ã®ç¹å¾´ã¨ããã©ã¼ãã³ã¹ä¸ã®ç¹æ§ãããã©ã³ã¶ã¯ã·ã§ã³å±¥æ´ã®ä¿ææ¹æ³ã«çãå½ã¦ã¦æ¯è¼ã January 14, 2015 by Peter Zaitsev éå»æ°ã¶æã«æ¸¡ã£ã¦ãInnoDBã®ãã©ã³ã¶ã¯ã·ã§ã³å±¥æ´ã®è² åµã®å±éºæ§ã¨ãMVCCãMySQLã®ããã©ã¼ãã³ã¹åé¡ã®åå ã«ãªããããã¨ã«ã¤ãã¦ãããã¤ãã®è¨äºãæ¸ãã¦ããããã®è¨äºã§ã¯ããã«é¢é£ãã¦ãInnoDBã®ãã©ã³ã¶ã¯ã·ã§ã³åé¢ã¬ãã«ã¨MVCC(multi-version concurrency controlãå¤çååæå®è¡å¶å¾¡)ã¨ã®é¢é£æ§ãããã¦ããããMySQLã®ããã©ã¼ãã³ã¹ã«ã©ãå½±é¿ããã®ããåãä¸ãã¦ã¿ããã¨æãã MySQLã®ããã¥ã¢ã«ã«ã¯MySQLã§ãµãã¼ãããã¦ãããã©ã³ã¶ã¯ã·ã§ã³åé¢ã¬ãã«ã®è©³ç´°ãªèª¬æããããã
ãã®è¨äºã¯âã«ç§»è»¢ãã¾ããã laysakura.github.io
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}