All Projects → symisc → Vedis

symisc / Vedis

Licence: other
An Embedded Implementation of Redis

Programming Languages

c
50402 projects - #5 most used programming language

Projects that are alternatives of or similar to Vedis

Workflow
C++ Parallel Computing and Asynchronous Networking Engine
Stars: ✭ 6,680 (+1432.11%)
Mutual labels:  redis, embedded
Claudb
ClauDB is a REDIS implementation in Java
Stars: ✭ 64 (-85.32%)
Mutual labels:  redis, embedded
Yii2 Redis
Yii 2 Redis extension.
Stars: ✭ 416 (-4.59%)
Mutual labels:  redis
Spring boot
Spring Boot 使用总结 和 demo。 如果您觉得本代码对您有所帮助,请点击页面右上方"Star"
Stars: ✭ 431 (-1.15%)
Mutual labels:  redis
Lada Cache
A Redis based, fully automated and scalable database cache layer for Laravel
Stars: ✭ 424 (-2.75%)
Mutual labels:  redis
Playandroid
🔥🔥🔥 Kotlin + MVVM + LCE版玩安卓,暗黑模式、横竖屏、无网、弱网、无数据、加载失败等等各种情况,协程、Room、Hilt、DataStore、LiveData、Retrofit、屏幕适配、本地缓存、多语言切换、多 lib,你想要的我都有!!!
Stars: ✭ 414 (-5.05%)
Mutual labels:  datastore
Nar
node.js application archive - create self-contained binary like executable applications that are ready to ship and run
Stars: ✭ 428 (-1.83%)
Mutual labels:  embedded
Run Aspnetcore Microservices
Microservices on .Net platforms which used Asp.Net Web API, Docker, RabbitMQ, MassTransit, Grpc, Ocelot API Gateway, MongoDB, Redis, PostgreSQL, SqlServer, Dapper, Entity Framework Core, CQRS and Clean Architecture implementation. Also includes Cross-Cutting concerns like Implementing Centralized Distributed Logging with Elasticsearch, Kibana and SeriLog, use the HealthChecks with Watchdog, Implement Retry and Circuit Breaker patterns with Polly and so on.. See Microservices Architecture and Step by Step Implementation on .NET Course w/ discount->
Stars: ✭ 406 (-6.88%)
Mutual labels:  redis
Odas
ODAS: Open embeddeD Audition System
Stars: ✭ 435 (-0.23%)
Mutual labels:  embedded
Ph7
An Embedded Implementation of PHP (C Library)
Stars: ✭ 422 (-3.21%)
Mutual labels:  embedded
Redis Plus Plus
Redis client written in C++
Stars: ✭ 428 (-1.83%)
Mutual labels:  redis
Permissions2
🔐 Middleware for keeping track of users, login states and permissions
Stars: ✭ 423 (-2.98%)
Mutual labels:  redis
Stackexchange.redis.extensions
Stars: ✭ 419 (-3.9%)
Mutual labels:  redis
Cookbook
🎉🎉🎉JAVA高级架构师技术栈==任何技能通过 “刻意练习” 都可以达到融会贯通的境界,就像烹饪一样,这里有一份JAVA开发技术手册,只需要增加自己练习的次数。🏃🏃🏃
Stars: ✭ 428 (-1.83%)
Mutual labels:  redis
Tslib
Touchscreen access library
Stars: ✭ 416 (-4.59%)
Mutual labels:  embedded
Opserver
Stack Exchange's Monitoring System
Stars: ✭ 4,126 (+846.33%)
Mutual labels:  redis
Geowave
GeoWave provides geospatial and temporal indexing on top of Accumulo, HBase, BigTable, Cassandra, Kudu, Redis, RocksDB, and DynamoDB.
Stars: ✭ 415 (-4.82%)
Mutual labels:  redis
Framework Learning
计算机学习资料(Java , Jvm , Linux , Mysql , Netty , Redis , Netty , Spring , SpringBoot , Mybatis , Rabbitmq ,计算机网络 , 数据结构与算法 , 设计模式 )Github网页阅读:https://guang19.github.io/framework-learning , Gitee网页版阅读: https://qsjzwithguang19forever.gitee.io/framework-learning
Stars: ✭ 416 (-4.59%)
Mutual labels:  redis
Pika
Pika is a nosql compatible with redis, it is developed by Qihoo's DBA and infrastructure team
Stars: ✭ 4,439 (+918.12%)
Mutual labels:  redis
Redis Admin
redis client tool,redis web client,redis web ui,spring-boot support
Stars: ✭ 436 (+0%)
Mutual labels:  redis

vedis

An Embedded Implementation of Redis. http://vedis.symisc.net

Overview

Vedis is an embeddable datastore C library built with over 70 commands similar in concept to Redis but without the networking layer since Vedis run in the same process of the host application.

Unlike most other datastores (i.e. memcache, Redis), Vedis does not have a separate server process. Vedis reads and writes directly to ordinary disk files. A complete database with multiple collections, is contained in a single disk file. The database file format is cross-platform, you can freely copy a database between 32-bit and 64-bit systems or between big-endian and little-endian architectures.

Vedis is a self-contained C library without dependency. It requires very minimal support from external libraries or from the operating system. This makes it well suited for use in embedded devices that lack the support infrastructure of a desktop computer. This also makes Vedis appropriate for use within applications that need to run without modification on a wide variety of computers of varying configurations.

Features

  • Serverless, datastore engine.
  • Transactional (ACID) datastore.
  • Built with over 70 commands similar to the standard Redis commands.
  • Zero configuration.
  • Single database file, does not use temporary files.
  • Cross-platform file format.
  • Standard Key/Value store.
  • Support for on-disk as well in-memory datastore.
  • Thread safe and full reentrant.
  • Simple, Clean and easy to use API.
  • Support Terabyte sized databases.

Vedis in 5 Minutes or Less

The principal task of a datastore engine is to store and retrieve records as fast as possible. Vedis support both structured and raw data storage.

Structured data storage is presented to clients via the command execution interface (CEI). Basically, you execute one or more commands ala Redis (i.e. SET key value; GET key, HSET...) via vedis_exec() and you extract the execution result (The return value of the command) via vedis_exec_result(). Refer to the following page for the list of built-in commands.

Raw data storage is presented to clients via the Key/Value store interfaces. Vedis is a standard key/value store similar to Berkeley DB, Tokyo Cabinet, LevelDB, etc. but with a rich feature set including support for transactions (ACID), concurrent reader, etc.

Under the KV store, both keys and values are treated as simple arrays of bytes, so content can be anything from ASCII strings, binary blob and even disk files. The KV store layer is presented to clients via a set of interfaces, these includes: vedis_kv_store(), vedis_kv_append(), vedis_kv_fetch_callback(), vedis_kv_append_fmt(), etc.

vedis *pStore; /* Datastore handle */
int rc;

/* Create our datastore */
rc = vedis_open(&pStore,argc > 1 ? argv[1] /* On-disk DB */ : ":mem:"/* In-mem DB */);
if( rc != VEDIS_OK ){  /* Seriously? */  return; }

/* Execute the simplest command */
rc = vedis_exec(pStore,"SET test 'Hello World'",-1);
if( rc != VEDIS_OK ){ /* Handle error */ }

/* Another simple command (Multiple set) */
rc = vedis_exec(pStore,"MSET username james age 27 mail [email protected]",-1);
if( rc != VEDIS_OK ){ /* Handle error */ }

/* A quite complex command (Multiple hash set) using foreign data */
rc = vedis_exec_fmt(pStore,
     "HMSET config pid %d user %s os %s scm %s",
      1024    /* pid */,
      "dean", /* user */
      "FreeBSD", /* OS */
      "Git"      /* SCM */
   );
if( rc != VEDIS_OK ){ /* Handle error */ }

/* Fetch some data */
rc = vedis_exec(pStore,"GET test",-1);
if( rc != VEDIS_OK ){ /* Seriously? */ }

/* Extract the return value of the last executed command (i.e. 'GET test') " */
vedis_exec_result(pStore,&pResult);
{
    const char *zResponse;
     /* Cast the vedis object to a string */
     zResponse = vedis_value_to_string(pResult,0);
     /* Output */
     printf(" test ==> %s\n",zResponse); /* test ==> 'Hello world' */
}

vedis_exec(pStore,"GET mail",-1);
/* 'GET mail' return value */
vedis_exec_result(pStore,&pResult);
{
   const char *zResponse;
   /* Cast the vedis object to a string */
   zResponse = vedis_value_to_string(pResult,0);
   /* Output */
   printf(" mail ==> %s\n",zResponse); /* Should be '[email protected]' */
}

/*
 * A command which return multiple value in array.
 */
vedis_exec(pStore,"MGET username age",-1); /* james 27*/
vedis_exec_result(pStore,&pResult);

if( vedis_value_is_array(pResult) ){
   /* Iterate over the elements of the returned array */
   vedis_value *pEntry;
   puts("Array entries:");
   while((pEntry = vedis_array_next_elem(pResult)) != 0 ){
     const char *zEntry;
     /* Cast to string and output */
     zEntry = vedis_value_to_string(pEntry,0);
     /* Output */
     printf("\t%s\n",zEntry);
  }
}

/* Extract hashtable data */
vedis_exec(pStore,"HGET config pid",-1); /* 1024 */
vedis_exec_result(pStore,&pResult);
{
  int pid;
  /* Cast to integer */
  pid = vedis_value_to_int(pResult);
  /* Output */
  printf("pid ==> %d\n",pid); /* Should be 1024 */
}
/* Finally, auto-commit the transaction and close our datastore */
vedis_close(pStore);
  • The datastore is created on line 5 using a call to vedis_open(). This is often the first Vedis API call that an application makes and is a prerequisite in order to play with Vedis.
  • As you can see, executing commands (ala Redis) under Vedis is pretty simple and involve only a single call to vedis_exec() or vedis_exec_fmt(). This is done on line 9, 13, 17, 45 on our example regardless how much the executed command is complex.
  • Execution result (i.e. Return value) of the last executed command is extracted via vedis_exec_result(). This is done on line 27, 31, 40, 54 in our example.
  • After that, the host application need to cast this object value (i.e. Return value of the last executed command) to the desired C type (String, Integer, Double or Boolean). For this purpose, a set of smart interfaces is available: vedis_value_to_string(), vedis_value_to_int(), vedis_value_to_bool(), etc. This done on line 35, 46, 64 and 76.
  • Working with commands which returns an object value of type array (i.e. MGET, HMGET, HVALS, CMD_LIST, etc.) is straightforward and involve only a single call to vedis_array_walk() or vedis_array_next_elem(). The first interface expect a user supplied callback which is invoked for each entry in the array while the latter iterate over the array elements one after one.
  • Finally, the transaction is auto-committed and our datastore is closed on line 81 using the vedis_close() interface.
  • Enhancing Vedis with foreign (i.e. User defined) commands is pretty simple and involve only a single call to vedis_register_command(). All of the built-in commands are installed using exactly this interface.

Download, License and Support

visit http://vedis.symisc.net

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].