SlideShare una empresa de Scribd logo
1 de 43
Descargar para leer sin conexión
Writing Efficient Java Applications
for MySQL Cluster Using NDB/J

        Jess Balint <Jess.Balint@Sun.COM>
        Monty Taylor <mordred@Sun.COM>
                   (Sun Microsystems)
Agenda
    Basics of MySQL Cluster
●


    Basics of NDB API
●


    NDB/Bindings Project
●


    API Details
●


    Converting SQL
●


    Other Features
●
Agenda
    Basics of MySQL Cluster
➔


    Basics of NDB API
●


    NDB/Bindings Project
●


    API Details
●


    Converting SQL
●


    Other Features
●
What is MySQL Cluster?
    A shared nothing clustered database
●


    Supported in MySQL by a storage engine
●

    component
    In-memory database, with support for non-
●

    indexed columns on disk
    Transactional with synchronous commit across
●

    cluster
Data Distribution
    Horizontal partitioning
●


    Data is replicated across all data nodes in a
●

    node group and partitioned across node groups
                              HASH(pk)
           pk
Data Access
    One data node selected as transaction
●

    coordinator (TC)
        TC node can be chosen with TC hints
    –

    API node sends all commands to TC
●


        TC relays commands to other data nodes as
    –
        necessary
    Any node can send data back to the API node
●
Data Access & TC

              API




One storage node as
Transaction Coordinator (TC)


                          Nodegroup 0   Nodegroup 1
System Architecture

SQL Client                                            mysqld
                               mysqld



        mysqld                          Management Server
                                                    Mgm
                                                    client

                        Data
                       Nodes
       NDB API
                                                     NDB API
Agenda
    Basics of MySQL Cluster
●


    Basics of NDB API
➔


    NDB/Bindings Project
●


    API Details
●


    Converting SQL
●


    Other Features
●
Basics
    Low-level, object oriented C++ API based on
●

    storage operations (all examples shown in Java)
    Main NDB API Classes
●


        NdbClusterConnection
    –

        Ndb
    –

        NdbTransaction
    –

        NdbOperation (and subclasses)
    –

        NdbRecAttr (or NdbResultSet in NDB/Binding's
    –
        Java wrapper)
    Ndb is a database handle, typically one per
●

    thread.
Connecting
    Create a connection object
●


        NdbClusterConnection conn =
    –
                NdbClusterConnection.create(“localhost”);
    Connect to the management server
●


        conn.connect(/* retries -> */ 5, /* delay -> */ 3,
    –
                                         /* verbose -> */ true);
    Wait until connection to data node(s) is
●

    established
        conn.waitUntilReady(
    –
                 /* timeout for first ndbd connection */ 30,
                 /* timeout for connection to all ndbds */ 0);
Database Handle
    Ndb object is a handle for a specific database
●


        Ndb ndb = conn.createNdb(
    –
                    /* database */ quot;testquot;,
                    /* max # of tx on this handle */1024);
Transactions
    Every operation must be performed inside a
●

    transaction
    Any locks acquired are not released until the
●

    transaction completes
    Transaction is created from Ndb handle and
●

    used to create operations
        NdbTransaction trans = ndb.startTransaction();
    –

        NdbOperation op = trans.getInsertOperation(quot;xyquot;);
    –

        trans.execute(ExecType.Commit,
    –
                          AbortOption.AbortOnError, true);
Four Types of Operations
    Single row operations – read/write
●


        NdbOperation - based on it's primary key value
    –

        NdbIndexOperation - based on it's key value in a
    –
        given index
    Multiple row operations – read/write (no insert)
●


             These operations can be limited with NdbScanFilter
         ●



        NdbScanOperation - scan of the table
    –

        NdbIndexScanOperation – scan of an index
    –

             Can also be limited by specifying bounds on the index
         ●
Filtering in Operations
    Acquire the appropriate type from the
●

    transaction (see NdbTransaction)
        getUpdateOperation(), getSelectScanOperation(), etc
    –

    Single row operations
●


        Specify key value with equal*() method (equalInt,
    –
        equalString, etc)
    Multiple row operations
●


        setBound() for index scan
    –

        NdbScanFilter
    –
Accessing Data with Operations
    Read data
●


        readTuple(), readTuples()
    –

    Write data
●


        insertTuple() (NdbOperation only), updateTuple(),
    –
        deleteTuple()
        NdbScanOperation: lockCurrentTuple(),
    –
        updateCurrentTuple(), deleteCurrentTuple()
    Most of these calls are handled automatically
●

    by acquiring the correct operation from
    NdbTransaction
Agenda
    Basics of MySQL Cluster
●


    Basics of NDB API
●


    NDB/Bindings Project
➔


    API Details
●


    Converting SQL
●


    Other Features
●
What is NDB/Bindings?
    Language specific wrappers of C++ NDB API
●


    Support for Java, Python, C#, Lua, Perl, PHP,
●

    Ruby, XML
        Generated with SWIG and many language-specific
    –
        customizations
    Currently only runs on UNIX/Linux
●


    Java wrapper referred to as NDB/J
●


        Includes NdbResultSet class with wide range of
    –
        data types
Perl
                                          Java
PHP                            .NET
          Python    Ruby                         DELETE
                                UPDATE
           INSERT
                                                        mysqld
                               mysqld
         mysqld



                                        Management Server
                                                     Mgm
                                                     client

                        Data
                       Nodes
      NDB API
                                                        NDB API


                                             update()
 update()
Perl
                                          Java
PHP                            .NET
          Python    Ruby                         DELETE
                                UPDATE
           INSERT
                                                        mysqld
                               mysqld
         mysqld



                                        Management Server
                                                     Mgm
                                                     client

                        Data
                       Nodes
      NDB API
                                                        NDB API


                                             update()
 update()
Complete Example
    Many examples in
●

    /java/src/java/com/mysql/cluster/ndbj/examples
NdbClusterConnection conn =
 NdbClusterConnection.create(quot;localhostquot;);
conn.connect(5, 3, true);
conn.waitUntilReady(30, 0);
Ndb ndb = conn.createNdb(quot;testquot;, 1024);
NdbTransaction trans = ndb.startTransaction();
Complete Example Cont'd
NdbOperation op =
 trans.getInsertOperation(quot;xyquot;);
op.equalInt(quot;idquot;, 1); /* declare PK value */
op.setString(quot;col1quot;, quot;value Aquot;);
op.setString(quot;col2quot;, quot;value Bquot;);
trans.execute(ExecType.Commit,
              AbortOption.AbortOnError, true);
trans.close();
Reading Results
    C++ and other wrappers use NdbRecAttr
●


    In Java, we have NdbResultSet
●


    Similar usage to JDBC ResultSet
●


    One NdbResultSet per operation
●


        Obtained by calling op.resultData()
    –

    Not valid until transaction is executed
●


    Not compatible with lock transfers on scans
●

    (more on this soon)
Agenda
    Basics of MySQL Cluster
●


    Basics of NDB API
●


    NDB/Bindings Project
●


    API Details
➔


    Converting SQL
●


    Other Features
●
Error Handling
    NDB/J throws an exception if an NDB API call
●

    returns an error
    Everything derives from the checked
●

    NdbApiException class
        Immediate subclasses include permanent and
    –
        temporary errors
        Concrete classes include
    –

             Permanent: constraint violations, internal error, schema
         ●

             error, schema object exists, no data found
             Temporary: insufficient space, node recovery error, node
         ●

             shut down, timeout expired
Using Scan Filters
    Can be used on NdbScanOperation and
●

    NdbIndexScanOperation
    Example: SQL equivalent of a = 1 AND b > 200
●


        NdbScanFilter sf = scanOp.getNdbScanFilter();
    –

        sf.begin(Group.AND);
    –

        sf.eq(“a”, 1);
    –

        sf.gt(“b”, 200);
    –

        sf.end();
    –
NdbResultSet
    op.getValue() must be called for each field
●

    retrieved (or getBlob() for BLOBs)
    get*() calls on NdbResultSet must match type
●

    of field (same as NdbRecAttr)
Executing and Committing
                Transactions
    Shown earlier when inserting a tuple:
●


        trans.execute(ExecType.Commit,
    –
                      AbortOption.AbortOnError, true);
    We can also execute the transaction without
●

    committing by using ExecType.NoCommit
        Used when reading data
    –

    Arbitrary sets of operations can be included in a
●

    transaction
Scanning and Locks
    Shared locks are upgraded to exclusive locks
●

    when updating/deleting a tuple
    The transaction must be committed before
●

    reading the next set of tuples from the operation
    (when nextResult() returns 1/2, not 0)
    Locks can be transferred between transactions
●


        NdbOperation.lockCurrentTuple(NdbTransaction)
    –

        The transaction owning the operation will takeover
    –
        the lock from the transaction passed
Agenda
    Basics of MySQL Cluster
●


    Basics of NDB API
●


    NDB/Bindings Project
●


    API Details
●


    Converting SQL
➔


    Other Features
●
Single Table Queries
    Using operations as shown before
●


    SELECT A, B FROM TBL1 WHERE A = 1
●


        If A is a unique key, use NdbOperation or
    –
        NdbIndexOperation
        If A is not unique, NdbIndexScanOperation, or if
    –
        unindexed, NdbScanOperation
    WHERE A = 1 and B = 1
●


        If either column is indexed, use
    –
        NdbIndexScanOperation with NdbScanFilter
        Otherwise, add both to NdbScanFilter
    –
Multiple Table Queries
    Join options
●


        Nested loop join
    –

        Parallel scans on ordered indexes
    –
Nested Loop Join

   Outer Loop
 S over first table
  can
 PKif available
 Once for each row:
     Inner/Nested Loop
    Index scan for tuples
    matching current key
Nested Loop Example, Pt 1
/* setup scan for outer loop, set bounds/filter if necessary */
NdbIndexScanOperation op1 =
 trans.getSelectIndexScanOperation(
 quot;PRIMARYquot;, tablename, LockMode.LM_Exclusive,
 ScanFlag.ORDER_BY, 10, 10);
NdbResultSet rs1 = op1.resultData();
rs1.getValue(“key”);
rs1.getValue(“other_field”);
trans.execute(ExecType.NoCommit, ....);
Nested Loop Example, Pt 2
while (rs1.next()) { /* begin outer loop */
 keyValue = rs1.getInt(“key”);
 NdbIndexScanOperation op2 =
   trans.getSelectIndexScanOperation(index, tbl);
 op2.setBoundInt(“key”, BoundType.BoundEQ,
                 keyValue);
 NdbResultSet rs2 = op2.resultData();
 rs2.getValue(“joined_field”);
 trans.execute(ExecType.NoCommit, ....);
Nested Loop Example, Pt 3
 while (rs2.next()) { /* begin inner loop */
  String joinedVal = rs2.getString(“joined_field”);
  /* process tuple using key, other_field, and
     joined field */
 } /* end inner loop */
} /* end outer loop */
trans.execute(ExecType.NoCommit, ....);
trans.close();
Guidelines
    You can do arbitrary query filtering in the
●

    application, but try to push as much as possible
    to data nodes
    Using batching where possible to reduce record
●

    requests
    Aggregations can be done intuitively based on
●

    needs, eg. sum via accumulator
Agenda
    Basics of MySQL Cluster
●


    Basics of NDB API
●


    NDB/Bindings Project
●


    API Details
●


    Converting SQL
●


    Other Features
➔
Atomic Increment
    Increment a field without fetching the tuple
●


trans = ndb.startTransaction();
NdbAtomicOperation aOp =
 trans.getAtomicUpdateOperation(tablename);
aOp.equalInt(quot;idquot;, 1);
aOp.increment(quot;agequot;, 2);
trans.executeCommit();
trans.close();
Asynchronous Transactions
    Create a transaction and operations as usual
●


    Instantiate custom callback class
●


    Call trans.executeAsynchPrepare() with
●

    callback handler
    Call ndb.sendPollNdb() to execute transaction
●

    asynchronously
BLOB Handling
    Blobs access via blob handle class NdbBlob
●


    Write blobs with setNull() or setValue(byte [])
●


    Read data
●


        getData() - full blob value as byte array
    –

        readData(byte [], long) - piecewise retrieval into
    –
        existing byte array
        Also getLength() and getNull()
    –
Events
    Notify application when data is updated
●


    Use NdbEventOperation
●


    Ndb.createEventOperation()
●


    Get NdbResultSet from operation
●


    Execute operation
●


    Ndb.pollEvents()
●


    Ndb.nextEvent()
●


    Get results from NdbResultSet
●
Next Steps
    Read through the API for classes you are using
●

    to become familiar with them
    Look at some other material
●


        Johan Andersson, MySQL Conf 2007
    –
             Developing High Performance Applications using NDB API
         ●


             Developing High Performance Applications using NDB/J
         ●



    Explore Other Features
●


        TC hint, MGM API
    –

Más contenido relacionado

La actualidad más candente

Scalable XQuery Processing with Zorba on top of MongoDB
Scalable XQuery Processing with Zorba on top of MongoDBScalable XQuery Processing with Zorba on top of MongoDB
Scalable XQuery Processing with Zorba on top of MongoDBWilliam Candillon
 
Andrzej Ludwikowski - Event Sourcing - co może pójść nie tak?
Andrzej Ludwikowski -  Event Sourcing - co może pójść nie tak?Andrzej Ludwikowski -  Event Sourcing - co może pójść nie tak?
Andrzej Ludwikowski - Event Sourcing - co może pójść nie tak?SegFaultConf
 
Qt on Real Time Operating Systems
Qt on Real Time Operating SystemsQt on Real Time Operating Systems
Qt on Real Time Operating Systemsaccount inactive
 
Orion Context Broker NGSI-v2 Overview for Developers That Already Know Ngsi-v...
Orion Context Broker NGSI-v2 Overview for Developers That Already Know Ngsi-v...Orion Context Broker NGSI-v2 Overview for Developers That Already Know Ngsi-v...
Orion Context Broker NGSI-v2 Overview for Developers That Already Know Ngsi-v...Fermin Galan
 
KVSの性能、RDBMSのインデックス、更にMapReduceを併せ持つAll-in-One NoSQL: MongoDB
KVSの性能、RDBMSのインデックス、更にMapReduceを併せ持つAll-in-One NoSQL: MongoDB KVSの性能、RDBMSのインデックス、更にMapReduceを併せ持つAll-in-One NoSQL: MongoDB
KVSの性能、RDBMSのインデックス、更にMapReduceを併せ持つAll-in-One NoSQL: MongoDB Rakuten Group, Inc.
 
Java Persistence Frameworks for MongoDB
Java Persistence Frameworks for MongoDBJava Persistence Frameworks for MongoDB
Java Persistence Frameworks for MongoDBTobias Trelle
 
What is new and cool j2se & java
What is new and cool j2se & javaWhat is new and cool j2se & java
What is new and cool j2se & javaEugene Bogaart
 
Java Persistence Frameworks for MongoDB
Java Persistence Frameworks for MongoDBJava Persistence Frameworks for MongoDB
Java Persistence Frameworks for MongoDBMongoDB
 
Orion Context Broker NGSIv2 Overview for Developers That Already Know NGSIv1 ...
Orion Context Broker NGSIv2 Overview for Developers That Already Know NGSIv1 ...Orion Context Broker NGSIv2 Overview for Developers That Already Know NGSIv1 ...
Orion Context Broker NGSIv2 Overview for Developers That Already Know NGSIv1 ...Fermin Galan
 
Monitoring Cassandra with graphite using Yammer Coda-Hale Library
Monitoring Cassandra with graphite using Yammer Coda-Hale LibraryMonitoring Cassandra with graphite using Yammer Coda-Hale Library
Monitoring Cassandra with graphite using Yammer Coda-Hale LibraryNader Ganayem
 
Orion Context Broker NGSIv2 Overview for Developers That Already Know NGSIv1 ...
Orion Context Broker NGSIv2 Overview for Developers That Already Know NGSIv1 ...Orion Context Broker NGSIv2 Overview for Developers That Already Know NGSIv1 ...
Orion Context Broker NGSIv2 Overview for Developers That Already Know NGSIv1 ...Fermin Galan
 
Hazelcast and MongoDB at Cloud CMS
Hazelcast and MongoDB at Cloud CMSHazelcast and MongoDB at Cloud CMS
Hazelcast and MongoDB at Cloud CMSuzquiano
 
Qtp realtime scripts
Qtp realtime scriptsQtp realtime scripts
Qtp realtime scriptsRamu Palanki
 
Kerberizing spark. Spark Summit east
Kerberizing spark. Spark Summit eastKerberizing spark. Spark Summit east
Kerberizing spark. Spark Summit eastJorge Lopez-Malla
 
Best Practices in Qt Quick/QML - Part II
Best Practices in Qt Quick/QML - Part IIBest Practices in Qt Quick/QML - Part II
Best Practices in Qt Quick/QML - Part IIICS
 
JVM @ Taobao - QCon Hangzhou 2011
JVM @ Taobao - QCon Hangzhou 2011JVM @ Taobao - QCon Hangzhou 2011
JVM @ Taobao - QCon Hangzhou 2011Kris Mok
 
Android RenderScript on LLVM
Android RenderScript on LLVMAndroid RenderScript on LLVM
Android RenderScript on LLVMJohn Lee
 
Reactive Access to MongoDB from Java 8
Reactive Access to MongoDB from Java 8Reactive Access to MongoDB from Java 8
Reactive Access to MongoDB from Java 8Hermann Hueck
 

La actualidad más candente (20)

Scalable XQuery Processing with Zorba on top of MongoDB
Scalable XQuery Processing with Zorba on top of MongoDBScalable XQuery Processing with Zorba on top of MongoDB
Scalable XQuery Processing with Zorba on top of MongoDB
 
Andrzej Ludwikowski - Event Sourcing - co może pójść nie tak?
Andrzej Ludwikowski -  Event Sourcing - co może pójść nie tak?Andrzej Ludwikowski -  Event Sourcing - co może pójść nie tak?
Andrzej Ludwikowski - Event Sourcing - co może pójść nie tak?
 
Qt on Real Time Operating Systems
Qt on Real Time Operating SystemsQt on Real Time Operating Systems
Qt on Real Time Operating Systems
 
Orion Context Broker NGSI-v2 Overview for Developers That Already Know Ngsi-v...
Orion Context Broker NGSI-v2 Overview for Developers That Already Know Ngsi-v...Orion Context Broker NGSI-v2 Overview for Developers That Already Know Ngsi-v...
Orion Context Broker NGSI-v2 Overview for Developers That Already Know Ngsi-v...
 
KVSの性能、RDBMSのインデックス、更にMapReduceを併せ持つAll-in-One NoSQL: MongoDB
KVSの性能、RDBMSのインデックス、更にMapReduceを併せ持つAll-in-One NoSQL: MongoDB KVSの性能、RDBMSのインデックス、更にMapReduceを併せ持つAll-in-One NoSQL: MongoDB
KVSの性能、RDBMSのインデックス、更にMapReduceを併せ持つAll-in-One NoSQL: MongoDB
 
JSONiq - The SQL of NoSQL
JSONiq - The SQL of NoSQLJSONiq - The SQL of NoSQL
JSONiq - The SQL of NoSQL
 
Java Persistence Frameworks for MongoDB
Java Persistence Frameworks for MongoDBJava Persistence Frameworks for MongoDB
Java Persistence Frameworks for MongoDB
 
What is new and cool j2se & java
What is new and cool j2se & javaWhat is new and cool j2se & java
What is new and cool j2se & java
 
Java Persistence Frameworks for MongoDB
Java Persistence Frameworks for MongoDBJava Persistence Frameworks for MongoDB
Java Persistence Frameworks for MongoDB
 
Orion Context Broker NGSIv2 Overview for Developers That Already Know NGSIv1 ...
Orion Context Broker NGSIv2 Overview for Developers That Already Know NGSIv1 ...Orion Context Broker NGSIv2 Overview for Developers That Already Know NGSIv1 ...
Orion Context Broker NGSIv2 Overview for Developers That Already Know NGSIv1 ...
 
Monitoring Cassandra with graphite using Yammer Coda-Hale Library
Monitoring Cassandra with graphite using Yammer Coda-Hale LibraryMonitoring Cassandra with graphite using Yammer Coda-Hale Library
Monitoring Cassandra with graphite using Yammer Coda-Hale Library
 
Orion Context Broker NGSIv2 Overview for Developers That Already Know NGSIv1 ...
Orion Context Broker NGSIv2 Overview for Developers That Already Know NGSIv1 ...Orion Context Broker NGSIv2 Overview for Developers That Already Know NGSIv1 ...
Orion Context Broker NGSIv2 Overview for Developers That Already Know NGSIv1 ...
 
Hazelcast and MongoDB at Cloud CMS
Hazelcast and MongoDB at Cloud CMSHazelcast and MongoDB at Cloud CMS
Hazelcast and MongoDB at Cloud CMS
 
Qtp realtime scripts
Qtp realtime scriptsQtp realtime scripts
Qtp realtime scripts
 
Kerberizing spark. Spark Summit east
Kerberizing spark. Spark Summit eastKerberizing spark. Spark Summit east
Kerberizing spark. Spark Summit east
 
Best Practices in Qt Quick/QML - Part II
Best Practices in Qt Quick/QML - Part IIBest Practices in Qt Quick/QML - Part II
Best Practices in Qt Quick/QML - Part II
 
JVM @ Taobao - QCon Hangzhou 2011
JVM @ Taobao - QCon Hangzhou 2011JVM @ Taobao - QCon Hangzhou 2011
JVM @ Taobao - QCon Hangzhou 2011
 
Android RenderScript on LLVM
Android RenderScript on LLVMAndroid RenderScript on LLVM
Android RenderScript on LLVM
 
Opal compiler
Opal compilerOpal compiler
Opal compiler
 
Reactive Access to MongoDB from Java 8
Reactive Access to MongoDB from Java 8Reactive Access to MongoDB from Java 8
Reactive Access to MongoDB from Java 8
 

Similar a Efficient Java Apps for MySQL Cluster Using NDB/J

MySQL cluster workshop
MySQL cluster workshopMySQL cluster workshop
MySQL cluster workshop郁萍 王
 
MariaDB: Connect Storage Engine
MariaDB: Connect Storage EngineMariaDB: Connect Storage Engine
MariaDB: Connect Storage EngineKangaroot
 
Thu 1100 duncan_john_color
Thu 1100 duncan_john_colorThu 1100 duncan_john_color
Thu 1100 duncan_john_colorDATAVERSITY
 
Orchestration tool roundup kubernetes vs. docker vs. heat vs. terra form vs...
Orchestration tool roundup   kubernetes vs. docker vs. heat vs. terra form vs...Orchestration tool roundup   kubernetes vs. docker vs. heat vs. terra form vs...
Orchestration tool roundup kubernetes vs. docker vs. heat vs. terra form vs...Nati Shalom
 
Uri Cohen & Dan Kilman, GigaSpaces - Orchestration Tool Roundup - OpenStack l...
Uri Cohen & Dan Kilman, GigaSpaces - Orchestration Tool Roundup - OpenStack l...Uri Cohen & Dan Kilman, GigaSpaces - Orchestration Tool Roundup - OpenStack l...
Uri Cohen & Dan Kilman, GigaSpaces - Orchestration Tool Roundup - OpenStack l...Cloud Native Day Tel Aviv
 
Leveraging your Knowledge of ORM Towards Performance-based NoSQL Technology
Leveraging your Knowledge of ORM Towards Performance-based NoSQL TechnologyLeveraging your Knowledge of ORM Towards Performance-based NoSQL Technology
Leveraging your Knowledge of ORM Towards Performance-based NoSQL TechnologyDATAVERSITY
 
2016 feb-23 pyugre-py_mongo
2016 feb-23 pyugre-py_mongo2016 feb-23 pyugre-py_mongo
2016 feb-23 pyugre-py_mongoMichael Bright
 
Using MongoDB and Python
Using MongoDB and PythonUsing MongoDB and Python
Using MongoDB and PythonMike Bright
 
Dragoncraft Architectural Overview
Dragoncraft Architectural OverviewDragoncraft Architectural Overview
Dragoncraft Architectural Overviewjessesanford
 
My SQL Portal Database (Cluster)
My SQL Portal Database (Cluster)My SQL Portal Database (Cluster)
My SQL Portal Database (Cluster)Nicholas Adu Gyamfi
 
Orchestration tool roundup - OpenStack Israel summit - kubernetes vs. docker...
Orchestration tool roundup  - OpenStack Israel summit - kubernetes vs. docker...Orchestration tool roundup  - OpenStack Israel summit - kubernetes vs. docker...
Orchestration tool roundup - OpenStack Israel summit - kubernetes vs. docker...Uri Cohen
 
2015 02-09 - NoSQL Vorlesung Mosbach
2015 02-09 - NoSQL Vorlesung Mosbach2015 02-09 - NoSQL Vorlesung Mosbach
2015 02-09 - NoSQL Vorlesung MosbachJohannes Hoppe
 
MongoDB .local Bengaluru 2019: Using MongoDB Services in Kubernetes: Any Plat...
MongoDB .local Bengaluru 2019: Using MongoDB Services in Kubernetes: Any Plat...MongoDB .local Bengaluru 2019: Using MongoDB Services in Kubernetes: Any Plat...
MongoDB .local Bengaluru 2019: Using MongoDB Services in Kubernetes: Any Plat...MongoDB
 
The OSSCube MySQL High Availability Tutorial
The OSSCube MySQL High Availability TutorialThe OSSCube MySQL High Availability Tutorial
The OSSCube MySQL High Availability TutorialOSSCube
 
M|18 How MariaDB Server Scales with Spider
M|18 How MariaDB Server Scales with SpiderM|18 How MariaDB Server Scales with Spider
M|18 How MariaDB Server Scales with SpiderMariaDB plc
 
Building a serverless company on AWS lambda and Serverless framework
Building a serverless company on AWS lambda and Serverless frameworkBuilding a serverless company on AWS lambda and Serverless framework
Building a serverless company on AWS lambda and Serverless frameworkLuciano Mammino
 
MongoDB Live Hacking
MongoDB Live HackingMongoDB Live Hacking
MongoDB Live HackingTobias Trelle
 

Similar a Efficient Java Apps for MySQL Cluster Using NDB/J (20)

NoSQL with MySQL
NoSQL with MySQLNoSQL with MySQL
NoSQL with MySQL
 
MySQL cluster workshop
MySQL cluster workshopMySQL cluster workshop
MySQL cluster workshop
 
Ndb cluster 80_tpc_h
Ndb cluster 80_tpc_hNdb cluster 80_tpc_h
Ndb cluster 80_tpc_h
 
MariaDB: Connect Storage Engine
MariaDB: Connect Storage EngineMariaDB: Connect Storage Engine
MariaDB: Connect Storage Engine
 
ivanova-samba_backend.pdf
ivanova-samba_backend.pdfivanova-samba_backend.pdf
ivanova-samba_backend.pdf
 
Thu 1100 duncan_john_color
Thu 1100 duncan_john_colorThu 1100 duncan_john_color
Thu 1100 duncan_john_color
 
Orchestration tool roundup kubernetes vs. docker vs. heat vs. terra form vs...
Orchestration tool roundup   kubernetes vs. docker vs. heat vs. terra form vs...Orchestration tool roundup   kubernetes vs. docker vs. heat vs. terra form vs...
Orchestration tool roundup kubernetes vs. docker vs. heat vs. terra form vs...
 
Uri Cohen & Dan Kilman, GigaSpaces - Orchestration Tool Roundup - OpenStack l...
Uri Cohen & Dan Kilman, GigaSpaces - Orchestration Tool Roundup - OpenStack l...Uri Cohen & Dan Kilman, GigaSpaces - Orchestration Tool Roundup - OpenStack l...
Uri Cohen & Dan Kilman, GigaSpaces - Orchestration Tool Roundup - OpenStack l...
 
Leveraging your Knowledge of ORM Towards Performance-based NoSQL Technology
Leveraging your Knowledge of ORM Towards Performance-based NoSQL TechnologyLeveraging your Knowledge of ORM Towards Performance-based NoSQL Technology
Leveraging your Knowledge of ORM Towards Performance-based NoSQL Technology
 
2016 feb-23 pyugre-py_mongo
2016 feb-23 pyugre-py_mongo2016 feb-23 pyugre-py_mongo
2016 feb-23 pyugre-py_mongo
 
Using MongoDB and Python
Using MongoDB and PythonUsing MongoDB and Python
Using MongoDB and Python
 
Dragoncraft Architectural Overview
Dragoncraft Architectural OverviewDragoncraft Architectural Overview
Dragoncraft Architectural Overview
 
My SQL Portal Database (Cluster)
My SQL Portal Database (Cluster)My SQL Portal Database (Cluster)
My SQL Portal Database (Cluster)
 
Orchestration tool roundup - OpenStack Israel summit - kubernetes vs. docker...
Orchestration tool roundup  - OpenStack Israel summit - kubernetes vs. docker...Orchestration tool roundup  - OpenStack Israel summit - kubernetes vs. docker...
Orchestration tool roundup - OpenStack Israel summit - kubernetes vs. docker...
 
2015 02-09 - NoSQL Vorlesung Mosbach
2015 02-09 - NoSQL Vorlesung Mosbach2015 02-09 - NoSQL Vorlesung Mosbach
2015 02-09 - NoSQL Vorlesung Mosbach
 
MongoDB .local Bengaluru 2019: Using MongoDB Services in Kubernetes: Any Plat...
MongoDB .local Bengaluru 2019: Using MongoDB Services in Kubernetes: Any Plat...MongoDB .local Bengaluru 2019: Using MongoDB Services in Kubernetes: Any Plat...
MongoDB .local Bengaluru 2019: Using MongoDB Services in Kubernetes: Any Plat...
 
The OSSCube MySQL High Availability Tutorial
The OSSCube MySQL High Availability TutorialThe OSSCube MySQL High Availability Tutorial
The OSSCube MySQL High Availability Tutorial
 
M|18 How MariaDB Server Scales with Spider
M|18 How MariaDB Server Scales with SpiderM|18 How MariaDB Server Scales with Spider
M|18 How MariaDB Server Scales with Spider
 
Building a serverless company on AWS lambda and Serverless framework
Building a serverless company on AWS lambda and Serverless frameworkBuilding a serverless company on AWS lambda and Serverless framework
Building a serverless company on AWS lambda and Serverless framework
 
MongoDB Live Hacking
MongoDB Live HackingMongoDB Live Hacking
MongoDB Live Hacking
 

Más de MySQLConference

Memcached Functions For My Sql Seemless Caching In My Sql
Memcached Functions For My Sql Seemless Caching In My SqlMemcached Functions For My Sql Seemless Caching In My Sql
Memcached Functions For My Sql Seemless Caching In My SqlMySQLConference
 
Using Open Source Bi In The Real World
Using Open Source Bi In The Real WorldUsing Open Source Bi In The Real World
Using Open Source Bi In The Real WorldMySQLConference
 
Partitioning Under The Hood
Partitioning Under The HoodPartitioning Under The Hood
Partitioning Under The HoodMySQLConference
 
Tricks And Tradeoffs Of Deploying My Sql Clusters In The Cloud
Tricks And Tradeoffs Of Deploying My Sql Clusters In The CloudTricks And Tradeoffs Of Deploying My Sql Clusters In The Cloud
Tricks And Tradeoffs Of Deploying My Sql Clusters In The CloudMySQLConference
 
D Trace Support In My Sql Guide To Solving Reallife Performance Problems
D Trace Support In My Sql Guide To Solving Reallife Performance ProblemsD Trace Support In My Sql Guide To Solving Reallife Performance Problems
D Trace Support In My Sql Guide To Solving Reallife Performance ProblemsMySQLConference
 
My Sql Performance On Ec2
My Sql Performance On Ec2My Sql Performance On Ec2
My Sql Performance On Ec2MySQLConference
 
Inno Db Performance And Usability Patches
Inno Db Performance And Usability PatchesInno Db Performance And Usability Patches
Inno Db Performance And Usability PatchesMySQLConference
 
My Sql And Search At Craigslist
My Sql And Search At CraigslistMy Sql And Search At Craigslist
My Sql And Search At CraigslistMySQLConference
 
Solving Common Sql Problems With The Seq Engine
Solving Common Sql Problems With The Seq EngineSolving Common Sql Problems With The Seq Engine
Solving Common Sql Problems With The Seq EngineMySQLConference
 
Using Continuous Etl With Real Time Queries To Eliminate My Sql Bottlenecks
Using Continuous Etl With Real Time Queries To Eliminate My Sql BottlenecksUsing Continuous Etl With Real Time Queries To Eliminate My Sql Bottlenecks
Using Continuous Etl With Real Time Queries To Eliminate My Sql BottlenecksMySQLConference
 
Make Your Life Easier With Maatkit
Make Your Life Easier With MaatkitMake Your Life Easier With Maatkit
Make Your Life Easier With MaatkitMySQLConference
 
Getting The Most Out Of My Sql Enterprise Monitor 20
Getting The Most Out Of My Sql Enterprise Monitor 20Getting The Most Out Of My Sql Enterprise Monitor 20
Getting The Most Out Of My Sql Enterprise Monitor 20MySQLConference
 
Wide Open Spaces Using My Sql As A Web Mapping Service Backend
Wide Open Spaces Using My Sql As A Web Mapping Service BackendWide Open Spaces Using My Sql As A Web Mapping Service Backend
Wide Open Spaces Using My Sql As A Web Mapping Service BackendMySQLConference
 
Unleash The Power Of Your Data Using Open Source Business Intelligence
Unleash The Power Of Your Data Using Open Source Business IntelligenceUnleash The Power Of Your Data Using Open Source Business Intelligence
Unleash The Power Of Your Data Using Open Source Business IntelligenceMySQLConference
 
Inno Db Internals Inno Db File Formats And Source Code Structure
Inno Db Internals Inno Db File Formats And Source Code StructureInno Db Internals Inno Db File Formats And Source Code Structure
Inno Db Internals Inno Db File Formats And Source Code StructureMySQLConference
 
My Sql High Availability With A Punch Drbd 83 And Drbd For Dolphin Express
My Sql High Availability With A Punch Drbd 83 And Drbd For Dolphin ExpressMy Sql High Availability With A Punch Drbd 83 And Drbd For Dolphin Express
My Sql High Availability With A Punch Drbd 83 And Drbd For Dolphin ExpressMySQLConference
 

Más de MySQLConference (17)

Memcached Functions For My Sql Seemless Caching In My Sql
Memcached Functions For My Sql Seemless Caching In My SqlMemcached Functions For My Sql Seemless Caching In My Sql
Memcached Functions For My Sql Seemless Caching In My Sql
 
Using Open Source Bi In The Real World
Using Open Source Bi In The Real WorldUsing Open Source Bi In The Real World
Using Open Source Bi In The Real World
 
Partitioning Under The Hood
Partitioning Under The HoodPartitioning Under The Hood
Partitioning Under The Hood
 
Tricks And Tradeoffs Of Deploying My Sql Clusters In The Cloud
Tricks And Tradeoffs Of Deploying My Sql Clusters In The CloudTricks And Tradeoffs Of Deploying My Sql Clusters In The Cloud
Tricks And Tradeoffs Of Deploying My Sql Clusters In The Cloud
 
D Trace Support In My Sql Guide To Solving Reallife Performance Problems
D Trace Support In My Sql Guide To Solving Reallife Performance ProblemsD Trace Support In My Sql Guide To Solving Reallife Performance Problems
D Trace Support In My Sql Guide To Solving Reallife Performance Problems
 
My Sql Performance On Ec2
My Sql Performance On Ec2My Sql Performance On Ec2
My Sql Performance On Ec2
 
Inno Db Performance And Usability Patches
Inno Db Performance And Usability PatchesInno Db Performance And Usability Patches
Inno Db Performance And Usability Patches
 
My Sql And Search At Craigslist
My Sql And Search At CraigslistMy Sql And Search At Craigslist
My Sql And Search At Craigslist
 
The Smug Mug Tale
The Smug Mug TaleThe Smug Mug Tale
The Smug Mug Tale
 
Solving Common Sql Problems With The Seq Engine
Solving Common Sql Problems With The Seq EngineSolving Common Sql Problems With The Seq Engine
Solving Common Sql Problems With The Seq Engine
 
Using Continuous Etl With Real Time Queries To Eliminate My Sql Bottlenecks
Using Continuous Etl With Real Time Queries To Eliminate My Sql BottlenecksUsing Continuous Etl With Real Time Queries To Eliminate My Sql Bottlenecks
Using Continuous Etl With Real Time Queries To Eliminate My Sql Bottlenecks
 
Make Your Life Easier With Maatkit
Make Your Life Easier With MaatkitMake Your Life Easier With Maatkit
Make Your Life Easier With Maatkit
 
Getting The Most Out Of My Sql Enterprise Monitor 20
Getting The Most Out Of My Sql Enterprise Monitor 20Getting The Most Out Of My Sql Enterprise Monitor 20
Getting The Most Out Of My Sql Enterprise Monitor 20
 
Wide Open Spaces Using My Sql As A Web Mapping Service Backend
Wide Open Spaces Using My Sql As A Web Mapping Service BackendWide Open Spaces Using My Sql As A Web Mapping Service Backend
Wide Open Spaces Using My Sql As A Web Mapping Service Backend
 
Unleash The Power Of Your Data Using Open Source Business Intelligence
Unleash The Power Of Your Data Using Open Source Business IntelligenceUnleash The Power Of Your Data Using Open Source Business Intelligence
Unleash The Power Of Your Data Using Open Source Business Intelligence
 
Inno Db Internals Inno Db File Formats And Source Code Structure
Inno Db Internals Inno Db File Formats And Source Code StructureInno Db Internals Inno Db File Formats And Source Code Structure
Inno Db Internals Inno Db File Formats And Source Code Structure
 
My Sql High Availability With A Punch Drbd 83 And Drbd For Dolphin Express
My Sql High Availability With A Punch Drbd 83 And Drbd For Dolphin ExpressMy Sql High Availability With A Punch Drbd 83 And Drbd For Dolphin Express
My Sql High Availability With A Punch Drbd 83 And Drbd For Dolphin Express
 

Último

Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 

Último (20)

Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 

Efficient Java Apps for MySQL Cluster Using NDB/J

  • 1. Writing Efficient Java Applications for MySQL Cluster Using NDB/J Jess Balint <Jess.Balint@Sun.COM> Monty Taylor <mordred@Sun.COM> (Sun Microsystems)
  • 2. Agenda Basics of MySQL Cluster ● Basics of NDB API ● NDB/Bindings Project ● API Details ● Converting SQL ● Other Features ●
  • 3. Agenda Basics of MySQL Cluster ➔ Basics of NDB API ● NDB/Bindings Project ● API Details ● Converting SQL ● Other Features ●
  • 4. What is MySQL Cluster? A shared nothing clustered database ● Supported in MySQL by a storage engine ● component In-memory database, with support for non- ● indexed columns on disk Transactional with synchronous commit across ● cluster
  • 5. Data Distribution Horizontal partitioning ● Data is replicated across all data nodes in a ● node group and partitioned across node groups HASH(pk) pk
  • 6. Data Access One data node selected as transaction ● coordinator (TC) TC node can be chosen with TC hints – API node sends all commands to TC ● TC relays commands to other data nodes as – necessary Any node can send data back to the API node ●
  • 7. Data Access & TC API One storage node as Transaction Coordinator (TC) Nodegroup 0 Nodegroup 1
  • 8. System Architecture SQL Client mysqld mysqld mysqld Management Server Mgm client Data Nodes NDB API NDB API
  • 9. Agenda Basics of MySQL Cluster ● Basics of NDB API ➔ NDB/Bindings Project ● API Details ● Converting SQL ● Other Features ●
  • 10. Basics Low-level, object oriented C++ API based on ● storage operations (all examples shown in Java) Main NDB API Classes ● NdbClusterConnection – Ndb – NdbTransaction – NdbOperation (and subclasses) – NdbRecAttr (or NdbResultSet in NDB/Binding's – Java wrapper) Ndb is a database handle, typically one per ● thread.
  • 11. Connecting Create a connection object ● NdbClusterConnection conn = – NdbClusterConnection.create(“localhost”); Connect to the management server ● conn.connect(/* retries -> */ 5, /* delay -> */ 3, – /* verbose -> */ true); Wait until connection to data node(s) is ● established conn.waitUntilReady( – /* timeout for first ndbd connection */ 30, /* timeout for connection to all ndbds */ 0);
  • 12. Database Handle Ndb object is a handle for a specific database ● Ndb ndb = conn.createNdb( – /* database */ quot;testquot;, /* max # of tx on this handle */1024);
  • 13. Transactions Every operation must be performed inside a ● transaction Any locks acquired are not released until the ● transaction completes Transaction is created from Ndb handle and ● used to create operations NdbTransaction trans = ndb.startTransaction(); – NdbOperation op = trans.getInsertOperation(quot;xyquot;); – trans.execute(ExecType.Commit, – AbortOption.AbortOnError, true);
  • 14. Four Types of Operations Single row operations – read/write ● NdbOperation - based on it's primary key value – NdbIndexOperation - based on it's key value in a – given index Multiple row operations – read/write (no insert) ● These operations can be limited with NdbScanFilter ● NdbScanOperation - scan of the table – NdbIndexScanOperation – scan of an index – Can also be limited by specifying bounds on the index ●
  • 15. Filtering in Operations Acquire the appropriate type from the ● transaction (see NdbTransaction) getUpdateOperation(), getSelectScanOperation(), etc – Single row operations ● Specify key value with equal*() method (equalInt, – equalString, etc) Multiple row operations ● setBound() for index scan – NdbScanFilter –
  • 16. Accessing Data with Operations Read data ● readTuple(), readTuples() – Write data ● insertTuple() (NdbOperation only), updateTuple(), – deleteTuple() NdbScanOperation: lockCurrentTuple(), – updateCurrentTuple(), deleteCurrentTuple() Most of these calls are handled automatically ● by acquiring the correct operation from NdbTransaction
  • 17. Agenda Basics of MySQL Cluster ● Basics of NDB API ● NDB/Bindings Project ➔ API Details ● Converting SQL ● Other Features ●
  • 18. What is NDB/Bindings? Language specific wrappers of C++ NDB API ● Support for Java, Python, C#, Lua, Perl, PHP, ● Ruby, XML Generated with SWIG and many language-specific – customizations Currently only runs on UNIX/Linux ● Java wrapper referred to as NDB/J ● Includes NdbResultSet class with wide range of – data types
  • 19. Perl Java PHP .NET Python Ruby DELETE UPDATE INSERT mysqld mysqld mysqld Management Server Mgm client Data Nodes NDB API NDB API update() update()
  • 20. Perl Java PHP .NET Python Ruby DELETE UPDATE INSERT mysqld mysqld mysqld Management Server Mgm client Data Nodes NDB API NDB API update() update()
  • 21. Complete Example Many examples in ● /java/src/java/com/mysql/cluster/ndbj/examples NdbClusterConnection conn = NdbClusterConnection.create(quot;localhostquot;); conn.connect(5, 3, true); conn.waitUntilReady(30, 0); Ndb ndb = conn.createNdb(quot;testquot;, 1024); NdbTransaction trans = ndb.startTransaction();
  • 22. Complete Example Cont'd NdbOperation op = trans.getInsertOperation(quot;xyquot;); op.equalInt(quot;idquot;, 1); /* declare PK value */ op.setString(quot;col1quot;, quot;value Aquot;); op.setString(quot;col2quot;, quot;value Bquot;); trans.execute(ExecType.Commit, AbortOption.AbortOnError, true); trans.close();
  • 23. Reading Results C++ and other wrappers use NdbRecAttr ● In Java, we have NdbResultSet ● Similar usage to JDBC ResultSet ● One NdbResultSet per operation ● Obtained by calling op.resultData() – Not valid until transaction is executed ● Not compatible with lock transfers on scans ● (more on this soon)
  • 24. Agenda Basics of MySQL Cluster ● Basics of NDB API ● NDB/Bindings Project ● API Details ➔ Converting SQL ● Other Features ●
  • 25. Error Handling NDB/J throws an exception if an NDB API call ● returns an error Everything derives from the checked ● NdbApiException class Immediate subclasses include permanent and – temporary errors Concrete classes include – Permanent: constraint violations, internal error, schema ● error, schema object exists, no data found Temporary: insufficient space, node recovery error, node ● shut down, timeout expired
  • 26. Using Scan Filters Can be used on NdbScanOperation and ● NdbIndexScanOperation Example: SQL equivalent of a = 1 AND b > 200 ● NdbScanFilter sf = scanOp.getNdbScanFilter(); – sf.begin(Group.AND); – sf.eq(“a”, 1); – sf.gt(“b”, 200); – sf.end(); –
  • 27. NdbResultSet op.getValue() must be called for each field ● retrieved (or getBlob() for BLOBs) get*() calls on NdbResultSet must match type ● of field (same as NdbRecAttr)
  • 28. Executing and Committing Transactions Shown earlier when inserting a tuple: ● trans.execute(ExecType.Commit, – AbortOption.AbortOnError, true); We can also execute the transaction without ● committing by using ExecType.NoCommit Used when reading data – Arbitrary sets of operations can be included in a ● transaction
  • 29. Scanning and Locks Shared locks are upgraded to exclusive locks ● when updating/deleting a tuple The transaction must be committed before ● reading the next set of tuples from the operation (when nextResult() returns 1/2, not 0) Locks can be transferred between transactions ● NdbOperation.lockCurrentTuple(NdbTransaction) – The transaction owning the operation will takeover – the lock from the transaction passed
  • 30. Agenda Basics of MySQL Cluster ● Basics of NDB API ● NDB/Bindings Project ● API Details ● Converting SQL ➔ Other Features ●
  • 31. Single Table Queries Using operations as shown before ● SELECT A, B FROM TBL1 WHERE A = 1 ● If A is a unique key, use NdbOperation or – NdbIndexOperation If A is not unique, NdbIndexScanOperation, or if – unindexed, NdbScanOperation WHERE A = 1 and B = 1 ● If either column is indexed, use – NdbIndexScanOperation with NdbScanFilter Otherwise, add both to NdbScanFilter –
  • 32. Multiple Table Queries Join options ● Nested loop join – Parallel scans on ordered indexes –
  • 33. Nested Loop Join Outer Loop S over first table can PKif available Once for each row: Inner/Nested Loop Index scan for tuples matching current key
  • 34. Nested Loop Example, Pt 1 /* setup scan for outer loop, set bounds/filter if necessary */ NdbIndexScanOperation op1 = trans.getSelectIndexScanOperation( quot;PRIMARYquot;, tablename, LockMode.LM_Exclusive, ScanFlag.ORDER_BY, 10, 10); NdbResultSet rs1 = op1.resultData(); rs1.getValue(“key”); rs1.getValue(“other_field”); trans.execute(ExecType.NoCommit, ....);
  • 35. Nested Loop Example, Pt 2 while (rs1.next()) { /* begin outer loop */ keyValue = rs1.getInt(“key”); NdbIndexScanOperation op2 = trans.getSelectIndexScanOperation(index, tbl); op2.setBoundInt(“key”, BoundType.BoundEQ, keyValue); NdbResultSet rs2 = op2.resultData(); rs2.getValue(“joined_field”); trans.execute(ExecType.NoCommit, ....);
  • 36. Nested Loop Example, Pt 3 while (rs2.next()) { /* begin inner loop */ String joinedVal = rs2.getString(“joined_field”); /* process tuple using key, other_field, and joined field */ } /* end inner loop */ } /* end outer loop */ trans.execute(ExecType.NoCommit, ....); trans.close();
  • 37. Guidelines You can do arbitrary query filtering in the ● application, but try to push as much as possible to data nodes Using batching where possible to reduce record ● requests Aggregations can be done intuitively based on ● needs, eg. sum via accumulator
  • 38. Agenda Basics of MySQL Cluster ● Basics of NDB API ● NDB/Bindings Project ● API Details ● Converting SQL ● Other Features ➔
  • 39. Atomic Increment Increment a field without fetching the tuple ● trans = ndb.startTransaction(); NdbAtomicOperation aOp = trans.getAtomicUpdateOperation(tablename); aOp.equalInt(quot;idquot;, 1); aOp.increment(quot;agequot;, 2); trans.executeCommit(); trans.close();
  • 40. Asynchronous Transactions Create a transaction and operations as usual ● Instantiate custom callback class ● Call trans.executeAsynchPrepare() with ● callback handler Call ndb.sendPollNdb() to execute transaction ● asynchronously
  • 41. BLOB Handling Blobs access via blob handle class NdbBlob ● Write blobs with setNull() or setValue(byte []) ● Read data ● getData() - full blob value as byte array – readData(byte [], long) - piecewise retrieval into – existing byte array Also getLength() and getNull() –
  • 42. Events Notify application when data is updated ● Use NdbEventOperation ● Ndb.createEventOperation() ● Get NdbResultSet from operation ● Execute operation ● Ndb.pollEvents() ● Ndb.nextEvent() ● Get results from NdbResultSet ●
  • 43. Next Steps Read through the API for classes you are using ● to become familiar with them Look at some other material ● Johan Andersson, MySQL Conf 2007 – Developing High Performance Applications using NDB API ● Developing High Performance Applications using NDB/J ● Explore Other Features ● TC hint, MGM API –