Skip to content

Commit 1fbb52d

Browse files
committed
Add docs for v0.7.0
1 parent 0761727 commit 1fbb52d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+2047
-2
lines changed

docs/2.getting-started.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ In the directory where you extracted the files, run `./skyd` on \*nix systems or
2222
### Step 4: Run the shell `skysh`
2323

2424
`skysh` is the shell that is shipped with the bundle. Run it, just like you did with the database server. Now enter commands in the shell, and have fun! First run `HEYA` to check if everything is fine - the server should reply with _HEY!_.
25-
See all the available actions [here](actions-overview).
2625

2726
You're done with setting up `skyd` 🎉!
2827

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
id: index
3+
title: Introduction
4+
sidebar_label: Home
5+
slug: /
6+
---
7+
8+
Welcome to Skytable's docs! You will find information about how you can get started with Skytable, installation options, configuration and clients.
9+
10+
## Users
11+
12+
We have an easy-to-follow guide for [Getting Started](getting-started). Once you've got everything up and running, you can take a look at the available actions [here](actions-overview) and [configuration files](config-files).
13+
Once you've learned the basics, start using a [client driver](clients)!
14+
15+
## Developers
16+
17+
You can find information on how to build your own clients [here](protocol/skyhash). The primary idea is to implement the Skyhash Protocol.
18+
19+
## Contributing
20+
21+
If you find any typos, mistakes or any other scope of improvement - please don't hesitate to bring it up [here](https://github.com/skytable/docs/issues). Thank you ❤️!
22+
23+
## License
24+
25+
The documentation is licensed under the [CC-BY-SA-4.0 License](https://github.com/skytable/docs/tree/master/LICENSE)
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
---
2+
id: snapshots
3+
title: Snapshots
4+
---
5+
6+
Skytable supports automated snapshots that can be used for periodic backups.
7+
Skytable's snapshotting system is dead simple and works in a similar way to [BGSAVE](persistence).
8+
9+
## Enabling snapshots
10+
11+
Snapshots aren't enabled by default — you have to enable them by using the configuration file or [command line arguments](config-cmd). To your existing configuration file, just add the following block:
12+
13+
```toml
14+
[snapshot]
15+
every = 3600
16+
atmost = 4
17+
failsafe = true # optional
18+
```
19+
20+
Here's what these values mean:
21+
22+
- `every` - Number of seconds to wait before creating another snapshot
23+
- `atmost` - The maximum number of snapshots to keep
24+
- `failsafe` - This indicates whether the database should stop accepting write operations if
25+
snapshotting fails
26+
27+
## Storage of snapshots
28+
29+
All the created snapshots are stored in a `data/snaps` folder in the current directory.
30+
The snapshot files are named in the format: `YYYYMMDD-HHMMSS.snapshot`. On the other hand,
31+
[remote snapshots](#remote-snapshots) are stored in the `data/snaps/remote` folder.
32+
33+
## How snapshots work
34+
35+
As mentioned earlier, snapshots work just like `BGSAVE`. A task is spawned that starts encoding
36+
(and writing data) to a file; once all the data is successfully flushed to disk, the task exits.
37+
38+
## Methods of creating snapshots
39+
40+
Snapshots can be created automatically by using the configuration file. However, if you want to create snapshots remotely, you can use the [ `MKSNAP` ](actions/mksnap) action. This will only
41+
create snapshots if it is enabled on the server-side, unless you use
42+
[truly remote snapshots](#remote-snapshots).
43+
44+
## Remote snapshots
45+
46+
Irrespective of whether snapshots are enabled on the server side, you can use _truly remote snapshots_.
47+
Such snapshots can be created by using the [`MKSNAP`](actions/mksnap) action. To do this,
48+
pass a second argument to `MKSNAP` with the desired name of your snapshot. This will create
49+
a snapshot in the `data/snaps/remote` directory.
50+
51+
:::tip
52+
Since snapshots are intended for data backups — you can do a little _trick_ to make these
53+
backups offsite-backups: mount a network file system or a different drive and create a folder
54+
for storing your snapshots in it. Now, symlink the `data/snaps` directory to your
55+
_remotely mounted directory_. You now have offsite backups!
56+
:::
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
---
2+
id: ssl
3+
title: TLS configuration
4+
---
5+
6+
Skytable lets you secure connections with TLS. This feature is built into Sky with OpenSSL and doesn't require you to have OpenSSL installed. You can enable SSL by using the [configuration file](#with-config-files) or by using [command-line arguments](#with-command-line-arguments).
7+
8+
### Step 1: Create a self-signed certificate and private key
9+
10+
This is outside the scope of this document, but you can read [this guide on Stackoverflow](https://stackoverflow.com/a/10176685) to get a brief idea of creating one.
11+
12+
### Step 2: Add it to your configuration and launch
13+
14+
#### With config files
15+
16+
Add the following block:
17+
18+
```toml
19+
[ssl]
20+
key = "/path/to/keyfile.pem"
21+
chain = "/path/to/chain.pem"
22+
port = 2004
23+
only = true
24+
```
25+
26+
The above block is self-explanatory; you just have to add the paths to the private key and certificate files and add the port (if required).
27+
28+
By setting `only` to `true`, the server will only accept accept secure connections. In other cases,
29+
the server listens to two ports: `2003` and `2004`, a non-TLS port and a TLS port (similar to port
30+
80 and port 443 in HTTP/HTTPS). As expected, you can configure this port number to suit your needs.
31+
32+
#### With command-line arguments
33+
34+
Simply start `skyd` with:
35+
36+
```shell
37+
skyd -z cert.pem -k key.pem
38+
```
39+
40+
:::tip Tip
41+
You can pass the `--sslonly` flag to force the server to only accept secure connections, disabling the non-SSL interface. When this flag is not passed, and other SSL options are given — the server listens to both SSL and non-SSL requests
42+
:::
43+
44+
:::info Note
45+
To use TLS with the Skytable shell (`skysh`) just run:
46+
47+
```
48+
skysh -C /path/to/cert.pem --port [SSLPORT]
49+
```
50+
51+
and you'll be on a secure connection. Don't forget the SSL port! The skytable daemon binds the secure
52+
listener on a different port when in multi-socket mode.
53+
:::
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
id: clients
3+
title: Client drivers
4+
---
5+
6+
We officially maintain the following drivers:
7+
8+
- [Rust driver](https://github.com/skytable/client-rust) [Apache-2.0] - Always up to date and is used by the core project itself
9+
10+
Community powered drivers:
11+
12+
- [C# driver](https://www.nuget.org/packages/Skytable.Client/) [Apache-2.0] - Source code can be found [here](https://github.com/martinmolin/skytable-dotnet)
13+
14+
:::info More lanugages
15+
The team is always looking to support more languages and we wish we could ship more drivers. But due to limited
16+
resources we haven't been able to. If you're willing to write a driver (it's super easy to), jump into the
17+
[Skytable discord server](https://discord.gg/QptWFdx) and a maintainer/moderator will help you out!
18+
:::
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
id: perf-guide
3+
title: Performance Guide
4+
---
5+
6+
We have put in our best efforts to make Skytable really fast — but usage patterns can greatly
7+
affect how well Skytable performs for you, and how well you are able to exploit the _on metal_
8+
performance that Skytable can provide. Here are some quick pointers to get maximum performance:
9+
10+
- **Try to have a lesser number of tables**
11+
12+
The number of tables you can create is virtually
13+
unlimited, but however, creating a huge number of tables (say over 60,000) _can_ hurt performance.
14+
15+
- **Try to use default connection level containers**
16+
17+
Although you are free to run actions by
18+
specifying the table to use, it has a runtime cost because the table has to be looked up and errors
19+
need to be handled. Instead, try using default containers wherever possible. For example, if you
20+
have a table `cakes` in a keyspace `birthday` and your application will be using this table for
21+
the most part, it's a good idea to run `use birthday:cakes` after connecting and then using the
22+
actions without specifying a table (or keyspace). This avoids the lookup and error handling cost.
23+
24+
- If you know your data in keymap tables has valid unicode, try using the `binstr` type instead.
25+
This is because unicode validation adds a _very small_ runtime cost
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
id: benchmarking
3+
title: Benchmarking
4+
---
5+
6+
Who doesn't like speed and as a consequence, benchmarks? So here's a guide on benchmarking Skytable with our tool `sky-bench` .
7+
8+
## Step 0: Getting the benchmarking tool
9+
10+
You'll need to download a bundle from the [releases page](https://github.com/skytable/skytable/releases/v0.6.3) and unzip it. In the following steps we'll assume that you have unzipped the archive and you're in that directory.
11+
12+
## Step 1: Starting the database server
13+
14+
Open a terminal in the current directory and [set executable permissions](getting-started#step-2-make-the-files-runnable). Now start the server by running `./skyd` (or just `skyd` on Windows).
15+
16+
## Step 2: Run the benchmark tool
17+
18+
Open another terminal in the current directory and then run `sky-bench` with no arguments if you want to use the default options, or run `sky-bench --help` to see available configuration options. Hold tight, you'll know when it happens 🚀.
19+
20+
:::tip Tip
21+
**JSON Output**
22+
If you're a bit nerdy, we know it — you'll like some structured data. Well, all you need to do is: run `sky-bench --json` for JSON output!
23+
:::
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
id: deployment-notes
3+
title: Deployment notes
4+
---
5+
6+
Here are some _good to know_ things about deploying Skytable:
7+
8+
- Skytable is under active development. If you do find any rough edges, [please open an issue](https://github.com/skytable/skytable/issues)
9+
- The daemon will create a `.sky_pid` file in its working directory which functions as a PID file
10+
and indicates other processes to not use the data directory. If the daemon is somehow forcefully
11+
stopped, the file may not be removed. In that case, you should manually remove the file
12+
- Skytable currently has a default limit of 50000 connections on a single daemon instance. This limit
13+
can be modified by setting the `maxcon` in the [configuration file](config-files).
14+
:::note
15+
Make sure you change `maxcon` according to the available system resources to avoid DoS like attacks
16+
that may cause your system to crash
17+
:::
18+
- Skytable is inherently multithreaded. As of now, there is no way to stop Skytable from using
19+
multiple threads
20+
- The best way to deploy Skytable is as a service (and passing `--noart` to avoid terminal artwork
21+
in logs)
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
id: building-from-source
3+
title: Building from source
4+
---
5+
Of course you can build it from source — but with quite a bit of hassle. The database server is a bit fussy with its builds, so you'll need quite a few tools before you can actually start using it.
6+
7+
### Step 1: Install pre-requisites
8+
As Skytable is written in Rust, you'll have to install the Rust toolchain to build it (a little messy, but not too messy). Go to [this page](https://rustup.rs/) to set up Rust on your local machine.
9+
10+
Besides, the TLS/SSL components are written in C (OpenSSL) — so you'll need to install:
11+
* A C compiler for your platform
12+
* GNU Make (`make`)
13+
* Perl
14+
15+
### Step 2: Clone the tag
16+
Run this from your terminal:
17+
```
18+
git clone --branch v0.6.3 https://github.com/skytable/skytable.git
19+
```
20+
:::tip Bonus tip
21+
If you want to avoid downloading all the version history, run this instead:
22+
```
23+
git clone --depth 1 --branch v0.6.3 https://github.com/skytable/skytable.git
24+
```
25+
:::
26+
### Step 3: Build it!
27+
Expecting that you're still in the same directory, run:
28+
```
29+
cd skybase && cargo build --release
30+
```
31+
:::note
32+
This will take **crazy long** at times, so hold on until Cargo finishes building things
33+
:::
34+
35+
### Step 4: Get the binaries
36+
You'll need to copy `skyd` and `skysh` (or `skyd.exe` and `skysh.exe` if on Windows) from the `skybase/target/release` folder. Be sure to copy these **exact files** and not something else!
37+
### Step 5: Run it!
38+
Now start the database server by running `./skyd` and then start the interactive shell by running `./skysh`. You're ready to use the [actions](actions-overview)!
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
---
2+
id: getting-started
3+
title: Getting Started
4+
---
5+
6+
Getting started with Skytable is easy 😊 (and fun!). You can get started with [native binaries (recommended)](#get-started-with-bundles) or by using the [docker image](#get-started-with-docker).
7+
8+
## Get started with bundles
9+
10+
### Step 1: Download a bundle
11+
12+
Head over to this [page](https://github.com/skytable/skytable/releases/v0.6.3) and download a version for your platform.
13+
14+
### Step 2: Make the files runnable
15+
16+
Unzip the `zip` file that you just downloaded. If you're on a \*nix system, run `chmod +x skyd skysh` to make the files executable. If you're on Windows, right-click the files and then check the `UNBLOCK` checkbox and click on the `APPLY` button.
17+
18+
### Step 3: Start the database server
19+
20+
In the directory where you extracted the files, run `./skyd` on \*nix systems or simply `skyd` on Windows systems. That's all there is to starting the database server!
21+
22+
### Step 4: Run the shell `skysh`
23+
24+
`skysh` is the shell that is shipped with the bundle. Run it, just like you did with the database server. Now enter commands in the shell, and have fun! First run `HEYA` to check if everything is fine - the server should reply with _HEY!_.
25+
26+
You're done with setting up `skyd` 🎉!
27+
28+
## Get started with Docker
29+
30+
First of all, you need to have Docker installed and available on your `PATH` ; you can read the official guide [here](https://docs.docker.com/get-docker/). Once you've got Docker up and running, follow the steps!
31+
32+
### Step 0: Create a container
33+
34+
Open up a terminal and run:
35+
36+
```
37+
docker create skytable/sdb:v0.6.3 --name skyvm
38+
```
39+
40+
:::note
41+
You may need superuser privileges
42+
:::
43+
At the same time, you'll need to set up the bundle by following [Step 1](#step-1-download-a-bundle) and [Step 2](#step-2-make-the-files-runnable) from the previous section.
44+
45+
### Step 1: Start the container
46+
47+
Now run:
48+
49+
```
50+
docker start skyvm
51+
```
52+
53+
:::note
54+
You may need superuser privileges
55+
:::
56+
57+
### Step 2: Find the IP address of the container
58+
59+
In order to connect to the container (which, to `skysh` is nothing but a remote server), you'll have to run:
60+
61+
```shell
62+
docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' skyvm
63+
```
64+
65+
:::note
66+
You may need superuser privileges
67+
:::
68+
And you'll get a result like:
69+
70+
```text
71+
172.17.0.1
72+
```
73+
74+
### Step 3: Start the command line client
75+
76+
Open up a terminal in the directory where you downloaded the command line client and run:
77+
78+
```shell
79+
skysh -h 172.17.0.1
80+
```
81+
82+
And you're done!

0 commit comments

Comments
 (0)