% $Header: /home/knielsen/talk/fosdem2010/RCS/fosdem2010.tex,v 1.1 2010/02/07 05:32:16 knielsen Exp knielsen $

\documentclass{beamer}

% This file is a solution template for:

% - Talk at a conference/colloquium.
% - Talk length is about 20min.
% - Style is ornate.



% Copyright 2004 by Till Tantau <tantau@users.sourceforge.net>.
%
% In principle, this file can be redistributed and/or modified under
% the terms of the GNU Public License, version 2.
%
% However, this file is supposed to be a template to be modified
% for your own needs. For this reason, if you use this file as a
% template and not specifically distribute it as part of a another
% package/program, I grant the extra permission to freely copy and
% modify this file as you see fit and even to delete this copyright
% notice. 


\mode<presentation>
{
  \usetheme{Rochester}
  % or ...

  \setbeamercovered{transparent}
  % or whatever (possibly just delete it)
}


\usepackage[english]{babel}
% or whatever

\usepackage[latin1]{inputenc}
% or whatever

\usepackage{times}
\usepackage[T1]{fontenc}
% Or whatever. Note that the encoding and the font should match. If T1
% does not look nice, try deleting the line with the fontenc.


\title[Beyond MySQL GA]{Beyond MySQL GA: patches, storage engines, forks, and pre-releases}

\author{Kristian Nielsen \\ \texttt{knielsen@knielsen-hq.org}}
% - Give the names in the same order as the appear in the paper.
% - Use the \inst{?} command only if the authors have different
%   affiliation.

\institute{MariaDB Developer \\ Monty Program AB}
% - Use the \inst command only if there are several affiliations.
% - Keep it simple, no one is interested in your street address.

\date{FOSDEM 2010}
% - Either use conference name or its abbreviation.
% - Not really informative to the audience, more for people (including
%   yourself) who are reading the slides online




% If you have a file called "university-logo-filename.xxx", where xxx
% is a graphic format that can be processed by latex or pdflatex,
% resp., then you can add a logo as follows:

% \pgfdeclareimage[height=0.5cm]{university-logo}{university-logo-filename}
% \logo{\pgfuseimage{university-logo}}



% If you wish to uncover everything in a step-wise fashion, uncomment
% the following command: 

%\beamerdefaultoverlayspecification{<+->}

\setbeamertemplate{navigation symbols}{}
\logo{\includegraphics[height=0.95cm]{mplogo2.png}}

\begin{document}

\begin{frame}
  \titlepage
\end{frame}

%\begin{frame}{Outline}
%  \tableofcontents
  % You might wish to add the option [pausesections]
%\end{frame}


% Structuring a talk is a difficult task and the following structure
% may not be suitable. Here are some rules that apply for this
% solution: 

% - Exactly two or three sections (other than the summary).
% - At *most* three subsections per section.
% - Talk about 30s to 2min per frame. So there should be between about
%   15 and 30 frames, all told.

% - A conference audience is likely to know very little of what you
%   are going to talk about. So *simplify*!
% - In a 20min talk, getting the main ideas across is hard
%   enough. Leave out details, even if it means being less precise than
%   you think necessary.
% - If you omit details that are vital to the proof/implementation,
%   just say so once. Everybody will be happy with that.

\section{Overview}
\begin{frame}{There is more to MySQL than standard MySQL 5.1 GA!}
  In the last 3--4 years, a lot of exciting development has taken place on the
  MySQL server outside of MySQL AB/Sun/Oracle.

  In this talk, I want to present two main points:
  \begin{itemize}
  \item Give an overview of some of the different extensions and enhancements
    to MySQL that have been developed by the community and are now available
  \item Show what the options are for users to use and benefit from this development
  \end{itemize}
\end{frame}
\section{What is out there}
\subsection{Patches}
\begin{frame}{What?}
  Patches, storage engines, extensions, branches
\end{frame}

\begin{frame}{Google patches}
  Google patches (mostly for 5.0, some 5.1):
  \begin{itemize}
  \item Better statistics/monitoring:
    \begin{itemize}
    \item Lock contention
    \item Binlog events
    \item malloc() statistics
    \item Filesorts
    \item InnoDB I/O and wait statistics
    \item \texttt{SHOW \{USER,TABLE,INDEX,CLIENT\}\_STATISTICS}
    \end{itemize}
  \item Performance improvements (lots of it for InnoDB):
    \begin{itemize}
    \item SMP scalability (lock split, atomic operations, tcmalloc)
    \item I/O scalability
    \end{itemize}
  \end{itemize}
\end{frame}
\begin{frame}{Google patches (cont.)}
  \begin{itemize}
  \item Semisync replication
  \item binlog event checksums and global transaction id
  \item Replication state in InnoDB table (crash recovery)
  \item Incremental table checksums (for consistency check)
  \item \texttt{SET GLOBAL innodb\_disallow\_writes=(0|1)}
  \item \texttt{KILL IF\_IDLE <id>}
  \item \texttt{MAKE (USER|CLIENT) <who> DELAYED 100}
  \item Mapped users
  \item Audit log
  \item Lots of other small tweaks
  \end{itemize}
\end{frame}
\begin{frame}{Percona patches}
  Implemented or integrated by Percona, for MySQL 5.0:
  \begin{itemize}
  \item Percona-authored and external
  \item Focused on statistics/monitoring and performance/scalability
  \item Some of this ported to 5.1 in XtraDB (InnoDB parts)
  \item \texttt{innodb\_check\_fragmentation}
  \item \texttt{\small INFORMATION\_SCHEMA.INNODB\_BUFFER\_POOL\_CONTENT}
  \item \texttt{innodb\_split\_buffer\_pool\_mutex}
  \item \texttt{innodb\_dict\_size\_limit}
  \item \texttt{microsec\_process}
  \item \texttt{microslow\_innodb}
  \item \ldots
  \end{itemize}
\end{frame}
\begin{frame}[fragile]{Miscellaneous patches} % including ebay
  Ebay patches:
  \begin{itemize}
  \item Variable-length rows in memory storage engine
  \item Pool-of-threads
  \end{itemize}
  Virtual columns:
  \begin{itemize}
  \item
\begin{semiverbatim}
CREATE TABLE t
    (a VARCHAR(32),
     b \alert{VIRTUAL} VARCHAR(5) AS (LEFT(a,5)))
\end{semiverbatim}
   \item Patch by Andrey Zhakov
  \end{itemize}
\end{frame}

\subsection{Storage engines}
\begin{frame}{XtraDB storage engine}
  \begin{itemize}
  \item Percona-developed improved InnoDB (for MySQL 5.1)).
%    \begin{itemize}
%    \item Made by people who know what's needed in high-profile MySQL
%      installations.
%    \end{itemize}
  \item Improved statistics/monitoring
  \item Better CPU/IO scalability (performance)
  \item XtraBackup
  \item Includes a number of other patches (eg. Google patches)
    \begin{itemize}
    \item Also some Percona-developed things
    \end{itemize}
  \item Includes Oracle/Innobase InnoDB plugin
  \end{itemize}
\end{frame}

\begin{frame}{PBXT storage engine}
  \begin{itemize}
  \item Transactional MVCC storage engine
  \item Uses novel write-once, log-based storage rather than traditional
    transaction log + write-back buffer cache
  \item Promising benchmarks
  \item Good to see new approaches, hardware is much different now than when
    traditional algorithms were designed
  \item Vladimir Kolesnikov will say more in the afternoon.
  \end{itemize}
\end{frame}

\begin{frame}{FederatedX storage engine}
  \begin{itemize}
  \item Replacement for MySQL Federated storage engine, which is no longer
    maintained.
  \item A FederatedX table acts as a link to a table in another database server
  \item Can access tables in remote server with local SQL
  \item Possibility to do cross-server joins, etc.
  \item Contributed and maintained by Patrick Galbraith
  \end{itemize}
\end{frame}

\begin{frame}{Sphinx Storage Engine}
  \begin{itemize}
  \item Interface to Sphinx Full-text search
  \item Spinx is an external full-text search engine
  \item Spinx storage engine allows to query the (external) full-text search
    using SQL.
  \end{itemize}
\end{frame}

\begin{frame}{Pinba storage engine}
  \begin{itemize}
  \item Collect PHP statistics via UDP and present as MySQL tables
  \item Used to profile PHP servers to find bottlenecks (Pinba:
    \alert{P}HP \alert{i}s \alert{n}ot a \alert{b}ottleneck \alert{a}nymore).
  \item Collects information like
    \begin{itemize}
    \item Host
    \item Request count
    \item Document size
    \item Memory usage
    \item CPU time
    \item Wallclock time
    \item Custom timers
    \end{itemize}
  \end{itemize}
\end{frame}

\begin{frame}{OQGraph and Spider storage engines}
OQGraph:
\begin{itemize}
  \item Special-purpose storage engine for graph-type relations
  \item Optimised for queries such as needed for social network type
      applications (facebook, twitter, linkedin, ...)
\end{itemize}
Spider:
\begin{itemize}
\item Storage Engine for database sharding and clustering
\end{itemize}
\end{frame}


\subsection{Other stuff}

\begin{frame}{Galera}  % Todo: need to put with something else?
  Galera: Synchronous Multi-Master replication
  \begin{itemize}
  \item Developed by Codership
  \item \alert{Synchronous} replication
  \item Changes made durable on \emph{all} servers before \texttt{COMMIT}
    returns
  \item Optimisations to utilise query parallelism to get decent performance
    despite round-trip cost
  \item InnoDB specific
  \end{itemize}
\end{frame}

\begin{frame}{Drizzle}
  \begin{itemize}
  \item Forked from MySQL 6.0 in 2008
  \item Radical rewrite/cleanup of MySQL code base
  \item No plans to converge Drizzle and MySQL code base
  \item David Axmark will say more
  \end{itemize}
\end{frame}

\begin{frame}{MySQL pre-releases}
  \begin{itemize}
  \item MySQL Community Server 5.5.1
  \item Basis for next version of MySQL
  \item New release model for post-5.1 releases
  \item Similar to alpha/beta release
  \end{itemize}
\end{frame}

\begin{frame}{MySQL Previews}
  \begin{itemize}
  \item \texttt{http://forge.mysql.com/wiki/\\Category:Software\_Preview}
  \item Publishes selected feature branches
  \item Replication:
    \begin{itemize}
    \item Delayed replication
    \item Parallel SQL slave threads
    \item Scriptable replication
    \item Semi-synchronous replication
    \end{itemize}
  \item \texttt{SHOW PROFILES}
  \item Online Backup
  \item Falcon
  \item Batched key access
  \end{itemize}
  
\end{frame}

%% \begin{frame}{Proprietary stuff}
%% Tungsten:
%% \begin{itemize}
%%   \item External replication
%%   \item Adds automated management and failover/error recovery
%%   \item Replication between different databases (MySQL~$leftrightarrow$~Postgress~$leftrightarrow$~Oracle)
%%   \item Partly Free Software
%% \end{itemize}
%% Kickfire:
%% \begin{itemize}
%%   \item Data warehouse optimised MySQL
%%   \item Uses custom hardware ("SQL chip")
%%   \item Sold as appliance
%% \end{itemize}
%% \end{frame}

\section{How to use it}

\begin{frame}{How?}
So how can one use all of this stuff?
\end{frame}

\begin{frame}{Alternate packages}
  \begin{itemize}
  \item Combination of stock MySQL with various community contributions, maintained by 3rd parties
  \item Combine official MySQL releases with patches and storage engines
  \item Release source and binary packages
  \item Only practial method to use large number of external community
      contributions
  \item Problem if your favorite patch is not included
%  \item Or if your least favorite patch \textit{is} included
  \item Will lag behind official MySQL releases (typically~1 month, sometimes more)
  \end{itemize}
\end{frame}

\begin{frame}{Alternate packages for 5.0}
MySQL 5.0:
  \begin{itemize}
  \item OurDelta
  \item Percona binaries
  \item Maintain series of patch files separately
  \item Need to update patch series for every new MySQL release, and
    resolve/rewrite code changes that conflict
  \item Easy to drop a patch
  \end{itemize}
\end{frame}

\begin{frame}{Alternate packages for 5.1}
MySQL 5.1:
  \begin{itemize}
  \item MariaDB, a branch of MySQL 5.1
  \item Sergey Petrunya will say more 15:00 today
  \item Community patches and storage engines, plus own development
  \item Source and binary packages
  \item Maintained as a parallel bzr branch to MySQL on Launchpad
  \item Tighter integration between trees, more help from revision control
    software to control merging and conflicts
  \item Easier to handle major changes
  \item Still a lot of work to handle conflicts
  \end{itemize}
\end{frame}

\begin{frame}{Do it yourself}
  Patch MySQL source tree and compile
  \begin{itemize}
  \item \texttt{patch -p1 -s < my-patch-file.diff}
  \item Resolve conflicts
  \item Custom storage engine instructions
  \item Loadable .so plugin (need identical build options and version)
  \item \texttt{quilt} (advanced merging of multiple patches)
  \item Too much effort for everyone to do this individually
    \begin{itemize}
    \item need to integrate once in a way that many can reuse
    \end{itemize}
  \end{itemize}
\end{frame}

%% \begin{frame}{Submit for MySQL inclusion}
%%   \begin{itemize}
%%   \item Traditionally MySQL has a poor track record for accepting submission
%%   \item Some progress has been made
%%   \item Still a lot of real or perceived barriers to inclusion of contributions
%%     \begin{itemize}
%%     \item Copyright assignment
%%     \item Slow response/review process
%%     \item Slow release schedules
%%     \item MySQL development is not very open (Cathedral)
%%     \end{itemize}
%%   \item Need a Bazaar to supplement the MySQL Cathedral
%%   \end{itemize}
%% \end{frame}
%% \begin{frame}{MySQL pre-releases and Previews}
%%   Previews:
%%   \begin{itemize}
%%   \item Nice to get an idea what is coming up from the MySQL teams.
%%   \item Only single feature
%%   \item Probably not for production.
%%   \end{itemize}
%%   Pre-releases:
%%   \begin{itemize}
%%   \item Good for early testing of next-release feature
%%   \item Similar to alpha/beta release
%%   \end{itemize}
%% \end{frame}
%% \section{Conclusion}

\begin{frame}{Conclusion}
  \begin{itemize}
  \item Last few years has seen an explosion in community-driven MySQL
    development outside of MySQL/Sun/Oracle
    \begin{itemize}
    \item Good to be aware of what is available
    \end{itemize}
  \item Alternate packages makes it easier to use these community-developed
    extensions
    \begin{itemize}
    \item More work in currently being done to make this even easier in the future
    \end{itemize}
%%   \item Lots of opportunities for more collaboration with MySQL/Sun/Oracle in
%%     the future
  \end{itemize}

Slides:
$$\texttt{https://knielsen-hq.org/maria/fosdem2010.pdf}$$

Contact:
$$\texttt{knielsen@askmonty.org}$$

\end{frame}

\end{document}


