SlideShare a Scribd company logo
MySQL       NoSQL
            NoSQL


MySQL Casual Talks #2
•   id: oinume (   :   )
•   id: oinume (   :   )

•   2010   3
•   id: oinume (   :   )

•   2010   3

•
•   id: oinume (     :   )

•   2010   3

•
•              SQL           MySQL
•   id: oinume (     :   )

•   2010   3

•
•              SQL             MySQL

•   ver 3.23                 MySQL
• MySQL   NoSQL(   )
• MySQL   NoSQL(   )

•                  MySQL
• MySQL NoSQL( )
•             MySQL

• NoSQL(KVS)
• MySQL NoSQL( )
•             MySQL

• NoSQL(KVS)
• NoSQL(KVS)
•   Fusion-IO
•   Fusion-IO

•           (Java)
•    Fusion-IO

•            (Java)

•   MySQL
•        Fusion-IO

•                   (Java)

•       MySQL

    •      Oracle
•        Fusion-IO

•                   (Java)

•       MySQL

    •      Oracle

•
•
•
•   2009 2
•
•   2009 2

•            800   ↑ (2011   7 )
•
•   2009 2

•            800   ↑ (2011   7 )

•
•
•   2009 2

•            800   ↑ (2011   7 )

•
    •
•
•   2009 2

•            800   ↑ (2011   7 )

•
    •
    •
•
•   2009 2

•            800      ↑ (2011   7 )

•
    •
    •
    •   (          ) ← NEW
Browser


          Web x 35


                        Memcached x 4 MySQL x 6
                                       with FIO


          Socket x 70
request



Browser


                    Web x 35


                                  Memcached x 4 MySQL x 6
                                                 with FIO


                    Socket x 70
request



Browser
           swf


                    Web x 35


                                  Memcached x 4 MySQL x 6
                                                 with FIO


                    Socket x 70
request



Browser
           swf


                    Web x 35


                                  Memcached x 4 MySQL x 6
                                                 with FIO


                    Socket x 70
request



Browser
           swf


                    Web x 35

            TCP Socket


                                   Memcached x 4 MySQL x 6
                                                  with FIO


                     Socket x 70
request



Browser
           swf


                    Web x 35

            TCP Socket


                                   Memcached x 4 MySQL x 6
                                                  with FIO


                     Socket x 70   Java
request



Browser
           swf


                    Web x 35

            TCP Socket


                                   Memcached x 4 MySQL x 6
                                                  with FIO


                     Socket x 70   Java
request



Browser
           swf


                    Web x 35

            TCP Socket


                                   Memcached x 4 MySQL x 6
                                                  with FIO


                     Socket x 70   Java
request



Browser
           swf


                    Web x 35

            TCP Socket


                                   Memcached x 4 MySQL x 6
                                                  with FIO


                     Socket x 70   Java
•   : 2.1Gbps
•     : 2.1Gbps

•   : 100,000
•               : 2.1Gbps

•            : 100,000

• Web: 36,000 req / s
•                : 2.1Gbps

•             : 100,000

• Web: 36,000 req / s
• Socket: 160,000 req / s
•                : 2.1Gbps

•             : 100,000

• Web: 36,000 req / s
• Socket: 160,000 req / s
• Database: 52000 qps (read: 40000, write: 12000)
MySQL
MySQL
MySQL
•   RDBMS
MySQL
•   RDBMS

    •           KVS + MySQL
MySQL
•   RDBMS

    •              KVS + MySQL



    •   KVS      MySQL
MySQL
•   RDBMS

    •                     KVS + MySQL



    •      KVS          MySQL

•   IndexPersister              MySQL   KVS
IndexPersister ?
IndexPersister

•                      Java      MySQL



• key / value
•                      SQL

•
DDL
CREATE TABLE `user` (
   `id` varbinary(255) NOT NULL,
   `data` longblob NOT NULL,
   PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8
Java
@Persistable("user")
public class User {
  @IndexKey
  @Store(index=0)
  public int getUserId() {
      return userId;
  }

    @Store(index=1)
    public String getNickname() {
         return nickname;
    }
    ....
}
Java

                          Java
  @Persistable("user")
  public class User {
    @IndexKey
    @Store(index=0)
    public int getUserId() {
        return userId;
    }

       @Store(index=1)
       public String getNickname() {
            return nickname;
       }
       ....
  }
Java

                          Java
  @Persistable("user")
  public class User {
    @IndexKey
    @Store(index=0)
    public int getUserId() {
        return userId;
    }

       @Store(index=1)
       public String getNickname() {
            return nickname;
       }
       ....
  }
Java

                          Java
  @Persistable("user")
  public class User {
    @IndexKey
    @Store(index=0)
    public int getUserId() {
                                        DB
        return userId;
    }                                  index=0 0


       @Store(index=1)
       public String getNickname() {
            return nickname;
       }
       ....
  }
select hex(id), hex(data) from user
 order by id limit 1 ¥G

hex(id) : 00000001
hex(data):
0700000006000000060103000000020000000E02000B7
97573616B752D3030303600000019020016E38286E38
186E38195E3818F36E58FB7E381A7E38199000000030
1010100000003010101FFFFFFFF
load - 1

       ID: 1

User user = persister.load(1, User.class);
String nickname = user.getNickname();
...
fetch -
                             10

IndexQuery query = IndexQuery.all();
query.limit(10);
List<User> users =
   persister.fetch(query, User.class);
for (User user : users) ...
fetch -                                      (2)

      ID:2

User user = persister.load(2, User.class);
IndexQuery query =
  IndexQuery.startWith(new IndexValue(user.getUserId()));
List<UserItem> userItems =
   persister.fetch(query, UserItem.class);
fetch -                                                (2)
@Persistable("user_item")
public class UserItem {                       userId, itemId
  @IndexKey
  public IndexKey getKey() {
        KeyCreator.toValue(userId, itemId);
  }
  @Store(index=0)
  public int getUserId() {
        return userId;
  }
  @Store(index=1)
  public int getItemId() {
       return itemId;
  }
  ....
}
fetch -                     (2)

          userId   itemId
            1        1
            1        2
            1        3
            2       10
            2       20
fetch -                                     (2)
User user = persister.load(2, User.class);
IndexQuery query =
  IndexQuery.startWith(new IndexValue(user.getUserId()));
List<UserItem> userItems =
   persister.fetch(query, UserItem.class);

◆       SQL
select id, data from user_item
 where id >= {v1} and id < {v2}
   v1: 00000002
   v2: 00000003
• count
• exists
• remove
• save (insert ... on duplicate key update)
•   MySQL   slow query
•   MySQL   slow query

•
•   MySQL   slow query

•
•                        slow query
•   MySQL   slow query

•
•                        slow query

•               Java
•   MySQL   slow query

•
•                        slow query

•               Java

•
•   load
•          load

    •   MySQL     context switch
•             load

    •   MySQL               context switch

    •   select ... where id in (...)
•                 load

    •       MySQL               context switch

    •       select ... where id in (...)



•       1                                  fetch (   )
•                 load

    •       MySQL               context switch

    •       select ... where id in (...)



•       1                                  fetch (   )

    •       key          Column
•                 load

    •       MySQL               context switch

    •       select ... where id in (...)



•       1                                  fetch (   )

    •       key          Column

    •
•                 load

    •       MySQL               context switch

    •       select ... where id in (...)



•       1                                  fetch (          )

    •       key          Column

    •
    •                     1      fetch               1000
MySQL   Key Value Store
KVS
KVS
•   SQL
KVS
•        SQL

    •   JOIN
KVS
•           SQL

    •   JOIN

    •   (         )INDEX
KVS
•           SQL

    •   JOIN

    •   (             )INDEX

    •   (         )
KVS
•             SQL

    •     JOIN

    •     (             )INDEX

    •     (         )

•       ALTER TABLE
KVS
•             SQL

    •     JOIN

    •     (             )INDEX

    •     (         )

•       ALTER TABLE

    •
KVS
•             SQL

    •     JOIN

    •     (             )INDEX

    •     (         )

•       ALTER TABLE

    •
    •
KVS
•             SQL

    •     JOIN

    •     (             )INDEX

    •     (         )

•       ALTER TABLE

    •
    •
•       mongoDB           KVS
KVS
•             SQL

    •     JOIN

    •     (             )INDEX

    •     (         )

•       ALTER TABLE

    •
    •
•       mongoDB            KVS

    •                   Ameba Pico mongoDB
•   Column
•       Column

    •
•       Column

    •
    •            Column
•       Column

    •
    •            Column

•
•       Column

    •
    •            Column

•
    •
•                Column

    •
    •                     Column

•
    •
•       Column       (ALTER TABLE)
•                  Column

    •
    •                        Column

•
    •
•       Column          (ALTER TABLE)

    •    short -> int                   Column
MySQLでNoSQL - アメーバピグでのNoSQLの実例
MySQLでNoSQL - アメーバピグでのNoSQLの実例
MySQLでNoSQL - アメーバピグでのNoSQLの実例

More Related Content

What's hot

2001: JNDI Its all in the Context
2001:  JNDI Its all in the Context2001:  JNDI Its all in the Context
2001: JNDI Its all in the Context
Russell Castagnaro
 
Sequel
SequelSequel
Datacon LA - MySQL without the SQL - Oh my!
Datacon LA - MySQL without the SQL - Oh my! Datacon LA - MySQL without the SQL - Oh my!
Datacon LA - MySQL without the SQL - Oh my!
Dave Stokes
 
Security in Android Applications / Александр Смирнов (RedMadRobot)
Security in Android Applications / Александр Смирнов (RedMadRobot)Security in Android Applications / Александр Смирнов (RedMadRobot)
Security in Android Applications / Александр Смирнов (RedMadRobot)
Ontico
 
MySQL JSON Functions
MySQL JSON FunctionsMySQL JSON Functions
MySQL JSON Functions
Sveta Smirnova
 
Hidden pearls for High-Performance-Persistence
Hidden pearls for High-Performance-PersistenceHidden pearls for High-Performance-Persistence
Hidden pearls for High-Performance-Persistence
Sven Ruppert
 
MongoDB @ Frankfurt NoSql User Group
MongoDB @  Frankfurt NoSql User GroupMongoDB @  Frankfurt NoSql User Group
MongoDB @ Frankfurt NoSql User GroupChris Harris
 
MongoDB .local Munich 2019: New Encryption Capabilities in MongoDB 4.2: A Dee...
MongoDB .local Munich 2019: New Encryption Capabilities in MongoDB 4.2: A Dee...MongoDB .local Munich 2019: New Encryption Capabilities in MongoDB 4.2: A Dee...
MongoDB .local Munich 2019: New Encryption Capabilities in MongoDB 4.2: A Dee...
MongoDB
 
Json within a relational database
Json within a relational databaseJson within a relational database
Json within a relational database
Dave Stokes
 
Spring.io
Spring.ioSpring.io
Spring.io
Cédric GILLET
 
Php &amp; my sql - how do pdo, mysq-li, and x devapi do what they do
Php &amp; my sql  - how do pdo, mysq-li, and x devapi do what they doPhp &amp; my sql  - how do pdo, mysq-li, and x devapi do what they do
Php &amp; my sql - how do pdo, mysq-li, and x devapi do what they do
Dave Stokes
 
JavaScript and Friends August 20th, 20201 -- MySQL Shell and JavaScript
JavaScript and Friends August 20th, 20201 -- MySQL Shell and JavaScriptJavaScript and Friends August 20th, 20201 -- MySQL Shell and JavaScript
JavaScript and Friends August 20th, 20201 -- MySQL Shell and JavaScript
Dave Stokes
 
MySQL 8.0 Operational Changes
MySQL 8.0 Operational ChangesMySQL 8.0 Operational Changes
MySQL 8.0 Operational Changes
Dave Stokes
 
Java/Scala Lab: Борис Трофимов - Обжигающая Big Data.
Java/Scala Lab: Борис Трофимов - Обжигающая Big Data.Java/Scala Lab: Борис Трофимов - Обжигающая Big Data.
Java/Scala Lab: Борис Трофимов - Обжигающая Big Data.
GeeksLab Odessa
 
More mastering the art of indexing
More mastering the art of indexingMore mastering the art of indexing
More mastering the art of indexing
Yoshinori Matsunobu
 
Zend Framework 1 + Doctrine 2
Zend Framework 1 + Doctrine 2Zend Framework 1 + Doctrine 2
Zend Framework 1 + Doctrine 2
Ralph Schindler
 
Mongo or Die: How MongoDB Powers Doodle or Die
Mongo or Die: How MongoDB Powers Doodle or DieMongo or Die: How MongoDB Powers Doodle or Die
Mongo or Die: How MongoDB Powers Doodle or Die
Aaron Silverman
 
Webinar: General Technical Overview of MongoDB for Dev Teams
Webinar: General Technical Overview of MongoDB for Dev TeamsWebinar: General Technical Overview of MongoDB for Dev Teams
Webinar: General Technical Overview of MongoDB for Dev Teams
MongoDB
 
SQL? NoSQL? NewSQL?!? What's a Java developer to do? - PhillyETE 2012
SQL? NoSQL? NewSQL?!? What's a Java developer to do? - PhillyETE 2012SQL? NoSQL? NewSQL?!? What's a Java developer to do? - PhillyETE 2012
SQL? NoSQL? NewSQL?!? What's a Java developer to do? - PhillyETE 2012
Chris Richardson
 

What's hot (20)

2001: JNDI Its all in the Context
2001:  JNDI Its all in the Context2001:  JNDI Its all in the Context
2001: JNDI Its all in the Context
 
Sequel
SequelSequel
Sequel
 
Datacon LA - MySQL without the SQL - Oh my!
Datacon LA - MySQL without the SQL - Oh my! Datacon LA - MySQL without the SQL - Oh my!
Datacon LA - MySQL without the SQL - Oh my!
 
Security in Android Applications / Александр Смирнов (RedMadRobot)
Security in Android Applications / Александр Смирнов (RedMadRobot)Security in Android Applications / Александр Смирнов (RedMadRobot)
Security in Android Applications / Александр Смирнов (RedMadRobot)
 
MySQL JSON Functions
MySQL JSON FunctionsMySQL JSON Functions
MySQL JSON Functions
 
Hidden pearls for High-Performance-Persistence
Hidden pearls for High-Performance-PersistenceHidden pearls for High-Performance-Persistence
Hidden pearls for High-Performance-Persistence
 
MongoDB @ Frankfurt NoSql User Group
MongoDB @  Frankfurt NoSql User GroupMongoDB @  Frankfurt NoSql User Group
MongoDB @ Frankfurt NoSql User Group
 
Jndi
JndiJndi
Jndi
 
MongoDB .local Munich 2019: New Encryption Capabilities in MongoDB 4.2: A Dee...
MongoDB .local Munich 2019: New Encryption Capabilities in MongoDB 4.2: A Dee...MongoDB .local Munich 2019: New Encryption Capabilities in MongoDB 4.2: A Dee...
MongoDB .local Munich 2019: New Encryption Capabilities in MongoDB 4.2: A Dee...
 
Json within a relational database
Json within a relational databaseJson within a relational database
Json within a relational database
 
Spring.io
Spring.ioSpring.io
Spring.io
 
Php &amp; my sql - how do pdo, mysq-li, and x devapi do what they do
Php &amp; my sql  - how do pdo, mysq-li, and x devapi do what they doPhp &amp; my sql  - how do pdo, mysq-li, and x devapi do what they do
Php &amp; my sql - how do pdo, mysq-li, and x devapi do what they do
 
JavaScript and Friends August 20th, 20201 -- MySQL Shell and JavaScript
JavaScript and Friends August 20th, 20201 -- MySQL Shell and JavaScriptJavaScript and Friends August 20th, 20201 -- MySQL Shell and JavaScript
JavaScript and Friends August 20th, 20201 -- MySQL Shell and JavaScript
 
MySQL 8.0 Operational Changes
MySQL 8.0 Operational ChangesMySQL 8.0 Operational Changes
MySQL 8.0 Operational Changes
 
Java/Scala Lab: Борис Трофимов - Обжигающая Big Data.
Java/Scala Lab: Борис Трофимов - Обжигающая Big Data.Java/Scala Lab: Борис Трофимов - Обжигающая Big Data.
Java/Scala Lab: Борис Трофимов - Обжигающая Big Data.
 
More mastering the art of indexing
More mastering the art of indexingMore mastering the art of indexing
More mastering the art of indexing
 
Zend Framework 1 + Doctrine 2
Zend Framework 1 + Doctrine 2Zend Framework 1 + Doctrine 2
Zend Framework 1 + Doctrine 2
 
Mongo or Die: How MongoDB Powers Doodle or Die
Mongo or Die: How MongoDB Powers Doodle or DieMongo or Die: How MongoDB Powers Doodle or Die
Mongo or Die: How MongoDB Powers Doodle or Die
 
Webinar: General Technical Overview of MongoDB for Dev Teams
Webinar: General Technical Overview of MongoDB for Dev TeamsWebinar: General Technical Overview of MongoDB for Dev Teams
Webinar: General Technical Overview of MongoDB for Dev Teams
 
SQL? NoSQL? NewSQL?!? What's a Java developer to do? - PhillyETE 2012
SQL? NoSQL? NewSQL?!? What's a Java developer to do? - PhillyETE 2012SQL? NoSQL? NewSQL?!? What's a Java developer to do? - PhillyETE 2012
SQL? NoSQL? NewSQL?!? What's a Java developer to do? - PhillyETE 2012
 

Similar to MySQLでNoSQL - アメーバピグでのNoSQLの実例

iloug2015.Mysql.for.oracle.dba.V2
iloug2015.Mysql.for.oracle.dba.V2iloug2015.Mysql.for.oracle.dba.V2
iloug2015.Mysql.for.oracle.dba.V2Baruch Osoveskiy
 
Mla2011 final draft
Mla2011 final draftMla2011 final draft
Mla2011 final draft
George Boston
 
Squeak DBX
Squeak DBXSqueak DBX
Squeak DBX
ESUG
 
20141011 mastering mysqlnd
20141011 mastering mysqlnd20141011 mastering mysqlnd
20141011 mastering mysqlnd
do_aki
 
20171104 hk-py con-mysql-documentstore_v1
20171104 hk-py con-mysql-documentstore_v120171104 hk-py con-mysql-documentstore_v1
20171104 hk-py con-mysql-documentstore_v1
Ivan Ma
 
Spring & Hibernate
Spring & HibernateSpring & Hibernate
Spring & Hibernate
Jiayun Zhou
 
PythonDatabaseAPI -Presentation for Database
PythonDatabaseAPI -Presentation for DatabasePythonDatabaseAPI -Presentation for Database
PythonDatabaseAPI -Presentation for Database
dharawagh9999
 
Icinga 2009 at OSMC
Icinga 2009 at OSMCIcinga 2009 at OSMC
Icinga 2009 at OSMC
Icinga
 
DjangoCon 2010 Scaling Disqus
DjangoCon 2010 Scaling DisqusDjangoCon 2010 Scaling Disqus
DjangoCon 2010 Scaling Disqus
zeeg
 
豆瓣技术架构的发展历程
豆瓣技术架构的发展历程豆瓣技术架构的发展历程
豆瓣技术架构的发展历程George Ang
 
豆瓣 Qcon2009 Beijing
豆瓣 Qcon2009 Beijing豆瓣 Qcon2009 Beijing
豆瓣 Qcon2009 Beijingyiditushe
 
Jakarta EE 8 on JDK17
Jakarta EE 8 on JDK17Jakarta EE 8 on JDK17
Jakarta EE 8 on JDK17
Rudy De Busscher
 
MySQL Ecosystem in 2020
MySQL Ecosystem in 2020MySQL Ecosystem in 2020
MySQL Ecosystem in 2020
Alkin Tezuysal
 
MySQL Shell: the daily tool for devs and admins. By Vittorio Cioe.
MySQL Shell: the daily tool for devs and admins. By Vittorio Cioe.MySQL Shell: the daily tool for devs and admins. By Vittorio Cioe.
MySQL Shell: the daily tool for devs and admins. By Vittorio Cioe.
Cloud Native Day Tel Aviv
 
Play Framework and Activator
Play Framework and ActivatorPlay Framework and Activator
Play Framework and Activator
Kevin Webber
 
MySQL Shell - The Best MySQL DBA Tool
MySQL Shell - The Best MySQL DBA ToolMySQL Shell - The Best MySQL DBA Tool
MySQL Shell - The Best MySQL DBA Tool
Miguel Araújo
 
Develop Python Applications with MySQL Connector/Python
Develop Python Applications with MySQL Connector/PythonDevelop Python Applications with MySQL Connector/Python
Develop Python Applications with MySQL Connector/Python
Jesper Wisborg Krogh
 
Python在豆瓣的应用
Python在豆瓣的应用Python在豆瓣的应用
Python在豆瓣的应用
Qiangning Hong
 
MySQL Day Paris 2016 - State Of The Dolphin
MySQL Day Paris 2016 - State Of The DolphinMySQL Day Paris 2016 - State Of The Dolphin
MySQL Day Paris 2016 - State Of The Dolphin
Olivier DASINI
 
Python and the MySQL Document Store
Python and the MySQL Document StorePython and the MySQL Document Store
Python and the MySQL Document Store
Jesper Wisborg Krogh
 

Similar to MySQLでNoSQL - アメーバピグでのNoSQLの実例 (20)

iloug2015.Mysql.for.oracle.dba.V2
iloug2015.Mysql.for.oracle.dba.V2iloug2015.Mysql.for.oracle.dba.V2
iloug2015.Mysql.for.oracle.dba.V2
 
Mla2011 final draft
Mla2011 final draftMla2011 final draft
Mla2011 final draft
 
Squeak DBX
Squeak DBXSqueak DBX
Squeak DBX
 
20141011 mastering mysqlnd
20141011 mastering mysqlnd20141011 mastering mysqlnd
20141011 mastering mysqlnd
 
20171104 hk-py con-mysql-documentstore_v1
20171104 hk-py con-mysql-documentstore_v120171104 hk-py con-mysql-documentstore_v1
20171104 hk-py con-mysql-documentstore_v1
 
Spring & Hibernate
Spring & HibernateSpring & Hibernate
Spring & Hibernate
 
PythonDatabaseAPI -Presentation for Database
PythonDatabaseAPI -Presentation for DatabasePythonDatabaseAPI -Presentation for Database
PythonDatabaseAPI -Presentation for Database
 
Icinga 2009 at OSMC
Icinga 2009 at OSMCIcinga 2009 at OSMC
Icinga 2009 at OSMC
 
DjangoCon 2010 Scaling Disqus
DjangoCon 2010 Scaling DisqusDjangoCon 2010 Scaling Disqus
DjangoCon 2010 Scaling Disqus
 
豆瓣技术架构的发展历程
豆瓣技术架构的发展历程豆瓣技术架构的发展历程
豆瓣技术架构的发展历程
 
豆瓣 Qcon2009 Beijing
豆瓣 Qcon2009 Beijing豆瓣 Qcon2009 Beijing
豆瓣 Qcon2009 Beijing
 
Jakarta EE 8 on JDK17
Jakarta EE 8 on JDK17Jakarta EE 8 on JDK17
Jakarta EE 8 on JDK17
 
MySQL Ecosystem in 2020
MySQL Ecosystem in 2020MySQL Ecosystem in 2020
MySQL Ecosystem in 2020
 
MySQL Shell: the daily tool for devs and admins. By Vittorio Cioe.
MySQL Shell: the daily tool for devs and admins. By Vittorio Cioe.MySQL Shell: the daily tool for devs and admins. By Vittorio Cioe.
MySQL Shell: the daily tool for devs and admins. By Vittorio Cioe.
 
Play Framework and Activator
Play Framework and ActivatorPlay Framework and Activator
Play Framework and Activator
 
MySQL Shell - The Best MySQL DBA Tool
MySQL Shell - The Best MySQL DBA ToolMySQL Shell - The Best MySQL DBA Tool
MySQL Shell - The Best MySQL DBA Tool
 
Develop Python Applications with MySQL Connector/Python
Develop Python Applications with MySQL Connector/PythonDevelop Python Applications with MySQL Connector/Python
Develop Python Applications with MySQL Connector/Python
 
Python在豆瓣的应用
Python在豆瓣的应用Python在豆瓣的应用
Python在豆瓣的应用
 
MySQL Day Paris 2016 - State Of The Dolphin
MySQL Day Paris 2016 - State Of The DolphinMySQL Day Paris 2016 - State Of The Dolphin
MySQL Day Paris 2016 - State Of The Dolphin
 
Python and the MySQL Document Store
Python and the MySQL Document StorePython and the MySQL Document Store
Python and the MySQL Document Store
 

More from Kazuhiro Oinuma

カジュアルに本番データを開発環境に入れる #mysqlcasual
カジュアルに本番データを開発環境に入れる #mysqlcasualカジュアルに本番データを開発環境に入れる #mysqlcasual
カジュアルに本番データを開発環境に入れる #mysqlcasual
Kazuhiro Oinuma
 
Vagrant環境のAnsibleを速くしたい
Vagrant環境のAnsibleを速くしたいVagrant環境のAnsibleを速くしたい
Vagrant環境のAnsibleを速くしたい
Kazuhiro Oinuma
 
運用に効く!JVMオプション三選
運用に効く!JVMオプション三選運用に効く!JVMオプション三選
運用に効く!JVMオプション三選
Kazuhiro Oinuma
 
コードはナマモノ 腐らせないために今までやってきたこと
コードはナマモノ 腐らせないために今までやってきたことコードはナマモノ 腐らせないために今までやってきたこと
コードはナマモノ 腐らせないために今までやってきたことKazuhiro Oinuma
 
20120524 english lt2_pythontoolsfortesting
20120524 english lt2_pythontoolsfortesting20120524 english lt2_pythontoolsfortesting
20120524 english lt2_pythontoolsfortestingKazuhiro Oinuma
 
rsyncのちょっとイイ話
rsyncのちょっとイイ話rsyncのちょっとイイ話
rsyncのちょっとイイ話Kazuhiro Oinuma
 

More from Kazuhiro Oinuma (6)

カジュアルに本番データを開発環境に入れる #mysqlcasual
カジュアルに本番データを開発環境に入れる #mysqlcasualカジュアルに本番データを開発環境に入れる #mysqlcasual
カジュアルに本番データを開発環境に入れる #mysqlcasual
 
Vagrant環境のAnsibleを速くしたい
Vagrant環境のAnsibleを速くしたいVagrant環境のAnsibleを速くしたい
Vagrant環境のAnsibleを速くしたい
 
運用に効く!JVMオプション三選
運用に効く!JVMオプション三選運用に効く!JVMオプション三選
運用に効く!JVMオプション三選
 
コードはナマモノ 腐らせないために今までやってきたこと
コードはナマモノ 腐らせないために今までやってきたことコードはナマモノ 腐らせないために今までやってきたこと
コードはナマモノ 腐らせないために今までやってきたこと
 
20120524 english lt2_pythontoolsfortesting
20120524 english lt2_pythontoolsfortesting20120524 english lt2_pythontoolsfortesting
20120524 english lt2_pythontoolsfortesting
 
rsyncのちょっとイイ話
rsyncのちょっとイイ話rsyncのちょっとイイ話
rsyncのちょっとイイ話
 

Recently uploaded

GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
GridMate - End to end testing is a critical piece to ensure quality and avoid...
GridMate - End to end testing is a critical piece to ensure quality and avoid...GridMate - End to end testing is a critical piece to ensure quality and avoid...
GridMate - End to end testing is a critical piece to ensure quality and avoid...
ThomasParaiso2
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
Uni Systems S.M.S.A.
 
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
Neo4j
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
Octavian Nadolu
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
Neo4j
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Paige Cruz
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
Neo4j
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
KatiaHIMEUR1
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
DianaGray10
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
Neo4j
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Aggregage
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
Alpen-Adria-Universität
 
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
James Anderson
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
DianaGray10
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
danishmna97
 
By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024
Pierluigi Pugliese
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex ProofszkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
Alex Pruden
 

Recently uploaded (20)

GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
GridMate - End to end testing is a critical piece to ensure quality and avoid...
GridMate - End to end testing is a critical piece to ensure quality and avoid...GridMate - End to end testing is a critical piece to ensure quality and avoid...
GridMate - End to end testing is a critical piece to ensure quality and avoid...
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
 
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
 
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
 
By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex ProofszkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
 

MySQLでNoSQL - アメーバピグでのNoSQLの実例

  • 1. MySQL NoSQL NoSQL MySQL Casual Talks #2
  • 2.
  • 3.
  • 4.
  • 5. id: oinume ( : )
  • 6. id: oinume ( : ) • 2010 3
  • 7. id: oinume ( : ) • 2010 3 •
  • 8. id: oinume ( : ) • 2010 3 • • SQL MySQL
  • 9. id: oinume ( : ) • 2010 3 • • SQL MySQL • ver 3.23 MySQL
  • 10.
  • 11. • MySQL NoSQL( )
  • 12. • MySQL NoSQL( ) • MySQL
  • 13. • MySQL NoSQL( ) • MySQL • NoSQL(KVS)
  • 14. • MySQL NoSQL( ) • MySQL • NoSQL(KVS) • NoSQL(KVS)
  • 15.
  • 16.
  • 17. Fusion-IO
  • 18. Fusion-IO • (Java)
  • 19. Fusion-IO • (Java) • MySQL
  • 20. Fusion-IO • (Java) • MySQL • Oracle
  • 21. Fusion-IO • (Java) • MySQL • Oracle •
  • 22.
  • 23.
  • 24.
  • 25. • • 2009 2
  • 26. • • 2009 2 • 800 ↑ (2011 7 )
  • 27. • • 2009 2 • 800 ↑ (2011 7 ) •
  • 28. • • 2009 2 • 800 ↑ (2011 7 ) • •
  • 29. • • 2009 2 • 800 ↑ (2011 7 ) • • •
  • 30. • • 2009 2 • 800 ↑ (2011 7 ) • • • • ( ) ← NEW
  • 31.
  • 32. Browser Web x 35 Memcached x 4 MySQL x 6 with FIO Socket x 70
  • 33. request Browser Web x 35 Memcached x 4 MySQL x 6 with FIO Socket x 70
  • 34. request Browser swf Web x 35 Memcached x 4 MySQL x 6 with FIO Socket x 70
  • 35. request Browser swf Web x 35 Memcached x 4 MySQL x 6 with FIO Socket x 70
  • 36. request Browser swf Web x 35 TCP Socket Memcached x 4 MySQL x 6 with FIO Socket x 70
  • 37. request Browser swf Web x 35 TCP Socket Memcached x 4 MySQL x 6 with FIO Socket x 70 Java
  • 38. request Browser swf Web x 35 TCP Socket Memcached x 4 MySQL x 6 with FIO Socket x 70 Java
  • 39. request Browser swf Web x 35 TCP Socket Memcached x 4 MySQL x 6 with FIO Socket x 70 Java
  • 40. request Browser swf Web x 35 TCP Socket Memcached x 4 MySQL x 6 with FIO Socket x 70 Java
  • 41.
  • 42.
  • 43. : 2.1Gbps
  • 44. : 2.1Gbps • : 100,000
  • 45. : 2.1Gbps • : 100,000 • Web: 36,000 req / s
  • 46. : 2.1Gbps • : 100,000 • Web: 36,000 req / s • Socket: 160,000 req / s
  • 47. : 2.1Gbps • : 100,000 • Web: 36,000 req / s • Socket: 160,000 req / s • Database: 52000 qps (read: 40000, write: 12000)
  • 48. MySQL
  • 49. MySQL
  • 50. MySQL • RDBMS
  • 51. MySQL • RDBMS • KVS + MySQL
  • 52. MySQL • RDBMS • KVS + MySQL • KVS MySQL
  • 53. MySQL • RDBMS • KVS + MySQL • KVS MySQL • IndexPersister MySQL KVS
  • 55. IndexPersister • Java MySQL • key / value • SQL •
  • 56.
  • 57. DDL CREATE TABLE `user` ( `id` varbinary(255) NOT NULL, `data` longblob NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8
  • 58. Java @Persistable("user") public class User { @IndexKey @Store(index=0) public int getUserId() { return userId; } @Store(index=1) public String getNickname() { return nickname; } .... }
  • 59. Java Java @Persistable("user") public class User { @IndexKey @Store(index=0) public int getUserId() { return userId; } @Store(index=1) public String getNickname() { return nickname; } .... }
  • 60. Java Java @Persistable("user") public class User { @IndexKey @Store(index=0) public int getUserId() { return userId; } @Store(index=1) public String getNickname() { return nickname; } .... }
  • 61. Java Java @Persistable("user") public class User { @IndexKey @Store(index=0) public int getUserId() { DB return userId; } index=0 0 @Store(index=1) public String getNickname() { return nickname; } .... }
  • 62. select hex(id), hex(data) from user order by id limit 1 ¥G hex(id) : 00000001 hex(data): 0700000006000000060103000000020000000E02000B7 97573616B752D3030303600000019020016E38286E38 186E38195E3818F36E58FB7E381A7E38199000000030 1010100000003010101FFFFFFFF
  • 63.
  • 64. load - 1 ID: 1 User user = persister.load(1, User.class); String nickname = user.getNickname(); ...
  • 65. fetch - 10 IndexQuery query = IndexQuery.all(); query.limit(10); List<User> users = persister.fetch(query, User.class); for (User user : users) ...
  • 66. fetch - (2) ID:2 User user = persister.load(2, User.class); IndexQuery query = IndexQuery.startWith(new IndexValue(user.getUserId())); List<UserItem> userItems = persister.fetch(query, UserItem.class);
  • 67. fetch - (2) @Persistable("user_item") public class UserItem { userId, itemId @IndexKey public IndexKey getKey() { KeyCreator.toValue(userId, itemId); } @Store(index=0) public int getUserId() { return userId; } @Store(index=1) public int getItemId() { return itemId; } .... }
  • 68. fetch - (2) userId itemId 1 1 1 2 1 3 2 10 2 20
  • 69. fetch - (2) User user = persister.load(2, User.class); IndexQuery query = IndexQuery.startWith(new IndexValue(user.getUserId())); List<UserItem> userItems = persister.fetch(query, UserItem.class); ◆ SQL select id, data from user_item where id >= {v1} and id < {v2} v1: 00000002 v2: 00000003
  • 70. • count • exists • remove • save (insert ... on duplicate key update)
  • 71.
  • 72.
  • 73. MySQL slow query
  • 74. MySQL slow query •
  • 75. MySQL slow query • • slow query
  • 76. MySQL slow query • • slow query • Java
  • 77. MySQL slow query • • slow query • Java •
  • 78.
  • 79. load
  • 80. load • MySQL context switch
  • 81. load • MySQL context switch • select ... where id in (...)
  • 82. load • MySQL context switch • select ... where id in (...) • 1 fetch ( )
  • 83. load • MySQL context switch • select ... where id in (...) • 1 fetch ( ) • key Column
  • 84. load • MySQL context switch • select ... where id in (...) • 1 fetch ( ) • key Column •
  • 85. load • MySQL context switch • select ... where id in (...) • 1 fetch ( ) • key Column • • 1 fetch 1000
  • 86. MySQL Key Value Store
  • 87. KVS
  • 88. KVS • SQL
  • 89. KVS • SQL • JOIN
  • 90. KVS • SQL • JOIN • ( )INDEX
  • 91. KVS • SQL • JOIN • ( )INDEX • ( )
  • 92. KVS • SQL • JOIN • ( )INDEX • ( ) • ALTER TABLE
  • 93. KVS • SQL • JOIN • ( )INDEX • ( ) • ALTER TABLE •
  • 94. KVS • SQL • JOIN • ( )INDEX • ( ) • ALTER TABLE • •
  • 95. KVS • SQL • JOIN • ( )INDEX • ( ) • ALTER TABLE • • • mongoDB KVS
  • 96. KVS • SQL • JOIN • ( )INDEX • ( ) • ALTER TABLE • • • mongoDB KVS • Ameba Pico mongoDB
  • 97.
  • 98. Column
  • 99. Column •
  • 100. Column • • Column
  • 101. Column • • Column •
  • 102. Column • • Column • •
  • 103. Column • • Column • • • Column (ALTER TABLE)
  • 104. Column • • Column • • • Column (ALTER TABLE) • short -> int Column

Editor's Notes

  1. \n
  2. \n
  3. \n
  4. \n
  5. \n
  6. \n
  7. \n
  8. \n
  9. \n
  10. \n
  11. \n
  12. \n
  13. \n
  14. \n
  15. \n
  16. \n
  17. \n
  18. \n
  19. \n
  20. \n
  21. \n
  22. \n
  23. \n
  24. \n
  25. \n
  26. \n
  27. \n
  28. \n
  29. \n
  30. \n
  31. \n
  32. \n
  33. \n
  34. \n
  35. \n
  36. \n
  37. \n
  38. \n
  39. \n
  40. \n
  41. \n
  42. \n
  43. \n
  44. \n
  45. \n
  46. \n
  47. \n
  48. \n
  49. \n
  50. \n
  51. \n
  52. \n
  53. \n
  54. \n
  55. \n
  56. \n
  57. \n
  58. \n
  59. \n
  60. \n
  61. \n
  62. \n
  63. \n
  64. \n
  65. \n
  66. \n
  67. \n
  68. \n
  69. \n
  70. \n
  71. \n
  72. \n
  73. \n
  74. \n
  75. \n
  76. \n
  77. \n
  78. \n
  79. \n
  80. \n
  81. \n
  82. \n
  83. \n
  84. \n
  85. \n
  86. \n
  87. \n
  88. \n
  89. \n
  90. \n
  91. \n
  92. \n
  93. \n
  94. \n