diff --git a/README.md b/README.md index b3864d6bd..89e6b4493 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ Dragonfly's core properties make it a cost-effective, high-performing, and easy- ## Benchmarks - + Dragonfly is crossing 3.8M QPS on c6gn.16xlarge reaching x25 increase in throughput compared to Redis. @@ -47,13 +47,13 @@ In the following test, we filled Dragonfly and Redis with ~5GB of data using `debug populate 5000000 key 1024` command. Then we started sending the update traffic with `memtier` and kicked off the snapshotting with the "bgsave" command. The following figure demonstrates clearly how both servers behave in terms of memory efficiency. - + Dragonfly was 30% more memory efficient than Redis at the idle state. It also did not show any visible memory increase during the snapshot phase. Meanwhile, Redis reached almost x3 memory increase at peak compared to Dragonfly. Dragonfly also finished the snapshot much faster, just a few seconds after it started. -For more info about memory efficiency in Dragonfly see [dashtable doc](./doc/dashtable.md) +For more info about memory efficiency in Dragonfly see [dashtable doc](/docs/dashtable.md) ## Running the server @@ -65,10 +65,7 @@ Debian/Bullseye, Ubuntu 20.04.4 or later fit these requirements. ### With docker: ```bash -docker pull docker.dragonflydb.io/dragonflydb/dragonfly && \ -docker tag docker.dragonflydb.io/dragonflydb/dragonfly dragonfly - -docker run --network=host --ulimit memlock=-1 --rm dragonfly +docker run --network=host --ulimit memlock=-1 docker.dragonflydb.io/dragonflydb/dragonfly redis-cli PING # redis-cli can be installed with "apt install -y redis-tools" ``` @@ -140,7 +137,7 @@ support order of magnitude higher speeds when replicating. After replication and failover feature we will continue with other Redis commands from APIs 3,4 and 5. -Please see [API readiness doc](doc/api_status.md) for the current status of Dragonfly. +Please see [API readiness doc](docs/api_status.md) for the current status of Dragonfly. ### Milestone - H/A Implement leader/follower replication (PSYNC/REPLICAOF/...). @@ -169,7 +166,7 @@ with millisecond precision (PEXPIRE/PSETEX etc) will be rounded to closest secon Such rounding has less than 0.001% error which I hope is acceptable for large ranges. If it breaks your use-cases - talk to me or open an issue and explain your case. -For more detailed differences between this and Redis implementations [see here](doc/differences.md). +For more detailed differences between this and Redis implementations [see here](docs/differences.md). ### Native Http console and Prometheus compatible metrics By default Dragonfly allows http access via its main TCP port (6379). That's right, you diff --git a/contrib/docker/README.md b/contrib/docker/README.md new file mode 100644 index 000000000..3f0f37e8b --- /dev/null +++ b/contrib/docker/README.md @@ -0,0 +1,61 @@ +

+ + Dragonfly + +

+ + + +# Dragonfly DB with Docker Compose + +This guide will have you up running DragonflyDB with `docker-compose` in just a few minutes. + +| This guide assumes you have `docker` and `docker-compose` installed on your machine. If not, [Install Docker](https://docs.docker.com/get-docker/) and [Install Docker Compose](https://docs.docker.com/compose/install/) before continuing. + +## Step 1 + +```bash +# Download Official Dragonfly DB Docker Compose File +wget https://github.com/dragonflydb/dragonfly/tree/main/contrib/docker/docker-compose.yml + +# Launch the Dragonfly DB Instance +docker-compose up -d + +# Confirm image is up +docker ps | grep dragonfly +# ac94b5ba30a0 docker.dragonflydb.io/dragonflydb/dragonfly "entrypoint.sh drago…" 45 seconds ago Up 31 seconds 0.0.0.0:6379->6379/tcp, :::6379->6379/tcp docker_dragonfly_1 + +# Log follow the dragonfly container +docker logs -f docker_dragonfly_1 +``` + +Dragonfly DB will answer to both `http` and `redis` requests out of the box! + +You can use `redis-cli` to connect to `localhost:6379` or open a browser and visit `http://localhost:6379` + +## Step 2 + +Connect with a redis client. + +From a new terminal: + +```bash +redis-cli +127.0.0.1:6379> set hello world +OK +127.0.0.1:6379> keys * +1) "hello" +127.0.0.1:6379> get hello +"world" +127.0.0.1:6379> +``` + +## Step 3 + +Continue being great and build your app with the power of DragonflyDB! + +### More Build Options +- [Docker Quick Start](/docs/quick-start/) +- [Kubernetes Deployment with Helm Chart](/contrib/charts/dragonfly/) +- [Build From Source](/docs/build-from-source.md) \ No newline at end of file diff --git a/contrib/docker/docker-compose.yml b/contrib/docker/docker-compose.yml new file mode 100644 index 000000000..8f1731e1a --- /dev/null +++ b/contrib/docker/docker-compose.yml @@ -0,0 +1,10 @@ +version: '3.8' +services: + dragonfly: + image: 'docker.dragonflydb.io/dragonflydb/dragonfly' + ports: + - "6379:6379" + volumes: + - dragonflydata:/data +volumes: + dragonflydata: \ No newline at end of file diff --git a/docs/README.md b/docs/README.md new file mode 100644 index 000000000..43a18b637 --- /dev/null +++ b/docs/README.md @@ -0,0 +1,33 @@ +

+ + Dragonfly + +

+ + +# Quick Start + +The easiest way to get started with Dragonfly is with Docker. + +## Deployment Method + +First, choose a deployment method. + +If you are new to Dragonfly, we recommend the [DragonflyDB Docker Quick Start Guide](/docs/quick-start/) + +Other options: + +### - [Docker Compose](/contrib/docker/) + +### - [Helm Chart for Kubernetes](/contrib/charts/dragonfly/) + + +# Learn About DragonflyDB +## [FAQ](/docs/faq.md) + +## [Differences Between DragonflyDB and Redis](/docs/differences.md) + +## [API Command Status](/docs/api_status.md) + + diff --git a/doc/api_status.md b/docs/api_status.md similarity index 100% rename from doc/api_status.md rename to docs/api_status.md diff --git a/doc/bgsave_memusage.svg b/docs/bgsave_memusage.svg similarity index 100% rename from doc/bgsave_memusage.svg rename to docs/bgsave_memusage.svg diff --git a/docs/build-from-source.md b/docs/build-from-source.md new file mode 100644 index 000000000..bcac65c63 --- /dev/null +++ b/docs/build-from-source.md @@ -0,0 +1,66 @@ +# Build DragonflyDB From Source + +## Running the server + +Dragonfly runs on linux. It uses relatively new linux specific [io-uring API](https://github.com/axboe/liburing) +for I/O, hence it requires `Linux verion 5.10` or later. +Debian/Bullseye, `Ubuntu 20.04.4` or later fit these requirements. + +### WARNING: Building from source on older kernels WILL NOT WORK. + +If your host machine does not have at least `Linux verion 5.10` or later, we suggest you choose a [Dockerized Quick Start](/docs/quick-start/). + + +## Step 1 + +```bash +git clone --recursive https://github.com/dragonflydb/dragonfly && cd dragonfly +``` + +## Step 2 +```bash +# Install dependencies +sudo apt install ninja-build libunwind-dev libboost-fiber-dev libssl-dev \ + autoconf-archive libtool cmake g++ +``` + +## Step 3 + +```bash +# Configure the build +./helio/blaze.sh -release + +# Build +cd build-opt && ninja dragonfly + +``` + +## Step 4 +```bash +# Run +./dragonfly --alsologtostderr + +``` + +Dragonfly DB will answer to both `http` and `redis` requests out of the box! + +You can use `redis-cli` to connect to `localhost:6379` or open a browser and visit `http://localhost:6379` + +## Step 5 + +Connect with a redis client + +```bash +redis-cli +127.0.0.1:6379> set hello world +OK +127.0.0.1:6379> keys * +1) "hello" +127.0.0.1:6379> get hello +"world" +127.0.0.1:6379> +``` + +## Step 6 + +Continue being great and build your app with the power of DragonflyDB! \ No newline at end of file diff --git a/doc/dashsegment.svg b/docs/dashsegment.svg similarity index 100% rename from doc/dashsegment.svg rename to docs/dashsegment.svg diff --git a/doc/dashtable.md b/docs/dashtable.md similarity index 100% rename from doc/dashtable.md rename to docs/dashtable.md diff --git a/doc/dashtable.svg b/docs/dashtable.svg similarity index 100% rename from doc/dashtable.svg rename to docs/dashtable.svg diff --git a/doc/db.svg b/docs/db.svg similarity index 100% rename from doc/db.svg rename to docs/db.svg diff --git a/doc/differences.md b/docs/differences.md similarity index 100% rename from doc/differences.md rename to docs/differences.md diff --git a/doc/faq.md b/docs/faq.md similarity index 100% rename from doc/faq.md rename to docs/faq.md diff --git a/doc/memory_bgsave.tsv b/docs/memory_bgsave.tsv similarity index 100% rename from doc/memory_bgsave.tsv rename to docs/memory_bgsave.tsv diff --git a/docs/quick-start/README.md b/docs/quick-start/README.md new file mode 100644 index 000000000..85f21baad --- /dev/null +++ b/docs/quick-start/README.md @@ -0,0 +1,47 @@ +

+ + Dragonfly + +

+ + +# Quick Start + +Starting with `docker run` is the simplest way to get up and running with DragonflyDB. + +If you do not have docker on your machine, [Install Docker](https://docs.docker.com/get-docker/) before continuing. + +## Step 1 + +```bash +docker run --network=host --ulimit memlock=-1 docker.dragonflydb.io/dragonflydb/dragonfly +``` + +Dragonfly DB will answer to both `http` and `redis` requests out of the box! + +You can use `redis-cli` to connect to `localhost:6379` or open a browser and visit `http://localhost:6379` + +## Step 2 + +Connect with a redis client + +```bash +redis-cli +127.0.0.1:6379> set hello world +OK +127.0.0.1:6379> keys * +1) "hello" +127.0.0.1:6379> get hello +"world" +127.0.0.1:6379> +``` + +## Step 3 + +Continue being great and build your app with the power of DragonflyDB! + +### More Build Options +- [Docker Compose Deployment](/contrib/docker/) +- [Kubernetes Deployment with Helm Chart](/contrib/charts/dragonfly/) +- [Build From Source](/docs/build-from-source.md) \ No newline at end of file diff --git a/doc/throughput.svg b/docs/throughput.svg similarity index 100% rename from doc/throughput.svg rename to docs/throughput.svg