nosql and javascript 2013-02-09

Post on 24-May-2015

673 Views

Category:

Technology

1 Downloads

Preview:

Click to see full reader

DESCRIPTION

2013年2月9日,九州産業大学『HTML5カーニバル』で使用したスライドです。

TRANSCRIPT

NOSQL & JavaScript

4D Japan原田 光一

4D について

NOSQL: WakandaRDBMS: 4D

W3C MEMBER

NOSQL

NOSQL

NOSQL

NOSQL

SQL

トランザクション強い整合性

Webサービス

Webサービス

大量のデータ素早く処理サービスの更新頻度

NOSQL

SQLで間に合わない部分

ニーズにあったDB

NOSQL ファミリードキュメントストアー

キー・バリューストアー

グラフ

オブジェクトストアー

カラムストアー

NOSQL ファミリードキュメントストアー

キー・バリューストアー

グラフ

オブジェクトストアー

カラムストアー

NOSQL ファミリードキュメントストアー

キー・バリューストアー

グラフ

オブジェクトストアー

カラムストアー

NOSQL Facts多くは スキーマ定義不要

多くは REST / JSON API を提供

多くは JSON を格納

多くは JavaScript エンジンを含む

多くは JavaScript シェルを提供

JavaScript

SpiderMonkey3 JIT Compilers: TraceMonkey, JägerMonkey, IonMonkey

V8JIT Compiler : CrankShaft

webkit JavaScriptCoreSquirrelFish Extreme: SFX aka Nitro

(JIT Compiler inside)

Chakra-> Classic JScript, Managed JScript, & JScript.NET

TamarinJIT Compiler : NanoJIT

-> ActionScript / “ECMAScript 4”

CarakanPreviously: Linear A, Linear B, Futhark

RhinoInterpreted or Compiled execution

CC++

C++Java

?

?C++

JavaScript エンジン

SpiderMonkey

V8

JavaScriptCore

Rhino

Trident / Chakra

サーバーサイドJS

JSでDBアクセス

キー・バリュー

WebStorageW3C / WHATWGHTML5

localsession‘storage’ イベント

// set or get items by methodslocalStorage.setItem("storedItem", "value");var value = localStorage.getItem("storedItem");

http://www.w3.org/TR/webstorage/

// sync interface when data change, even from other windowwindow.addEventListener("storage", handle_storage, false);

// set or get items using the store as a maplocalStorage.storedItem = value;var value = localStorage.storedItem;

// accessible only for this sessionvar foo = sessionStorage.bar;sessionStorage.bar = foo;

Note: Firefox used to propose “globalStorage”, Wakanda implements “user.storage”

Document

Indexed DatabaseHTML5同期 / 非同期インデックストランザクションカーソル

request.onerror = function(event) { // Do something with request.errorCode!};request.onsuccess = function(event) { // Do something with request.result!};

http://www.w3.org/TR/IndexedDB/

var request = indexedDB.open("MyTestDatabase", 3);

request.onupgradeneeded = function(event) { // Update object stores and indices .... }

var objectStore = db.createObjectStore("customers", { keyPath: "ssn" });

objectStore.createIndex("name", "name", { unique: false });objectStore.add({ ssn: "444-44-4444", name: "Bill", age: 35});

var transaction = db.transaction(["customers"], IDBTransaction.READ_WRITE);

Object

WakandaDBWebkit JavaScriptCore

REST / JSON

データクラス

自動更新

アクセッサー

イベント

メソッド

john = ds.Person.find("fistName eq John");

conferences = john.allConferences;

JohnJSConferences = conferences.filter("title == :1", "*JavaScript*");

JSAttendeesJohnMet = JSConferences.allPeople;

http://wakanda.org/

top related