alternative databases

Download Alternative Databases

Post on 18-May-2015

776 views

Category:

Technology

0 download

Embed Size (px)

TRANSCRIPT

  • Alternative DatabasesScott MacVicar

    Dutch PHP Conference 2009

    Saturday, 13 June 2009

  • Who are you?

    Saturday, 13 June 2009

  • History Lesson

    Saturday, 13 June 2009

  • First Data Storage

    Saturday, 13 June 2009

  • Relational Database is Born

    Relational Databases FTW!

    Saturday, 13 June 2009

  • Parts of a RDBMS?

    Maths SQL

    Relation Table

    Derived Relation

    Result Set

    Tuple Row

    Attribute Column

    Domain TypeSaturday, 13 June 2009

  • SQL Purpose

    Retrieval

    Manipulation

    Transactions

    Saturday, 13 June 2009

  • SQL Fails

    Complex Specification

    Join Fails

    Where clause

    Saturday, 13 June 2009

  • RDBMS through the Ages

    Saturday, 13 June 2009

  • RDBMs suck

    Adding fields is hard

    Complex

    Copying / Backup database

    Performance

    Saturday, 13 June 2009

  • Scaling?

    MasterDatabase

    MasterDatabase

    MasterDatabase

    App App App

    Saturday, 13 June 2009

  • Scaling?

    SlaveDatabase

    MasterDatabase

    SlaveDatabase

    App App App

    Saturday, 13 June 2009

  • Write consistency is the reason RDBMS are imploding under their own weight.

    Saturday, 13 June 2009

  • Why do we use a RDBMs?

    Saturday, 13 June 2009

  • RDBMS Hangups

    Saturday, 13 June 2009

  • SQL

    blogblog_idtitlepublish_timeauthorcontent

    comments

    comment_id

    blog_id

    author

    content

    Saturday, 13 June 2009

  • Save See

    Secure Share

    Saturday, 13 June 2009

  • Memcache + BerkleyDB = MemcacheDB?

    Saturday, 13 June 2009

  • MemcacheDB

    Memcache isnt persistent :(

    Memcache dependency

    Memcache does what it does well

    Saturday, 13 June 2009

  • MemcacheDB

    Simple Protocol

    Tried and tested DB

    Transactions

    Replication

    Saturday, 13 June 2009

  • Using MemcacheDB

    Saturday, 13 June 2009

  • MemcacheDB + PHP

    Saturday, 13 June 2009

  • Blog Example

    Saturday, 13 June 2009

  • Tokyo Cabinet

    Collection of types

    Created for mixi.jp (Facebook of Japan)

    Common API

    New in PHP6, maybe PHP 5.3.1

    Saturday, 13 June 2009

  • Tokyo Hash Database

    Constant time for most operations

    Second Hash for collisions

    Key values stored in a bucket array

    Saturday, 13 June 2009

  • Buckets!

    Key ValueKey ValueKey ValueKey ValueKey ValueKey Value

    Saturday, 13 June 2009

  • Tokyo Cabinet Hash

    Saturday, 13 June 2009

  • B+ Tree

    Ordered Access

    Multiple Keys

    Cursor

    Saturday, 13 June 2009

  • Fixed-Length

    Access by numeric key

    No keys stored

    Fast

    Saturday, 13 June 2009

  • Fixed-Length

    value value value value value value value

    value value value value value value value

    value value value value value value value

    value value value value value value value

    value value value value value value value

    0

    8

    16

    24

    32

    40

    Saturday, 13 June 2009

  • Table Database

    Schema-less

    Named Attributes

    Indexes

    Queries

    Saturday, 13 June 2009

  • Table Database

    Primary Key

    Primary Key

    Primary Key

    name value

    name value

    name value

    name value

    name value

    name value

    name value

    name value

    name value

    Saturday, 13 June 2009

  • Network wrapper

    Speaks Memcache / HTTP

    Extension in works by Mikko

    Tokyo Tyrant

    Saturday, 13 June 2009

  • Tokyo Tyrant

    High Availability

    Asynchronous Updates

    Lua scripting

    Saturday, 13 June 2009

  • CouchDB

    REST

    JavaScript

    Erlang

    Saturday, 13 June 2009

  • CouchDB

    Document Database

    Replication

    Map Reduce

    No Indexes

    Saturday, 13 June 2009

  • Database Access

    GET /_all_dbs

    PUT /somedatabase/

    DELETE /somedatabase/

    GET /somedatabase/

    Saturday, 13 June 2009

  • Document Access

    GET /somedatabase/_all_docs

    PUT /somedatabase/some_docid

    POST /somedatabase/

    DELETE /somedatabase/some_docid

    GET /somedatabase/some_docid

    Saturday, 13 June 2009

  • CouchDB Document

    Saturday, 13 June 2009

  • CouchDB Document

    Saturday, 13 June 2009

  • CouchDB Views

    Saturday, 13 June 2009

  • CouchDB Scaling

    Caching

    Clustering

    Layering

    Saturday, 13 June 2009

  • CouchDB Wrappers

    PHPillow - http://short.ie/buiqhu

    Phly_Couch - http://short.ie/pa47gp

    Saturday, 13 June 2009

  • CouchDB Blog

    Saturday, 13 June 2009

  • CouchDB Blog Alternative

    Saturday, 13 June 2009

  • Amazon SimpleDB

    Application

    RestXML

    Saturday, 13 June 2009

  • Amazon SimpleDB

    Amazon Web Service

    Cloudy

    Rest / XML

    Saturday, 13 June 2009

  • SimpleDB

    1 billion attributes

    5 seconds execution

    1024 byte values

    Saturday, 13 June 2009

  • SimpleDB Set

    Saturday, 13 June 2009

  • SimpleDB Query

    Saturday, 13 June 2009

  • SimpleDB API

    Officially Amazon API - http://short.ie/apx6c3

    Tarzan-AWS - http://short.ie/54rucx

    Saturday, 13 June 2009

  • Questions?

    http://talks.macvicar.net

    http://couchdb.apache.org

    http://aws.amazon.com

    http://memcachedb.org

    Saturday, 13 June 2009