Skip to content

Commit 4cd96d9

Browse files
committed
Bump docs for 0.7.3
1 parent d008af0 commit 4cd96d9

Some content is hidden

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

49 files changed

+2645
-0
lines changed
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](all-actions) and [configuration](config).
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 folders are named in the format: `YYYYMMDD-HHMMSS`. On the other hand,
31+
[remote snapshots](#remote-snapshots) are stored in the `data/rsnap` 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 folder (which appears to be a copy of the ks folder); 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/rsnap` 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: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
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 TLS by using your [preferred mode of configuration](config).
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+
:::note
33+
We use the terms `SSL` and `TLS` interchangeably, when what we really mean is TLS.
34+
:::
35+
36+
#### With command-line arguments
37+
38+
Simply start `skyd` with:
39+
40+
```shell
41+
skyd -z cert.pem -k key.pem
42+
```
43+
44+
:::tip Tip
45+
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
46+
:::
47+
48+
:::info Note
49+
To use TLS with the Skytable shell (`skysh`) just run:
50+
51+
```
52+
skysh -C /path/to/cert.pem --port [SSLPORT]
53+
```
54+
55+
and you'll be on a secure connection. Don't forget the SSL port! The skytable daemon binds the secure
56+
listener on a different port when in multi-socket mode.
57+
:::
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
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 on GitHub](https://github.com/martinmolin/skytable-dotnet)
13+
- [JavaScript/TypeScript driver (node)](https://www.npmjs.com/package/skytable.js) [MIT-License] - Source code can be found [here on GitHub](https://github.com/zhangyuannie/skytable.js)
14+
15+
:::info More lanugages
16+
The team is always looking to support more languages and we wish we could ship more drivers. But due to limited
17+
resources we haven't been able to. If you're willing to write a driver (it's super easy to), jump into the
18+
[Skytable discord server](https://discord.gg/QptWFdx) and a maintainer/moderator will help you out!
19+
:::
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: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
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 [in your configuration](config).
14+
:::note
15+
Make sure you change the maximum number of connections according to the available system resources to avoid DoS
16+
like attacks 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 disabling terminal artwork)
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
---
2+
id: building-from-source
3+
title: Building from source
4+
---
5+
6+
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.
7+
8+
### Step 1: Install pre-requisites
9+
10+
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.
11+
12+
Besides, the TLS/SSL components are written in C (OpenSSL) — so you'll need to install:
13+
14+
- A C compiler for your platform
15+
- GNU Make (`make`)
16+
- Perl
17+
18+
### Step 2: Clone the tag
19+
20+
Run this from your terminal:
21+
22+
```
23+
git clone --branch v0.7.3 https://github.com/skytable/skytable.git
24+
```
25+
26+
:::tip Bonus tip
27+
If you want to avoid downloading all the version history, run this instead:
28+
29+
```
30+
git clone --depth 1 --branch v0.7.3 https://github.com/skytable/skytable.git
31+
```
32+
33+
:::
34+
35+
### Step 3: Build it!
36+
37+
Expecting that you're still in the same directory, run:
38+
39+
```
40+
cd skybase && cargo build --release
41+
```
42+
43+
:::note
44+
This will take **crazy long** at times, so hold on until Cargo finishes building things
45+
:::
46+
47+
### Step 4: Get the binaries
48+
49+
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!
50+
51+
### Step 5: Run it!
52+
53+
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: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
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.7.3) and download a version for your platform.
13+
14+
:::tip Tip
15+
If you're on Debian, consider downloading an appropriate `.deb` (Debian Package) file for your machine.
16+
The package will install `skyd`, `skysh`, `sky-bench` and `sky-migrate` on your system while also
17+
configuring a `systemd` service unit.
18+
:::
19+
20+
### Step 2: Make the files runnable
21+
22+
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.
23+
24+
### Step 3: Start the database server
25+
26+
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!
27+
28+
### Step 4: Run the shell `skysh`
29+
30+
`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!_.
31+
32+
You're done with setting up `skyd` 🎉!
33+
34+
## Get started with Docker
35+
36+
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!
37+
38+
:::note
39+
You may need superuser privileges for installation and running the commands below
40+
:::
41+
42+
### Step 0: Create and start the container
43+
44+
We'll create a container where:
45+
46+
1. We'll call our container `mysky`
47+
2. We'll expose port 2003 of the container
48+
3. We'll save all our data on the host in a folder called `skytable` relative to the current directory. To achieve this, we'll make use of Docker volumes.
49+
50+
Open up a terminal and run:
51+
52+
```sh
53+
docker run --name mysky \
54+
-v ./skytable:/var/lib/skytable \
55+
-p 2003:2003 \
56+
skytable/sdb:v0.7.3
57+
```
58+
59+
### Step 1: Download and setup the bundle
60+
61+
Follow the [instructions above](#get-started-with-bundles) so that you're ready to run `skysh`
62+
63+
### Step 2: Connect to the instance
64+
65+
Simply run:
66+
67+
```sh
68+
skysh -h 127.0.0.1 -p 2003
69+
```
70+
71+
Now, you're all set!

0 commit comments

Comments
 (0)