Oracle与mongodb的区别
生活随笔
收集整理的這篇文章主要介紹了
Oracle与mongodb的区别
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
oracle與mongodb的區(qū)別
1. 從概念上
Oracle中的許多概念與MongoDB中的類似。下表概述了Oracle和MongoDB中的常見概念。
| ACID Transactions | ACID Transactions |
| Table | Collection |
| Row | Document |
| Column | Field |
| Secondary Index | Secondary Index |
| JOINs | Embedded documents, $lookup & $graphLookup |
| GROUP_BY | Aggregation Pipeline |
2. 從功能和特性上
與Oracle一樣,MongoDB提供了一組豐富的特性和功能,遠(yuǎn)遠(yuǎn)超出了簡單NoSQL數(shù)據(jù)存儲所提供的特性和功能。MongoDB擁有豐富的查詢語言、功能強大的二級索引(包括文本搜索和地理空間)、強大的數(shù)據(jù)分析、分面搜索、圖形處理等聚合框架。使用MongoDB,您還可以跨比關(guān)系數(shù)據(jù)庫更多樣化的數(shù)據(jù)類型使用這些特性,并且可以大規(guī)模地使用它們。
| ACID Transactions | √ | √ | √ |
| Flexible, rich data model | · | √ | Partial: schema flexibility but support for only simple data structures |
| Schema governance | √ | √ | · |
| Expressive joins, faceted search, graphs queries, powerful aggregations | √ | √ | · |
| Idiomatic, native language drivers | · | √ | · |
| Horizontal scale-out with data locality controls | · | √ | · Partial: no controls over data locality |
| Analytics and BI ready | √ | √ | · |
| Enterprise grade security and mature management tools | √ | √ | · |
| Database as a service on all major clouds | Partial: AWS and Oracle cloud | √ | · |
3. 從查詢語言上
| INSERT INTO users (user_id, age, status) VALUES (‘bcd001’, 45, ‘A’) | db.users.insert({ user_id: ‘bcd001’, age: 45, status: ‘A’ }) |
| SELECT * FROM users | db.users.find() |
| UPDATE users SET status = ‘C’ WHERE age > 25 | db.users.update( { age: { $gt: 25 } }, { $set: { status: ‘C’ } }, { multi: true } ) |
| db.start_transaction() cursor.execute(orderInsert, orderData) cursor.execute(stockUpdate, stockData) db.commit() | s.starttransaction() orders.insertone(order, session=s) stock.updateone(item, stockUpdate, session=s) s.committransaction() |
總結(jié)
以上是生活随笔為你收集整理的Oracle与mongodb的区别的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Express中post请求req.bo
- 下一篇: 图解MongoDB的连接与使用,通俗易懂