SlideShare une entreprise Scribd logo
1  sur  39
Télécharger pour lire hors ligne
Databases and the cloud
                                 Henrik Ingo

                                   TTKK
                                 2012-02-27

                   Please share and re-use this presentation,
             licensed under Creative Commons Attribution license.




2012-02-27           TTKK                                           1
2011-10-25   2
History




                   ...things that used to be
             difficult at different points in time.




2011-10-25                                            3
1994




2012-02-27   TTKK   4
1994


USSR fell 3 years ago
    Finland yet to win first gold medal in hockey
         Windows 3.0 replacing MS-DOS
             Windows 95 did not yet exist
               I learn how to write .bat scripts from my dad
              Word 6.0 replacing WordPerfect 5.1
             Excel 5.0 replacing Lotus
             I had not yet used Internet

2012-02-27                          TTKK                       5
1994



                                                 SQL
                                         Standard Interpreted
C++ & Visual Basic
                                Flexible and expressive command line env

             LAN                         "SQL for secretaries"
      Printer Database                Good for English speakers
                                    2000: Bad for IDE w IntelliSense

         Client - Server architecture

                 Stored procedures rule
         DBA is king of business logic
2012-02-27                       TTKK                                  6
1997




2012-02-27   TTKK   7
1997




2012-02-27   TTKK   8
Learning SQL


NoSQL advocates say:              Henrik says:
    SQL is hard to learn               MS Access easy to learn
    To really scale, you must          Darn, I always got
    de-normalize                       normalization
    Most people don't get              I know, teaching n:n
    normalization right                relations was always fun
    Impedance mismatch                 INSERT INTO t ...
    between oo and sql                 serialize($obj)
    I just need a simple key-          SELECT value FROM t
    value store                        WHERE key=?;


2012-02-27                      TTKK                              9
2000




                    MS Access not supported
                    in Linux
                    PostgreSQL and MySQL
                    Learn SQL for real
                    phpMyAdmin
                    to ease the pain




2012-02-27   TTKK                             10
2005


                    Graduate & do websites for
                    a living.
                    Spend 3-6 days creating
                    and re-creating properly
                    normalized DB schema
                      In MS Access I just
                      clicked next, next, next
                      and ok.
                    Time is money
                    Invent NoSQL:
                    PHP serialize()
                    MySQL BLOB

2012-02-27   TTKK                                11
2008


                    Join MySQL AB
                    Confused about
                    synchronous vs
                    asynchronous replication
                    Learn a lot about MySQL
                    NDB Cluster




2012-02-27   TTKK                              12
High Availability




             ...and why it is more difficult
                    for databases.




2011-10-25                                     13
Performance                               Durability
Transactions / second (throughput)                                 Speaking of databases
          Response time (latency)                                  Committed data is not lost
          Percentiles (95% - 99%)                                  D in ACID




                  Get any response at all (tps > 0)       Replicas, snapshots
                  Measured as percentile (99.999%)       point in time, backups



                 High Availability
                              Clustering              Replication
                             Monitoring                   Redundancy
                              Failover

   2011-10-25                                                                           14
Uptime



                      Percentile target Max downtime per year

                                  90% 36 days

                                  99% 3.65 days

                                99.5% 1.83 days

                                99.9% 8.76 hours

                               99.99% 52.56 minutes

                              99.999% 5.26 minutes

                            99.9999% 31.5 seconds


             Beyond system availability: Average downtime per user.

2011-10-25                                                            15
Clustering frameworks - general


                        Heartbeat
                        Corosync
                       VM of choice
                      Red Hat Cluster
                      Solaris Cluster
                             ...




                            Failover




2011-10-25                                     16
Clustering frameworks - DB


                      Heartbeat
                      Corosync
                        MMM
                     VM of choice
                         MHA
                  Tungsten Enterprise
                    Solaris Cluster
                           ...




                         Failover




2011-10-25                                17
Sounds simple. What could possibly go wrong?


                              Old Master must stop service
                              (VIP, os, DB). But it is not
                              responding, so how do you make
                              it stop?
                              Polling from the outside.
                              Interval = 1 sec, 10 sec, 60 sec!
                              What if replication fails first and
                              client transactions don't?
                              Polling connectivity of DB nodes
                              but not client p.o.v.
                              Failover can be expensive (SAN,
                              DRBD) -> false positives costly



2011-10-25                                                          18
Active-Active Shared disk clustering. (State of the art?)



                                Oracle RAC
                                (ScaleDB?)




                                    Failover




               Disk                                           Disk
2011-10-25                                                           19
Sounds simple. What could possibly go wrong?


    Well, actually it's pretty good.
    Data integrity protection is good.
    But...
    SAN is considered the biggest
    SPOF of all.
    Recovery time on single node
    failure is +60 sec
    Recovery time? Because internally
    each node will lock some pages
    and process them locally.
    (Bloody expensive)



                                                 Disk
2011-10-25                                              20
Synchronous multi-master


                       NDB
                      Galera




                       Failover




2011-10-25                              21
Sounds simple. What could possibly go wrong?


                              Synchronous Multi Master
                              replication rocks :-)
                              Failure detection inherent in
                              replication protocol.
                              Instant failovers.
                              Bonus: Both Galera and NDB
                              provision new nodes
                              automatically.
                              Problem is solved. Time for new
                              problems...




2011-10-25                                                    22
Performance


    SAN has "some" overhead compared to local
    disk
    DRBD = 50% performance penalty
    Replication, when implemented correctly, has 0
    performance penalty.
    Galera and NDB = more performance




2011-10-25                                       23
Is a clustering solution part of the solution or the part of the problem?


    "Causes of Downtime in Production MySQL Servers"
     by Baron Schwartz:
             #1: Human error
             #2: SAN
         Complex clustering framework + SAN =
             More problems, not less!
         Galera (and NDB) =
             Replication based, no SAN or DRBD
             No "failover moment", no false positives
             No clustering framework needed
             No load balancer needed (JDBC loadbalance)
             Simple and elegant!

2011-10-25                                                            24
Scale-out and elasticity




             ...and why it is more difficult
                    for databases.




2011-10-25                                     25
Scale-out


                         Invented by MySQL / LAMP
                         stack.
                         Laughed at by other RDBMSes
                         Now everyone does it. Because
                         the Internet is too big.
                         Originally with read-only
                         replicas. Then sharding.
                         Easy for http, inconvenient for
                         databases.
                         NoSQL systems do it really well.
                         MySQL NDB does it really well
                         and Galera pretty well.




2012-02-27     TTKK                                        26
DBA's life is more interesting!


HTTP                                   RDBMS
    Stateless                               Where everyone else stores
                                            their state
    Usually can partition/shard             Needs expertise to
                                            partition/shard
    Scale-out = boot more servers           Scale-out = Boot more servers.
                                            Backup DB. Restore DB. Setup
                                            replication. Tweak application
                                            code...
    Writes = Write to the database          Write = Which partition/node?
                                            Beware of read-only slaves.
                                            Beware of eventual
                                            consistency...


2012-02-27                           TTKK                                   27
But it can be done


    Automating DB deployments is        MySQL
    more complex. But not
                                             Amazon RDS, others.
    impossible.
                                             Severalnines
    NDB and Galera handle data
    provisioning really well. But               Also supports Galera and
    deploying the empty nodes still             NDB
    manual labor.
                                             Scalr
    Scale-out happens because you
                                  PostgreSQL
    must. Scale-down will never
    happen if it's too much work.    Heroku
                                             EnterpriseDB
                                        NoSQL
                                             Usually do this relatively well.

2012-02-27                            TTKK                                      28
NoSQL




             ...and why it is more difficult
                for relational databases.




2011-10-25                                     29
It used to be




2012-02-27       TTKK        30
The future is




2012-02-27       TTKK        31
The future is




             All Open Source




2012-02-27            TTKK        32
Things NoSQL guys do really well

                                                                           Reading tip:
                                                                            Reading tip:
        No SQL (parsing)                                            Original Amazon Dynamo
                                                                     Original Amazon Dynamo
        Schemaless = Win! for agile development                                paper
                                                                                paper


                 HA with quorum consistency: R + W > N
                    Transparent sharding


                            Graph databases
                              N:N relationships, what's the big deal?
                              Actually makes sense to give up on SQL!


             Map Reduce
               Bypass ETL, get clean data


                            Implemented in Java or Python (or Erlang)


2012-02-27                                  TTKK                                        33
Best of both worlds


NoSQL                                    MySQL
    No SQL                                   HandlerSocket
    .                                        Memcache API, NDB API

    Simple key-value store                   BLOB
    .                                        SELECT v FROM ... WHERE k=?

    ...and secondary indexes                 Functional indexes
                                             Virtual columns, etc...

                                             Synchronous replication
    Quorum consistency                       Galera, NDB
    .
                                             We have it too
    Transparent sharding                     NDB, Spider + proprietary solutions
    Graph databases                          Damn N:N relations!
    Map Reduce against text files            Map Reduce against RDBMS
    Java and Python                          C++ can be done right
    .                                        Drizzle


2012-02-27                            TTKK                                         34
Cloud




             ...and why it is more difficult
                    for databases.




2011-10-25                                     35
4 different DB deployments




                                          Server HW


                                          VM


                                          DB process


                                          User (schema)



2011-10-25                                        36
Consider memory utilization
             "All of computation is just different layers of caching."

    Dedicated HW                             No virtualization overhead
    Great performance
    €€€€                                     Memory allocation per DB
    Not cloud                                instance is fixed (without
                                             restart) -> cache of idle DB
                                             instances is wasted.

    Virtualization overhead
                                             No virtualization overhead.
    "Safety margin" of unallocated
    memory per VM.                           Busy schema can use more
                                             cache and idle schema evicted
    Memory allocation per VM is              from cache.
    fixed (without reboot) -> cache
    of idle DB instances is wasted.


2011-10-25                                                                  37
Multi-tenancy


    Web hosting w MySQL                 Drizzle
         Cpanel = hack                        True multi-tenancy,
                                              "virtualization for databases"
         Not "cloud". Users expect
         "dedicated" database                 Ready but experimental
         instance.




2011-10-25                                                                38
Thank you

2012-02-27    TTKK       39

Contenu connexe

Similaire à Databases and the Cloud

Complicating Complexity: Performance in a New Machine Age
Complicating Complexity: Performance in a New Machine AgeComplicating Complexity: Performance in a New Machine Age
Complicating Complexity: Performance in a New Machine AgeMaurice Naftalin
 
Choosing a MySQL High Availability solution - Percona Live UK 2011
Choosing a MySQL High Availability solution - Percona Live UK 2011Choosing a MySQL High Availability solution - Percona Live UK 2011
Choosing a MySQL High Availability solution - Percona Live UK 2011Henrik Ingo
 
The CIOs Guide to NoSQL 2012
The CIOs Guide to NoSQL 2012The CIOs Guide to NoSQL 2012
The CIOs Guide to NoSQL 2012DATAVERSITY
 
Vote NO for MySQL
Vote NO for MySQLVote NO for MySQL
Vote NO for MySQLUlf Wendel
 
Breakthrough performance with MySQL Cluster (2012)
Breakthrough performance with MySQL Cluster (2012)Breakthrough performance with MySQL Cluster (2012)
Breakthrough performance with MySQL Cluster (2012)Frazer Clement
 
NoSQL and NewSQL: Tradeoffs between Scalable Performance & Consistency
NoSQL and NewSQL: Tradeoffs between Scalable Performance & ConsistencyNoSQL and NewSQL: Tradeoffs between Scalable Performance & Consistency
NoSQL and NewSQL: Tradeoffs between Scalable Performance & ConsistencyScyllaDB
 
Froscon2011: How i learned to use sql and then learned not to use it
Froscon2011:  How i learned to use sql and then learned not to use itFroscon2011:  How i learned to use sql and then learned not to use it
Froscon2011: How i learned to use sql and then learned not to use itHenrik Ingo
 
Oracle Client Failover - Under The Hood
Oracle Client Failover - Under The HoodOracle Client Failover - Under The Hood
Oracle Client Failover - Under The HoodLudovico Caldara
 
From single MySQL instance to High Availability: the journey to MySQL InnoDB ...
From single MySQL instance to High Availability: the journey to MySQL InnoDB ...From single MySQL instance to High Availability: the journey to MySQL InnoDB ...
From single MySQL instance to High Availability: the journey to MySQL InnoDB ...Frederic Descamps
 
Comparison between rdbms and nosql
Comparison between rdbms and nosqlComparison between rdbms and nosql
Comparison between rdbms and nosqlbharati k
 
KoprowskiT_SQLSat152_Bulgaria_HighAvailabilityOfSQLintheContextOfSLA
KoprowskiT_SQLSat152_Bulgaria_HighAvailabilityOfSQLintheContextOfSLAKoprowskiT_SQLSat152_Bulgaria_HighAvailabilityOfSQLintheContextOfSLA
KoprowskiT_SQLSat152_Bulgaria_HighAvailabilityOfSQLintheContextOfSLATobias Koprowski
 
NetScaler TCP Performance Tuning
NetScaler TCP Performance TuningNetScaler TCP Performance Tuning
NetScaler TCP Performance TuningKevin Mason
 
The return of big iron?
The return of big iron?The return of big iron?
The return of big iron?Ben Stopford
 
Icinga Director and vSphereDB - how they play together - Icinga Camp Zurich 2019
Icinga Director and vSphereDB - how they play together - Icinga Camp Zurich 2019Icinga Director and vSphereDB - how they play together - Icinga Camp Zurich 2019
Icinga Director and vSphereDB - how they play together - Icinga Camp Zurich 2019Icinga
 
Yes sql08 inmemorydb
Yes sql08 inmemorydbYes sql08 inmemorydb
Yes sql08 inmemorydbDaniel Austin
 
20 Real-World Use Cases to help pick a better MySQL Replication scheme (2012)
20 Real-World Use Cases to help pick a better MySQL Replication scheme (2012)20 Real-World Use Cases to help pick a better MySQL Replication scheme (2012)
20 Real-World Use Cases to help pick a better MySQL Replication scheme (2012)Darpan Dinker
 
MySQL Cluster Scaling to a Billion Queries
MySQL Cluster Scaling to a Billion QueriesMySQL Cluster Scaling to a Billion Queries
MySQL Cluster Scaling to a Billion QueriesBernd Ocklin
 

Similaire à Databases and the Cloud (20)

Complicating Complexity: Performance in a New Machine Age
Complicating Complexity: Performance in a New Machine AgeComplicating Complexity: Performance in a New Machine Age
Complicating Complexity: Performance in a New Machine Age
 
Choosing a MySQL High Availability solution - Percona Live UK 2011
Choosing a MySQL High Availability solution - Percona Live UK 2011Choosing a MySQL High Availability solution - Percona Live UK 2011
Choosing a MySQL High Availability solution - Percona Live UK 2011
 
The CIOs Guide to NoSQL 2012
The CIOs Guide to NoSQL 2012The CIOs Guide to NoSQL 2012
The CIOs Guide to NoSQL 2012
 
Vote NO for MySQL
Vote NO for MySQLVote NO for MySQL
Vote NO for MySQL
 
Breakthrough performance with MySQL Cluster (2012)
Breakthrough performance with MySQL Cluster (2012)Breakthrough performance with MySQL Cluster (2012)
Breakthrough performance with MySQL Cluster (2012)
 
NoSQL and NewSQL: Tradeoffs between Scalable Performance & Consistency
NoSQL and NewSQL: Tradeoffs between Scalable Performance & ConsistencyNoSQL and NewSQL: Tradeoffs between Scalable Performance & Consistency
NoSQL and NewSQL: Tradeoffs between Scalable Performance & Consistency
 
Froscon2011: How i learned to use sql and then learned not to use it
Froscon2011:  How i learned to use sql and then learned not to use itFroscon2011:  How i learned to use sql and then learned not to use it
Froscon2011: How i learned to use sql and then learned not to use it
 
Oracle Client Failover - Under The Hood
Oracle Client Failover - Under The HoodOracle Client Failover - Under The Hood
Oracle Client Failover - Under The Hood
 
B17 Eliminating the database bottleneck
B17 Eliminating the database bottleneckB17 Eliminating the database bottleneck
B17 Eliminating the database bottleneck
 
From single MySQL instance to High Availability: the journey to MySQL InnoDB ...
From single MySQL instance to High Availability: the journey to MySQL InnoDB ...From single MySQL instance to High Availability: the journey to MySQL InnoDB ...
From single MySQL instance to High Availability: the journey to MySQL InnoDB ...
 
Mysql Latency
Mysql LatencyMysql Latency
Mysql Latency
 
Comparison between rdbms and nosql
Comparison between rdbms and nosqlComparison between rdbms and nosql
Comparison between rdbms and nosql
 
KoprowskiT_SQLSat152_Bulgaria_HighAvailabilityOfSQLintheContextOfSLA
KoprowskiT_SQLSat152_Bulgaria_HighAvailabilityOfSQLintheContextOfSLAKoprowskiT_SQLSat152_Bulgaria_HighAvailabilityOfSQLintheContextOfSLA
KoprowskiT_SQLSat152_Bulgaria_HighAvailabilityOfSQLintheContextOfSLA
 
AWS Case Study
AWS Case StudyAWS Case Study
AWS Case Study
 
NetScaler TCP Performance Tuning
NetScaler TCP Performance TuningNetScaler TCP Performance Tuning
NetScaler TCP Performance Tuning
 
The return of big iron?
The return of big iron?The return of big iron?
The return of big iron?
 
Icinga Director and vSphereDB - how they play together - Icinga Camp Zurich 2019
Icinga Director and vSphereDB - how they play together - Icinga Camp Zurich 2019Icinga Director and vSphereDB - how they play together - Icinga Camp Zurich 2019
Icinga Director and vSphereDB - how they play together - Icinga Camp Zurich 2019
 
Yes sql08 inmemorydb
Yes sql08 inmemorydbYes sql08 inmemorydb
Yes sql08 inmemorydb
 
20 Real-World Use Cases to help pick a better MySQL Replication scheme (2012)
20 Real-World Use Cases to help pick a better MySQL Replication scheme (2012)20 Real-World Use Cases to help pick a better MySQL Replication scheme (2012)
20 Real-World Use Cases to help pick a better MySQL Replication scheme (2012)
 
MySQL Cluster Scaling to a Billion Queries
MySQL Cluster Scaling to a Billion QueriesMySQL Cluster Scaling to a Billion Queries
MySQL Cluster Scaling to a Billion Queries
 

Plus de Henrik Ingo

Introduction to new high performance storage engines in mongodb 3.0
Introduction to new high performance storage engines in mongodb 3.0Introduction to new high performance storage engines in mongodb 3.0
Introduction to new high performance storage engines in mongodb 3.0Henrik Ingo
 
Meteor - The next generation software stack
Meteor - The next generation software stackMeteor - The next generation software stack
Meteor - The next generation software stackHenrik Ingo
 
MongoDB for Oracle Experts - OUGF Harmony 2014
MongoDB for Oracle Experts - OUGF Harmony 2014 MongoDB for Oracle Experts - OUGF Harmony 2014
MongoDB for Oracle Experts - OUGF Harmony 2014 Henrik Ingo
 
Building Your First MongoDB App
Building Your First MongoDB AppBuilding Your First MongoDB App
Building Your First MongoDB AppHenrik Ingo
 
Analytics with MongoDB Aggregation Framework and Hadoop Connector
Analytics with MongoDB Aggregation Framework and Hadoop ConnectorAnalytics with MongoDB Aggregation Framework and Hadoop Connector
Analytics with MongoDB Aggregation Framework and Hadoop ConnectorHenrik Ingo
 
Whats new in mongoDB 2.4 at Copenhagen user group 2013-06-19
Whats new in mongoDB 2.4 at Copenhagen user group 2013-06-19Whats new in mongoDB 2.4 at Copenhagen user group 2013-06-19
Whats new in mongoDB 2.4 at Copenhagen user group 2013-06-19Henrik Ingo
 
Failover or not to failover
Failover or not to failoverFailover or not to failover
Failover or not to failoverHenrik Ingo
 
Spatial functions in MySQL 5.6, MariaDB 5.5, PostGIS 2.0 and others
Spatial functions in  MySQL 5.6, MariaDB 5.5, PostGIS 2.0 and othersSpatial functions in  MySQL 5.6, MariaDB 5.5, PostGIS 2.0 and others
Spatial functions in MySQL 5.6, MariaDB 5.5, PostGIS 2.0 and othersHenrik Ingo
 
Introducing Xtrabackup Manager
Introducing Xtrabackup ManagerIntroducing Xtrabackup Manager
Introducing Xtrabackup ManagerHenrik Ingo
 
Using and Benchmarking Galera in different architectures (PLUK 2012)
Using and Benchmarking Galera in different architectures (PLUK 2012)Using and Benchmarking Galera in different architectures (PLUK 2012)
Using and Benchmarking Galera in different architectures (PLUK 2012)Henrik Ingo
 
Froscon 2012 how big corporations play the open source game
Froscon 2012   how big corporations play the open source gameFroscon 2012   how big corporations play the open source game
Froscon 2012 how big corporations play the open source gameHenrik Ingo
 
Introduction to Galera
Introduction to GaleraIntroduction to Galera
Introduction to GaleraHenrik Ingo
 
Fixed in drizzle
Fixed in drizzleFixed in drizzle
Fixed in drizzleHenrik Ingo
 
How to grow your open source project 10x and revenues 5x OSCON2011
How to grow your open source project 10x and revenues 5x OSCON2011How to grow your open source project 10x and revenues 5x OSCON2011
How to grow your open source project 10x and revenues 5x OSCON2011Henrik Ingo
 

Plus de Henrik Ingo (14)

Introduction to new high performance storage engines in mongodb 3.0
Introduction to new high performance storage engines in mongodb 3.0Introduction to new high performance storage engines in mongodb 3.0
Introduction to new high performance storage engines in mongodb 3.0
 
Meteor - The next generation software stack
Meteor - The next generation software stackMeteor - The next generation software stack
Meteor - The next generation software stack
 
MongoDB for Oracle Experts - OUGF Harmony 2014
MongoDB for Oracle Experts - OUGF Harmony 2014 MongoDB for Oracle Experts - OUGF Harmony 2014
MongoDB for Oracle Experts - OUGF Harmony 2014
 
Building Your First MongoDB App
Building Your First MongoDB AppBuilding Your First MongoDB App
Building Your First MongoDB App
 
Analytics with MongoDB Aggregation Framework and Hadoop Connector
Analytics with MongoDB Aggregation Framework and Hadoop ConnectorAnalytics with MongoDB Aggregation Framework and Hadoop Connector
Analytics with MongoDB Aggregation Framework and Hadoop Connector
 
Whats new in mongoDB 2.4 at Copenhagen user group 2013-06-19
Whats new in mongoDB 2.4 at Copenhagen user group 2013-06-19Whats new in mongoDB 2.4 at Copenhagen user group 2013-06-19
Whats new in mongoDB 2.4 at Copenhagen user group 2013-06-19
 
Failover or not to failover
Failover or not to failoverFailover or not to failover
Failover or not to failover
 
Spatial functions in MySQL 5.6, MariaDB 5.5, PostGIS 2.0 and others
Spatial functions in  MySQL 5.6, MariaDB 5.5, PostGIS 2.0 and othersSpatial functions in  MySQL 5.6, MariaDB 5.5, PostGIS 2.0 and others
Spatial functions in MySQL 5.6, MariaDB 5.5, PostGIS 2.0 and others
 
Introducing Xtrabackup Manager
Introducing Xtrabackup ManagerIntroducing Xtrabackup Manager
Introducing Xtrabackup Manager
 
Using and Benchmarking Galera in different architectures (PLUK 2012)
Using and Benchmarking Galera in different architectures (PLUK 2012)Using and Benchmarking Galera in different architectures (PLUK 2012)
Using and Benchmarking Galera in different architectures (PLUK 2012)
 
Froscon 2012 how big corporations play the open source game
Froscon 2012   how big corporations play the open source gameFroscon 2012   how big corporations play the open source game
Froscon 2012 how big corporations play the open source game
 
Introduction to Galera
Introduction to GaleraIntroduction to Galera
Introduction to Galera
 
Fixed in drizzle
Fixed in drizzleFixed in drizzle
Fixed in drizzle
 
How to grow your open source project 10x and revenues 5x OSCON2011
How to grow your open source project 10x and revenues 5x OSCON2011How to grow your open source project 10x and revenues 5x OSCON2011
How to grow your open source project 10x and revenues 5x OSCON2011
 

Dernier

ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...JojoEDelaCruz
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Celine George
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatYousafMalik24
 
Food processing presentation for bsc agriculture hons
Food processing presentation for bsc agriculture honsFood processing presentation for bsc agriculture hons
Food processing presentation for bsc agriculture honsManeerUddin
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...JhezDiaz1
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxiammrhaywood
 
4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptxmary850239
 
ROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptxROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptxVanesaIglesias10
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Mark Reed
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management SystemChristalin Nelson
 
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfInclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfTechSoup
 
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptxQ4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptxlancelewisportillo
 
4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptxmary850239
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxAnupkumar Sharma
 
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYKayeClaireEstoconing
 
Music 9 - 4th quarter - Vocal Music of the Romantic Period.pptx
Music 9 - 4th quarter - Vocal Music of the Romantic Period.pptxMusic 9 - 4th quarter - Vocal Music of the Romantic Period.pptx
Music 9 - 4th quarter - Vocal Music of the Romantic Period.pptxleah joy valeriano
 
Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Seán Kennedy
 

Dernier (20)

YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptxYOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
 
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptxFINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
 
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice great
 
Food processing presentation for bsc agriculture hons
Food processing presentation for bsc agriculture honsFood processing presentation for bsc agriculture hons
Food processing presentation for bsc agriculture hons
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
 
4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx
 
ROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptxROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptx
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management System
 
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfInclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
 
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptxQ4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
 
4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
 
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
 
Music 9 - 4th quarter - Vocal Music of the Romantic Period.pptx
Music 9 - 4th quarter - Vocal Music of the Romantic Period.pptxMusic 9 - 4th quarter - Vocal Music of the Romantic Period.pptx
Music 9 - 4th quarter - Vocal Music of the Romantic Period.pptx
 
Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...
 
Raw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptxRaw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptx
 

Databases and the Cloud

  • 1. Databases and the cloud Henrik Ingo TTKK 2012-02-27 Please share and re-use this presentation, licensed under Creative Commons Attribution license. 2012-02-27 TTKK 1
  • 3. History ...things that used to be difficult at different points in time. 2011-10-25 3
  • 5. 1994 USSR fell 3 years ago Finland yet to win first gold medal in hockey Windows 3.0 replacing MS-DOS Windows 95 did not yet exist I learn how to write .bat scripts from my dad Word 6.0 replacing WordPerfect 5.1 Excel 5.0 replacing Lotus I had not yet used Internet 2012-02-27 TTKK 5
  • 6. 1994 SQL Standard Interpreted C++ & Visual Basic Flexible and expressive command line env LAN "SQL for secretaries" Printer Database Good for English speakers 2000: Bad for IDE w IntelliSense Client - Server architecture Stored procedures rule DBA is king of business logic 2012-02-27 TTKK 6
  • 9. Learning SQL NoSQL advocates say: Henrik says: SQL is hard to learn MS Access easy to learn To really scale, you must Darn, I always got de-normalize normalization Most people don't get I know, teaching n:n normalization right relations was always fun Impedance mismatch INSERT INTO t ... between oo and sql serialize($obj) I just need a simple key- SELECT value FROM t value store WHERE key=?; 2012-02-27 TTKK 9
  • 10. 2000 MS Access not supported in Linux PostgreSQL and MySQL Learn SQL for real phpMyAdmin to ease the pain 2012-02-27 TTKK 10
  • 11. 2005 Graduate & do websites for a living. Spend 3-6 days creating and re-creating properly normalized DB schema In MS Access I just clicked next, next, next and ok. Time is money Invent NoSQL: PHP serialize() MySQL BLOB 2012-02-27 TTKK 11
  • 12. 2008 Join MySQL AB Confused about synchronous vs asynchronous replication Learn a lot about MySQL NDB Cluster 2012-02-27 TTKK 12
  • 13. High Availability ...and why it is more difficult for databases. 2011-10-25 13
  • 14. Performance Durability Transactions / second (throughput) Speaking of databases Response time (latency) Committed data is not lost Percentiles (95% - 99%) D in ACID Get any response at all (tps > 0) Replicas, snapshots Measured as percentile (99.999%) point in time, backups High Availability Clustering Replication Monitoring Redundancy Failover 2011-10-25 14
  • 15. Uptime Percentile target Max downtime per year 90% 36 days 99% 3.65 days 99.5% 1.83 days 99.9% 8.76 hours 99.99% 52.56 minutes 99.999% 5.26 minutes 99.9999% 31.5 seconds Beyond system availability: Average downtime per user. 2011-10-25 15
  • 16. Clustering frameworks - general Heartbeat Corosync VM of choice Red Hat Cluster Solaris Cluster ... Failover 2011-10-25 16
  • 17. Clustering frameworks - DB Heartbeat Corosync MMM VM of choice MHA Tungsten Enterprise Solaris Cluster ... Failover 2011-10-25 17
  • 18. Sounds simple. What could possibly go wrong? Old Master must stop service (VIP, os, DB). But it is not responding, so how do you make it stop? Polling from the outside. Interval = 1 sec, 10 sec, 60 sec! What if replication fails first and client transactions don't? Polling connectivity of DB nodes but not client p.o.v. Failover can be expensive (SAN, DRBD) -> false positives costly 2011-10-25 18
  • 19. Active-Active Shared disk clustering. (State of the art?) Oracle RAC (ScaleDB?) Failover Disk Disk 2011-10-25 19
  • 20. Sounds simple. What could possibly go wrong? Well, actually it's pretty good. Data integrity protection is good. But... SAN is considered the biggest SPOF of all. Recovery time on single node failure is +60 sec Recovery time? Because internally each node will lock some pages and process them locally. (Bloody expensive) Disk 2011-10-25 20
  • 21. Synchronous multi-master NDB Galera Failover 2011-10-25 21
  • 22. Sounds simple. What could possibly go wrong? Synchronous Multi Master replication rocks :-) Failure detection inherent in replication protocol. Instant failovers. Bonus: Both Galera and NDB provision new nodes automatically. Problem is solved. Time for new problems... 2011-10-25 22
  • 23. Performance SAN has "some" overhead compared to local disk DRBD = 50% performance penalty Replication, when implemented correctly, has 0 performance penalty. Galera and NDB = more performance 2011-10-25 23
  • 24. Is a clustering solution part of the solution or the part of the problem? "Causes of Downtime in Production MySQL Servers" by Baron Schwartz: #1: Human error #2: SAN Complex clustering framework + SAN = More problems, not less! Galera (and NDB) = Replication based, no SAN or DRBD No "failover moment", no false positives No clustering framework needed No load balancer needed (JDBC loadbalance) Simple and elegant! 2011-10-25 24
  • 25. Scale-out and elasticity ...and why it is more difficult for databases. 2011-10-25 25
  • 26. Scale-out Invented by MySQL / LAMP stack. Laughed at by other RDBMSes Now everyone does it. Because the Internet is too big. Originally with read-only replicas. Then sharding. Easy for http, inconvenient for databases. NoSQL systems do it really well. MySQL NDB does it really well and Galera pretty well. 2012-02-27 TTKK 26
  • 27. DBA's life is more interesting! HTTP RDBMS Stateless Where everyone else stores their state Usually can partition/shard Needs expertise to partition/shard Scale-out = boot more servers Scale-out = Boot more servers. Backup DB. Restore DB. Setup replication. Tweak application code... Writes = Write to the database Write = Which partition/node? Beware of read-only slaves. Beware of eventual consistency... 2012-02-27 TTKK 27
  • 28. But it can be done Automating DB deployments is MySQL more complex. But not Amazon RDS, others. impossible. Severalnines NDB and Galera handle data provisioning really well. But Also supports Galera and deploying the empty nodes still NDB manual labor. Scalr Scale-out happens because you PostgreSQL must. Scale-down will never happen if it's too much work. Heroku EnterpriseDB NoSQL Usually do this relatively well. 2012-02-27 TTKK 28
  • 29. NoSQL ...and why it is more difficult for relational databases. 2011-10-25 29
  • 30. It used to be 2012-02-27 TTKK 30
  • 32. The future is All Open Source 2012-02-27 TTKK 32
  • 33. Things NoSQL guys do really well Reading tip: Reading tip: No SQL (parsing) Original Amazon Dynamo Original Amazon Dynamo Schemaless = Win! for agile development paper paper HA with quorum consistency: R + W > N Transparent sharding Graph databases N:N relationships, what's the big deal? Actually makes sense to give up on SQL! Map Reduce Bypass ETL, get clean data Implemented in Java or Python (or Erlang) 2012-02-27 TTKK 33
  • 34. Best of both worlds NoSQL MySQL No SQL HandlerSocket . Memcache API, NDB API Simple key-value store BLOB . SELECT v FROM ... WHERE k=? ...and secondary indexes Functional indexes Virtual columns, etc... Synchronous replication Quorum consistency Galera, NDB . We have it too Transparent sharding NDB, Spider + proprietary solutions Graph databases Damn N:N relations! Map Reduce against text files Map Reduce against RDBMS Java and Python C++ can be done right . Drizzle 2012-02-27 TTKK 34
  • 35. Cloud ...and why it is more difficult for databases. 2011-10-25 35
  • 36. 4 different DB deployments Server HW VM DB process User (schema) 2011-10-25 36
  • 37. Consider memory utilization "All of computation is just different layers of caching." Dedicated HW No virtualization overhead Great performance €€€€ Memory allocation per DB Not cloud instance is fixed (without restart) -> cache of idle DB instances is wasted. Virtualization overhead No virtualization overhead. "Safety margin" of unallocated memory per VM. Busy schema can use more cache and idle schema evicted Memory allocation per VM is from cache. fixed (without reboot) -> cache of idle DB instances is wasted. 2011-10-25 37
  • 38. Multi-tenancy Web hosting w MySQL Drizzle Cpanel = hack True multi-tenancy, "virtualization for databases" Not "cloud". Users expect "dedicated" database Ready but experimental instance. 2011-10-25 38