SlideShare ist ein Scribd-Unternehmen logo
1 von 107
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の実例

Weitere ähnliche Inhalte

Was ist angesagt?

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 ContextRussell Castagnaro
 
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
 
Hidden pearls for High-Performance-Persistence
Hidden pearls for High-Performance-PersistenceHidden pearls for High-Performance-Persistence
Hidden pearls for High-Performance-PersistenceSven 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 databaseDave Stokes
 
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 doDave 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 JavaScriptDave Stokes
 
MySQL 8.0 Operational Changes
MySQL 8.0 Operational ChangesMySQL 8.0 Operational Changes
MySQL 8.0 Operational ChangesDave 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 indexingYoshinori Matsunobu
 
Zend Framework 1 + Doctrine 2
Zend Framework 1 + Doctrine 2Zend Framework 1 + Doctrine 2
Zend Framework 1 + Doctrine 2Ralph 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 DieAaron 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 TeamsMongoDB
 
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 2012Chris Richardson
 

Was ist angesagt? (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
 

Ähnlich wie 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
 
Squeak DBX
Squeak DBXSqueak DBX
Squeak DBXESUG
 
20141011 mastering mysqlnd
20141011 mastering mysqlnd20141011 mastering mysqlnd
20141011 mastering mysqlnddo_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_v1Ivan Ma
 
Spring & Hibernate
Spring & HibernateSpring & Hibernate
Spring & HibernateJiayun Zhou
 
PythonDatabaseAPI -Presentation for Database
PythonDatabaseAPI -Presentation for DatabasePythonDatabaseAPI -Presentation for Database
PythonDatabaseAPI -Presentation for Databasedharawagh9999
 
Icinga 2009 at OSMC
Icinga 2009 at OSMCIcinga 2009 at OSMC
Icinga 2009 at OSMCIcinga
 
DjangoCon 2010 Scaling Disqus
DjangoCon 2010 Scaling DisqusDjangoCon 2010 Scaling Disqus
DjangoCon 2010 Scaling Disquszeeg
 
豆瓣技术架构的发展历程
豆瓣技术架构的发展历程豆瓣技术架构的发展历程
豆瓣技术架构的发展历程George Ang
 
豆瓣 Qcon2009 Beijing
豆瓣 Qcon2009 Beijing豆瓣 Qcon2009 Beijing
豆瓣 Qcon2009 Beijingyiditushe
 
MySQL Ecosystem in 2020
MySQL Ecosystem in 2020MySQL Ecosystem in 2020
MySQL Ecosystem in 2020Alkin 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 ActivatorKevin 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 ToolMiguel 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/PythonJesper 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 DolphinOlivier DASINI
 
Python and the MySQL Document Store
Python and the MySQL Document StorePython and the MySQL Document Store
Python and the MySQL Document StoreJesper Wisborg Krogh
 

Ähnlich wie 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
 

Mehr von Kazuhiro Oinuma

カジュアルに本番データを開発環境に入れる #mysqlcasual
カジュアルに本番データを開発環境に入れる #mysqlcasualカジュアルに本番データを開発環境に入れる #mysqlcasual
カジュアルに本番データを開発環境に入れる #mysqlcasualKazuhiro 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
 

Mehr von 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のちょっとイイ話
 

Kürzlich hochgeladen

DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamUiPathCommunity
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfOverkill Security
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024The Digital Insurer
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistandanishmna97
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024The Digital Insurer
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesrafiqahmad00786416
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusZilliz
 

Kürzlich hochgeladen (20)

DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdf
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 

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

Hinweis der Redaktion

  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