Ruby,no sql and tokyocabinet
Upcoming SlideShare
Loading in...5
×
 

Ruby,no sql and tokyocabinet

on

  • 5,048 views

 

Statistics

Views

Total Views
5,048
Views on SlideShare
4,786
Embed Views
262

Actions

Likes
6
Downloads
61
Comments
0

7 Embeds 262

http://www.zhuangbiaowei.com 249
http://static.slidesharecdn.com 4
http://www.zhuaxia.com 3
http://cache.baidu.com 2
http://xianguo.com 2
http://www.slideshare.net 1
http://duckduckgo.com 1
More...

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Ruby,no sql and tokyocabinet Ruby,no sql and tokyocabinet Presentation Transcript

    • Ruby,NoSQL and TokyoCabinet
      盛大创新院 庄表伟
      http://www.zhuangbiaowei.com/blog/
    • From RDBMS to NoSQL (1)
      Long long ago …
      Network Database (GE IDS 1961)
      Hierarchical Database (IBM IMS 1968)
      Relational database era
      Edgar Frank Codd -- Since 1969
      Relational model
      SQL
      Management system
      Over $ 20 billion (2008)
    • From RDBMS to NoSQL (2)
      Now is Web2.0 era
      Have huge storage(TB/PB data size)
      Need high performance
      Need high scalability
      Need high availability
      NoSQL now coming
      New theory support
      New API style
      New buzzword
    • Projects or papers…
      Google BigTable (2004)
      Tokyo Cabinet (2006)
      Amazon Dynamo (2007)
      MongoDB,CouchDB,Cassandra,Voldemort (2008)
      Redis,Riak,HBase… (2009)
      More and more…
      From RDBMS to NoSQL (3)
    • CAP (Eric Brewer 2000)
      Consistency
      Availability
      Partition tolerance
      BASE
      Basically Available
      Soft-state
      Eventual Consistency
      MapReduce
      From functional programming
      Distributed computing framework
      Important NoSQL theory
      • Loss of data integrity
      • Any data is allowed
      • Can not ensure data consistency
      • Eventual Consistency
      • No transaction
      • Stored procedure convert to map/reduce script
      • Lack support of management system
      • System refactoring or rewrite
      Choose NoSQL means…
      • by MikioHirabayashi (平林幹雄)
      • http://1978th.net/
      • TokyoCabinet -- lightweight database library
      • TokyoTyrant -- lightweight database server
      • Key/Value Database
      • Database types
      • Hash / B+ Tree / Fixed-length / Table
      • High performance
      • Insert: 0.4sec/1M records(2,500,000 qps)
      • Search: 0.33sec/1M records(3,000,000 qps)
      • High concurrency
      • High Scalability
      TokyoCabinet and TokyoTyrant
      • Everyone table need a port
      • Loss table struct and data type
      • Can not access by column
      • Reduction of performance
      • Read 400,000 record/sec(TCT)
      • Read 1,800,000 record/sec(TCH)
      • Read 1,000,000 record/sec(TCB)
      • When the data more than 100 million, will performance reduction
      • Network protocol is not perfect
      TC/TT table engine insufficiency
      • One port,more table
      • Row access and column access
      • B+ tree data store
      • New binary api protocol
      • New data storage mode
      • Config TCH
      • Index  TCB
      • Data  TCB
      About TCDatabase
    • ActiveTokyoCabinet (1)
      Config
    • Model
      ActiveTokyoCabinet (2)
    • database.yml
      development:
      adapter: tcdb
      path: ./db
      database: blog
      model
      class Post < ActiveRecord::Base
      validates_presence_of :body, :title
      has_many :comments
      end
      About tcdb-adapter (1)
    • Migration
      class CreatePosts < ActiveRecord::Migration
      def self.up
      create_table :posts do |t|
      t.string :title
      t.text :body
      t.timestamps
      end
      end
      def self.down
      drop_table :posts
      end
      end
      About tcdb-adapter (2)
    • Demo
    • SQLite MySQL Oracle
      Money
      MySQL MySQL MySQL
      DBA
      RDBMS  NoSQL
      Risk
      RDBMS  tcdb-adapter  NoSQL
      SQL/NoSQL Bridge
      Storage architecture migration
    • Architecture diagram (today)
      Classic
      ActiveTokyoCabinet
      tcdb-adapter
      • TCDatabase Cloud Database
      Transparent distributed
      Running like mysql proxy
      Access to TC / MongoDB / MySQL / more
      Configuration and management support
      • Tcdb-adapter  Cloud ActiveRecord
      Almost support all of the SQL
      Rails3 support (based arel)
      Intergration thinking sphinx
      One Interface, One architecture!
      • You can imagine more …
      The future
    • Architecture diagram (future - 1)
    • Architecture diagram (future - 2)
    • Architecture diagram (future - 3)
    • It will be open source!
    • Thanks