github.com/nutsdb/nutsdb@v1.0.4/README.md (about)

     1  <p align="center">
     2      <img src="https://user-images.githubusercontent.com/6065007/141310364-62d7eebb-2cbb-4949-80ed-5cd20f705405.png">
     3  </p>
     4  
     5  <div class="column" align="middle">
     6    <a href="https://godoc.org/github.com/nutsdb/nutsdb"><img src="https://godoc.org/github.com/nutsdb/nutsdb?status.svg" /></a>
     7    <a href="https://goreportcard.com/report/github.com/nutsdb/nutsdb"><img src="https://goreportcard.com/badge/github.com/nutsdb/nutsdb" /></a>
     8    <a href="https://goreportcard.com/report/github.com/nutsdb/nutsdb"><img src="https://github.com/nutsdb/nutsdb/workflows/Go/badge.svg?branch=master"/></a>
     9    <a href="https://codecov.io/gh/nutsdb/nutsdb"><img src="https://codecov.io/gh/nutsdb/nutsdb/branch/master/graph/badge.svg?token=CupujOXpbe"/></a>
    10    <a href="https://raw.githubusercontent.com/nutsdb/nutsdb/master/LICENSE"><img src="http://img.shields.io/badge/license-Apache_2-blue.svg?style=flat-square"/></a>
    11    <a href="https://github.com/avelino/awesome-go#database"><img src="https://awesome.re/mentioned-badge.svg"/></a>
    12  </div>
    13  
    14  ## What is NutsDB?
    15  
    16  English | [简体中文](https://github.com/nutsdb/nutsdb/blob/master/README-CN.md)
    17  
    18  NutsDB is a simple, fast, embeddable and persistent key/value store written in pure Go.
    19  
    20  It supports fully serializable transactions and many data structures such as list、set、sorted set. All operations happen inside a Tx. Tx represents a transaction, which can be read-only or read-write. Read-only transactions can read values for a given bucket and a given key or iterate over a set of key-value pairs. Read-write transactions can read, update and delete keys from the DB.
    21  
    22  We can learn more about NutsDB in details on the documents site of NutsDB: [NutsDB Documents](https://nutsdb.github.io/nutsdb-docs/)
    23  
    24  ## Announcement
    25  
    26  * v1.0.0 release, see for details: [https://github.com/nutsdb/nutsdb/releases/tag/v1.0.0](https://github.com/nutsdb/nutsdb/releases/tag/v1.0.0)
    27  * v0.14.3 release, see for details: [https://github.com/nutsdb/nutsdb/releases/tag/v0.14.3](https://github.com/nutsdb/nutsdb/releases/tag/v0.14.3)
    28  * v0.14.2 release, see for details: [https://github.com/nutsdb/nutsdb/releases/tag/v0.14.2](https://github.com/nutsdb/nutsdb/releases/tag/v0.14.2)
    29  * v0.14.1 release, see for details: [https://github.com/nutsdb/nutsdb/releases/tag/v0.14.1](https://github.com/nutsdb/nutsdb/releases/tag/v0.14.1)
    30  
    31  📢 Note: Starting from v0.9.0, **defaultSegmentSize** in **DefaultOptions** has been adjusted from **8MB** to **256MB**. The original value is the default value, which needs to be manually changed to 8MB, otherwise the original data will not be parsed. The reason for the size adjustment here is that there is a cache for file descriptors starting from v0.9.0 (detail see https://github.com/nutsdb/nutsdb/pull/164 ), so users need to look at the number of fds they use on the server, which can be set manually. If you have any questions, you can open an issue.
    32  
    33  After **nutsdb v1.0.0**, due to changes in the underlying data storage protocol, **the data of the old version is not compatible**. Please rewrite it before using the new version. And the current Bucket needs to be created manually. Please see the Bucket usage [documentation](./docs/user_guides/use-buckets.md) for details.
    34  
    35  ## Architecture
    36  ![nutsdb-架构图](./docs/img/nutsdb-架构图.png)
    37  
    38  
    39   Welcome [contributions to NutsDB](https://github.com/nutsdb/nutsdb#contributing).
    40  
    41  ## Quick start
    42  
    43  ### Install NutsDB
    44  
    45  To start using NutsDB, first needs [Go](https://golang.org/dl/) installed (version 1.18+ is required).  and run go get:
    46  
    47  ```
    48  go get -u github.com/nutsdb/nutsdb
    49  ```
    50  
    51  ### Opening a database
    52  
    53  To open your database, use the nutsdb.Open() function,with the appropriate options.The `Dir` , `EntryIdxMode`  and  `SegmentSize`  options are must be specified by the client. About options see [here](https://github.com/nutsdb/nutsdb#options) for detail.
    54  
    55  ```go
    56  package main
    57  
    58  import (
    59      "log"
    60  
    61      "github.com/nutsdb/nutsdb"
    62  )
    63  
    64  func main() {
    65      // Open the database located in the /tmp/nutsdb directory.
    66      // It will be created if it doesn't exist.
    67      db, err := nutsdb.Open(
    68          nutsdb.DefaultOptions,
    69          nutsdb.WithDir("/tmp/nutsdb"),
    70      )
    71      if err != nil {
    72          log.Fatal(err)
    73      }
    74      defer db.Close()
    75  
    76      ...
    77  }
    78  ```
    79  
    80  ## Documentation
    81  
    82  <details>
    83    <summary><b>Buckets</b></summary>
    84  
    85  - [Using buckets](./docs/user_guides/use-buckets.md)
    86  </details>
    87  
    88  <details>
    89    <summary><b>Pairs</b></summary>
    90  
    91  - [Using key/value pairs](./docs/user_guides/use-kv-pair.md)
    92  </details>
    93  
    94  <details>
    95    <summary><b>Iterator</b></summary>
    96  
    97  - [Iterating over keys](./docs/user_guides/iterator.md)
    98  </details>
    99  
   100  <details>
   101    <summary><b>Data Structures</b></summary>
   102  
   103  - [List](./docs/user_guides/data-structure.md#list)
   104  - [Set](./docs/user_guides/data-structure.md#set)
   105  - [Sorted Set](./docs/user_guides/data-structure.md#sorted-set)
   106  </details>
   107  
   108  <details>
   109    <summary><b>Database Options</b></summary>
   110  
   111  - [Options](./docs/user_guides/options.md)
   112  </details>
   113  
   114  <details>
   115    <summary><b>More Operation</b></summary>
   116  
   117  - [More Operation](./docs/user_guides/others.md)
   118  </details>
   119  
   120  <details>
   121    <summary><b>Comparison</b></summary>
   122  
   123  - [Comparison](./docs/user_guides/comparison.md)
   124  </details>
   125  
   126  <details>
   127    <summary><b>Benchmark</b></summary>
   128  
   129  - [Benchmark](./docs/user_guides/benchmarks.md)
   130  </details>
   131  
   132  ## Contributors
   133  
   134  Thank you for considering contributing to NutsDB! The contribution guide can be found in the [CONTRIBUTING](https://github.com/nutsdb/nutsdb/blob/master/CONTRIBUTING.md) for details on submitting patches and the contribution workflow.
   135  
   136  <a href="https://github.com/nutsdb/nutsdb/graphs/contributors">
   137    <img src="https://contrib.rocks/image?repo=nutsdb/nutsdb" />
   138  </a>
   139  
   140  ## Acknowledgements
   141  
   142  This package is inspired by the following:
   143  
   144  - [Bitcask-intro](https://github.com/basho/bitcask/blob/develop/doc/bitcask-intro.pdf)
   145  - [BoltDB](https://github.com/boltdb)
   146  - [BuntDB](https://github.com/tidwall/buntdb)
   147  - [Redis](https://redis.io/)
   148  - [Sorted Set](https://github.com/wangjia184/sortedset)
   149  
   150  ## License
   151  
   152  The NutsDB is open-sourced software licensed under the [Apache 2.0 license](https://github.com/nutsdb/nutsdb/blob/master/LICENSE).