All Projects → Rannie → RHKeyValueStore

Rannie / RHKeyValueStore

Licence: MIT license
Key-Value storage tool, based on WCDB (WeChat DataBase).

Programming Languages

Objective-C++
1391 projects
objective c
16641 projects - #2 most used programming language
ruby
36898 projects - #4 most used programming language

Projects that are alternatives of or similar to RHKeyValueStore

MIT6.824-2021
4 labs + 2 challenges + 4 docs
Stars: ✭ 594 (+2870%)
Mutual labels:  kvstore
aurora
A Raft based K-V database implemented with cpp.
Stars: ✭ 32 (+60%)
Mutual labels:  kvstore
dxram
A distributed in-memory key-value storage for billions of small objects.
Stars: ✭ 25 (+25%)
Mutual labels:  key-value-store
toplingdb
ToplingDB is a cloud native LSM Key-Value Store with searchable compression algo and distributed compaction
Stars: ✭ 631 (+3055%)
Mutual labels:  kvstore
Tendis
Tendis is a high-performance distributed storage system fully compatible with the Redis protocol.
Stars: ✭ 2,295 (+11375%)
Mutual labels:  kvstore
pDPM
Passive Disaggregated Persistent Memory at USENIX ATC 2020.
Stars: ✭ 38 (+90%)
Mutual labels:  key-value-store
Cubdb
Elixir embedded key/value database
Stars: ✭ 235 (+1075%)
Mutual labels:  key-value-store
maricutodb
PHP Flat File Database Manager
Stars: ✭ 23 (+15%)
Mutual labels:  key-value-store
avl array
High performance templated AVL tree using a fixed size array. Extensive test suite passing.
Stars: ✭ 33 (+65%)
Mutual labels:  key-value-store
lmdb-js
Simple, efficient, ultra-fast, scalable data store wrapper for LMDB
Stars: ✭ 270 (+1250%)
Mutual labels:  key-value-store
rocks4j
KV Store for Java backed by RocksDB
Stars: ✭ 13 (-35%)
Mutual labels:  kvstore
Yasp
Yet Another Shared Preference
Stars: ✭ 16 (-20%)
Mutual labels:  kvstore
julea
A Flexible Storage Framework for HPC
Stars: ✭ 25 (+25%)
Mutual labels:  key-value-store
gocache
High performance and lightweight in-memory cache library with LRU and FIFO support as well as memory-usage-based-eviction
Stars: ✭ 15 (-25%)
Mutual labels:  kvstore
rippledb
Embeddable key-value database engine in pure TypeScript, based on LSM-Tree
Stars: ✭ 33 (+65%)
Mutual labels:  key-value-store
Konserve
A clojuresque key-value/document store protocol with core.async.
Stars: ✭ 240 (+1100%)
Mutual labels:  key-value-store
meteora
Distributed key-value store.
Stars: ✭ 23 (+15%)
Mutual labels:  key-value-store
cachegrand
cachegrand is an open-source fast, scalable and secure Key-Value store, also fully compatible with Redis protocol, designed from the ground up to take advantage of modern hardware vertical scalability, able to provide better performance and a larger cache at lower cost, without losing focus on distributed systems.
Stars: ✭ 87 (+335%)
Mutual labels:  key-value-store
Pomegranate
🌳 A tiny skiplist based log-structured merge-tree written in Rust.
Stars: ✭ 20 (+0%)
Mutual labels:  kvstore
gvar
gvar(1) -- display, set, or remove global variables.
Stars: ✭ 15 (-25%)
Mutual labels:  key-value-store

RHKeyValueStore

Key-Value storage tool,based on WCDB (WeChat DataBase).

About WCDB : Tencent/WCDB , 微信WCDB进化之路 - 开源与开始

Easy KV database, can use it instead of NSUserDefaults.

Installation


Add pod 'RHKeyValueStore' to your Podfile and run pod install.
Import <RHKeyValueStore.h>.

Usage


Already #define KeyValueStore [RHKeyValueStore store] ,
so you can use KeyValuStore to get the store instance.

  • Integer
[KeyValueStore setInteger:10 forKey:@"someInteger"];
[KeyValueStore integerForKey:@"someInteger"];
  • Double
[KeyValueStore setDouble:12.4 forKey:@"someDouble"];
[KeyValueStore doubleForKey:@"someDouble"];
  • Bool
[KeyValueStore setBool:YES forKey:@"boolean"];
[KeyValueStore boolForKey:@"boolean"]; 
  • String
[KeyValueStore setString:@"lalal" forKey:@"onestring"];
[KeyValueStore stringForKey:@"onestring"];
  • Object

JSON encoding/decoding

TestObject *obj = [TestObject new];
obj.host = @"github";
obj.ipAddress = @"127.0.0.1";
obj.count = 10;
[KeyValueStore setJsonObject:[obj yy_modelToJSONObject] forKey:@"jsonModel"];
    
NSDictionary *ano = [KeyValueStore jsonObjectForKey:@"jsonModel"];
TestObject *obj2 = [TestObject yy_modelWithDictionary:ano];

Archive/Unarchive (confirm NSCoding Protocol)

[KeyValueStore setArchiveObject:obj forKey:@"archiveObj"];
TestObject *obj3 = [KeyValueStore unarchiveObjectForKey:@"archiveObj"];
  • Isolation Store

Use method + (instancetype)storeWithLabel:(NSString *)label to create a new table.

Like:

NSString *userId = @"my_user_id";
RHKeyValueStore *userStore = [RHKeyValueStore storeWithLabel:userId];
[userStore setInteger:30 forKey:@"someInteger"];
    
NSLog(@"global -- %zd, user -- %zd", [KeyValueStore integerForKey:@"someInteger"], [userStore integerForKey:@"someInteger"]);

Console output global -- 10, user -- 30 .

  • Other Methods
// get all keys
NSArray *keys = [KeyValueStore allKeys];
// get pair count
NSUInteger count = [KeyValueStore getKVCount];
// clear current table
[userStore clear];

Documentation


Full API documentation is available on CocoaDocs.

License


The MIT License (MIT)

Copyright (c) 2017 Hanran Liu

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].