<kbd id="afajh"><form id="afajh"></form></kbd>
<strong id="afajh"><dl id="afajh"></dl></strong>
    <del id="afajh"><form id="afajh"></form></del>
        1. <th id="afajh"><progress id="afajh"></progress></th>
          <b id="afajh"><abbr id="afajh"></abbr></b>
          <th id="afajh"><progress id="afajh"></progress></th>

          ReveldbNoSQL 數(shù)據(jù)服務(wù)器

          聯(lián)合創(chuàng)作 · 2023-10-01 01:07

          reveldb 是一個基于 google leveldb 的 NoSQL 數(shù)據(jù)服務(wù)器,網(wǎng)絡(luò)連接采用了 libevent 的 HTTP 接口,因此 reveldb 天生就適合處理 HTTP 請求。

          但更確切地說,reveldb 并沒有直接采用 libevent 的 HTTP 接口,而是使用了另外一個基于 libevent 的網(wǎng)絡(luò)連接庫 libevhtp,并對它做了適當(dāng)?shù)男薷模怪蔀?reveldb 的底層組件 evhttpx,evhttpx 為 reveldb 提供了 HTTP 和 HTTPS 支持,因此,reveldb 除了能夠處理 HTTP 請求外,也能夠處理 HTTPS 請求,這一特性是 Kyoto Tycoon 沒有的。

          Reveldb 定位于 Kyoto Tycoon 類似,也是一個數(shù)據(jù)庫網(wǎng)絡(luò)層的服務(wù),具體一點就是 Leveldb 的網(wǎng)絡(luò)層接口(因為 leveldb 本身只是一個程序庫,并沒有服務(wù)器/客戶端的概念),reveldb 封裝了 leveldb 的絕大部分操作,如 Snapshot, Writebatch, Iterator 等等,并且在此基礎(chǔ)之上擴展了很多命令,比如 string 的 append, prepend, insert,Key-Value 的 mset, mget, mdel, seize, mseize,此外還有 range query, 基于編輯距離的查找,正則式 regex 匹配查找;同時還提供了一些數(shù)據(jù)庫管理的命令,如compact, repair, destroy 等;Ling外,reveldb 支持打開多個數(shù)據(jù)庫,底層使用了紅黑樹緩存各個客戶端已經(jīng)打開的 leveldb 實例。

          HTTP RPC 示例:

          /rpc/echo

          • Description: Echo back the input data as the output data, as well as HTTP headers, just for testing.

          • input: (optional): arbitrary records.

          • output: (optional): corresponding records to the input data.

          • status code: 200.

          • sample request:

            http://127.0.0.1:8088/rpc/echo?db=default&key=hello&value=world
          • sample response:

            {
                "code": 200,
                "status": "OK",
                "message": "Reveldb echoed the HTTP headers and query arguments of your request.",
                "date": "Mon, 17 Dec 2012 12:50:22 GMT",
                "request": {
                    "headers": {
                        "Host": "127.0.0.1:8088",
                        "User-Agent": "Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:17.0) Gecko/20100101 Firefox/17.0",
                        "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8",
                        "Accept-Language": "en-US,en;q=0.5",
                        "Accept-Encoding": "gzip, deflate",
                        "Connection": "keep-alive"
                    },
                    "arguments": {
                        "db": "default",
                        "key": "hello",
                        "value": "world"
                    }
                }
            }

           

           

          /rpc/set

          • Description:

          • input: db: the database identifier.

          • input: key: key to be added.

          • input: value: value along with the key to be added.

          • status code: 200.

          • sample request:

            http://127.0.0.1:8088/rpc/set?db=hello&key=hello&value=world
          • sample response:

            {
                "code": 200,
                "status": "OK",
                "message": "Set key-value pair done.",
                "date": "Thu, 27 Dec 2012 09:11:26 GMT"
            }

          /rpc/get

          • Description:

          • input: db: the database identifier.

          • input: key: which key to get.

          • status code: 200.

          • sample request:

            http://127.0.0.1:8088/rpc/get&db=hello&key=hello
          • sample response:

          • {
                "code": 200,
                "status": "OK",
                "message": "Get key-value pair done.",
                "date": "Thu, 27 Dec 2012 09:19:05 GMT",
                "kv": {
                    "hello": "worldworld"
                }
            }
          瀏覽 27
          點贊
          評論
          收藏
          分享

          手機掃一掃分享

          編輯 分享
          舉報
          評論
          圖片
          表情
          推薦
          點贊
          評論
          收藏
          分享

          手機掃一掃分享

          編輯 分享
          舉報
          <kbd id="afajh"><form id="afajh"></form></kbd>
          <strong id="afajh"><dl id="afajh"></dl></strong>
            <del id="afajh"><form id="afajh"></form></del>
                1. <th id="afajh"><progress id="afajh"></progress></th>
                  <b id="afajh"><abbr id="afajh"></abbr></b>
                  <th id="afajh"><progress id="afajh"></progress></th>
                  97在线免费视频观看 | 日韩Av无码一区二区三区不卡 | 大鸡巴成人性爱在线视频 | 亚洲国产色情视频 | 免费看黄色片国产馆 |