easy replication support • 簡單的 API – simple API • 最終一致性 – eventually consistent – BASE(Basically Available, Soft state, Eventually consistency) • 巨量的資料 – Huge amount of Data
101 Bob Ho 56 Pid City Country 100 New York USA 101 New York USA 101 Taipei Taiwan { “name ” : “Bob Ho”, “age” : 56, “address” : [ { “city” : “New York”, “country” : “USA”}, { “city” : “Taipei”, “country” : “Taiwan”} ] } user address
• {name: {$regex: /a/}} – WHERE name LIKE ‘%a%’ • {name: {$regex: /A/i}} – WHERE name LIKE ‘%a%’ OR name LIKE ‘%A%’ • {name: {$regex: /a$/}} – WHERE name LIKE ‘%a’ • {name: {$regex: /^f.*k$/}} – WHERE name LIKE ‘f%k’ • {name: {$regex: /^f.{3}k$/}} – WHERE name LIKE ‘f___k’
– SQL: WHERE age IS NOT NULL AND age NOT IN (5, 16) • {age: {$exists: false}} – SQL: WHERE age IS NULL • {age: {$type: 1}} – SQL: WHERE type(age)=1 • {name: {$type: “string”}} – SQL: WHERE type(name)=‘string’
aardvark, 1 cat, 1 mat, 1 on, 2 data block2 the aardvark sat on the sofa Mapper2 (the, 1)(aardvark, 1) (sat, 1)(on, 1)(the, 1) (sofa, 1) Reducer2 sat, 2 sofa, 1 the, 4 data block2 the cat sat on the mat HDFS HDFS Intermediate file Local disk (http:pull) Shuffle and Sort (aardvark, 1)(cat, 1)(mat, 1)(on, 1, 1) (sat, 1, 1)(sofa, 1)(the, 1, 1, 1, 1)
In-Memory 5% of physical memory 50 MB 50 GB WiredTiger 5% of free disk space 990 MB 50 GB MMAPv1 5% of free disk space 990 MB 50 GB For 64-bit Unix/Linux and Windows Storage Engine Default Size Min Value Max Value In-Memory 192 MB of physical memory WiredTiger 192 MB of free disk space MMAPv1 192 MB of free disk space For 64-bit OS X