Skip to content
This repository was archived by the owner on Jul 11, 2021. It is now read-only.

Commit 7c6c129

Browse files
author
Simone Mosciatti
committed
add documentation version 4
1 parent a37c4fe commit 7c6c129

File tree

5 files changed

+260
-33
lines changed

5 files changed

+260
-33
lines changed

doc/docs/index.md

Lines changed: 35 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,31 @@
22

33
[RediSQL][github] is a Redis module that embeds a fully functional SQLite database.
44

5-
At the best of our knowledge is the only system that provides SQL capabilities while being very fast so to be used as cache, simple to integrate with any programming language, since it can be used by every redis client, and with very very low maintenance.
5+
At the best of our knowledge is the only system that provides SQL capabilities while being very fast so to be used as a cache, simple to integrate with any programming language, since it can be used by every redis client, and with very very low maintenance.
66

7-
Moreover, for small, not critical services, it can also be used as main database, it can store data not only in memory but also on file and it can also use the same persistency mechanisms of redis itself.
7+
Moreover, for small, not critical services, it can also be used as the main database, it can store data not only in memory but also on file and it can also use the same persistence mechanisms of redis itself.
88

9-
## Motivation
9+
## Obtain
1010

11-
The main motivation behind the project is to provide a quick and hands-off environment to store structured data.
11+
There are **two version** of the software, a "community", completely open source version and a PRO version that comes with **more features and support plan.**
1212

13-
It also turns out that RediSQL is a great way to cache your content and data in a more structured way.
13+
Both versions can be [**obtained in the store.**][store]
1414

15-
Anyway, the main history and motivation of the project are explained [in this page.][motivations]
15+
For the community version, you can just download it, we ask for a small donation if you can support the project but feel free to just input 0€ and download it.
1616

17-
## Sustainable Open Source
17+
For the PRO version you need to [**sign up here**][signup], after you signed up you will be able to download the software.
1818

19-
The project is based on the idea of sustainable Open Source.
19+
A detailed coverage of the PRO version [is provided here][pro]
2020

21-
The project provides two versions, an open source one, which is enough for most simple projects, and a PRO version that provides features required from companies and enterprises.
21+
The motivations of why we decided to sell a PRO version and about its price are [here][pro_motivations] and we hope that you agree on our points.
22+
23+
## Motivation
24+
25+
The main motivation behind the project is to provide a quick and hands-off environment to store structured data.
26+
27+
It also turns out that RediSQL is a great way to cache your content and data in a more structured way.
28+
29+
The main history and motivation of the project are explained [in this page.][motivations]
2230

2331
# Overview
2432

@@ -53,18 +61,18 @@ The phase of compilation can be quite expensive, but if you always execute the s
5361

5462
When you use [`REDISQL.CREATE_STATEMENT`][r:create_statement] your statement is compiled, then when you execute it using [`REDISQL.EXEC_STATEMENT`][r:exec_statement] it is not re-compiled but we use the pre-compiled one. It seems a trivial change but it will really speed up some workload.
5563

56-
Statements can also be used as an interface for different application using the same RediSQL instance.
64+
Statements can also be used as an interface for different applications using the same RediSQL instance.
5765

58-
Once you define the interface of the statement and its behavior, then you are free to change it's implementation while maintaining all the legacy code working.
66+
Once you define the interface of the statement and its behaviour, then you are free to change it's implementation while maintaining all the legacy code working.
5967
This is quite useful especially if you have several services using the same RediSQL instance.
6068

6169
## Query
6270

63-
In most databases there are statements that modify the data and queries that simply reads.
71+
In most databases there are statements that modify the data and queries that simply read.
6472

65-
Of course, just reading, is usually a faster and simpler operation than modify the data. In order to take advantages of this we provide a different command `REDISQL.QUERY` and `REDISQL.QUERY_STATEMENT` that constraint you to don't modify the data.
73+
Of course, just reading, is usually a faster and simpler operation than modify the data. In order to take advantages of this, we provide a different command [`REDISQL.QUERY`][r:query] and [`REDISQL.QUERY_STATEMENT`][r:query_statement] that constraint you to don't modify the data.
6674

67-
This commands allow you to have slaves serves query and to balance some load off the master node for better speed and reliability.
75+
These commands allow you to have slaves/replicas serves query and to balance some load off the master node for better speed and reliability.
6876

6977
# Persistency
7078

@@ -80,26 +88,34 @@ When Redis starts to save the RDB file the status of the database get serialized
8088

8189
AOF replication is provided only in the PRO edition.
8290

83-
All the commands are replicated, but the read only ones.
91+
All the commands are replicated, but the read-only ones.
8492

85-
With AOF replication you also get instance replication that allows replicating the same dataset into different Redis instances in a master slave fashion.
93+
With AOF replication you also get instance replication that allows replicating the same dataset into different Redis instances in a master/slave fashion.
8694

8795
# PRO
8896

89-
The PRO edition is based on the Open Source one, however it provides one more class of commands that are necessary for bussinesses or where rediSQL is a critical piece of the infrastructure.
97+
The PRO edition is based on the Open Source one, however, it provides one more class of commands that are necessary for business or where rediSQL is a critical piece of the infrastructure.
9098

9199
Every command, but `REDISQL.CREATE_DB`, blocks the clients and it is executed in the background by a different thread.
92100

93-
With the PRO edition we also provide the `.NOW` commands that are executed immediately without blocking the client.
101+
With the PRO version, we also provide the `.NOW` commands that are executed immediately without blocking the client.
94102

95-
Basically every command in the PRO version provides the `.NOW` variant, but please refer to the [reference][ref].
103+
Every command in the PRO version provides the `.NOW` variant, but please refer to the [reference][ref].
96104

97105
Moreover, the PRO version also provides AOF replication, that, indeed, necessitate of commands that don't block the clients.
98106

107+
More information about the PRO version are available [here.][pro]
108+
99109
[github]: https://github.com/RedBeardLab/rediSQL
100110
[ref]: references.md
101111
[r:create_db]: references.md#redisqlcreate_db
102112
[r:exec]: references.md#redisqlexec
103113
[r:create_statement]: references.md#redisqlcreate_statement
104114
[r:exec_statement]: references.md#redisqlexec_statement
115+
[r:query]: references.md#redisqlquery
116+
[r:query_statement]: references.md#redisqlquery_statement
105117
[motivations]: motivations.md
118+
[store]: https://plasso.com/s/epp4GbsJdp-redisql
119+
[signup]: https://plasso.com/s/epp4GbsJdp-redisql/signup/
120+
[pro]: pro.md
121+
[pro_motivations]: pro_motivations.md

doc/docs/pro.md

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
# RediSQL PRO
2+
3+
This document explains the architecture and principle of working of RediSQL PRO.
4+
5+
You can purchase RediSQL PRO, along with support [**here.**][signup]
6+
7+
Motivation and details about the cost are [described here][pro_motivations].
8+
9+
## Main difference
10+
11+
The PRO version offers two main features: **non blocking command** and **replication**
12+
13+
### Non-blocking command
14+
15+
Most command in RediSQL, all but `REDISQL.CREATE_DB`, are blocking command.
16+
17+
This means that Redis block the client, pass the command to a background thread that actually executed it and finally the result is returned to client unblocking it.
18+
19+
This works great in most cases, the main thread of Redis is free of doing other work (like answering standard redis command), there is no difference from the client point of view and your machine can use more than the single thread of redis to work for you.
20+
21+
However, sometimes you want to have non-blocking commands.
22+
23+
The blocking command will be executed in the main redis thread, this means that no other works will be done by Redis while executing your command.
24+
25+
We could expect the non-blocking command to be slightly faster (smaller latency) than the blocking one since there is no need for coordination between threads.
26+
27+
Finally, non-blocking commands are necessary for replication.
28+
29+
Non-blocking commands are invoke adding the `.NOW` suffix.
30+
31+
As an example, instead of `REDISQL.EXEC` that is a blocking command you can use `REDISQL.EXEC.NOW` to use the non-blocking version.
32+
33+
#### When to use non-blocking commands
34+
35+
Non-blocking command takes the priority over blocking one.
36+
37+
Said so, generally, we are expecting users to use mostly the blocking commands.
38+
39+
However, if you need a very quick insert or a very quick lookup, then you should use the non-blocking version.
40+
41+
It is a bad idea to use non blocking commands for slow statements/query.
42+
43+
This because while you are executing a non-blocking command the main redis thread cannot do anything else, this means it cannot answer other redis commands.
44+
45+
### Replication
46+
47+
Redis offers two main methods for persisting data on disk so that in case of power failure of disastrous failure your data are reasonably safe.
48+
49+
RediSQL implement RDB persistency on the community version and AOF replication on the PRO version.
50+
51+
For the details of this two method, I suggest to read the Redis Documentation [on this page][redis_persistence].
52+
53+
The mechanism behind AOF replication is exactly the same behind cluster replication used by redis. The same **bytes** used for AOF replication are also used for cluster replication, just send over different sockets.
54+
55+
For details about cluster replication you can consult the official Redis Documentation on [cluster][redis_cluster] and on [replication][redis_replication]
56+
57+
The PRO version, indeed, implements both AOF and cluster replication.
58+
59+
#### Effective use of Replication
60+
61+
In order to use replication effectively, you should understand a few simple concepts.
62+
63+
If a command is replicated it means that it could be re-executed.
64+
65+
It is **vital** to replicate commands that change the data you are storing, however, is pointless and wasteful to replicate commands that do not apply any change to the data.
66+
67+
You definitely want to replicate every INSERTs, UPDATEs or DELETEs while you should avoid replicating SELECTs.
68+
69+
Replicated commands are usually executed either when you are re-loading your dataset after some sort of failures or in slaves/replica with a train of other replicated commands is coming right after.
70+
71+
Consider what happens if you replicate a big SELECT. RediSQL is going to execute it and it is going to take some time, this while your application is waiting for redis to restart or when a train of replicated commands are piling up in the slaves/replicas buffers. And all this just for discard the result of the SELECT itself.
72+
73+
In order to avoid this effect is a good idea to use the query commands whenever possible ([`REDISQL.QUERY`][query] and [`REDISQL.QUERY_STATEMENT`][query_statement]), this command **do not** replicate and are marked as `readonly` which means that can be executed also on slaves/replicas providing interesting primitives of load balancing. (Eg. You could write on the master and read on the slaves.)
74+
75+
[query]: references.md#redisqlquery
76+
[query_statement]: references.md#redisqlquery_statement
77+
[pro_motivations]: pro_motivations.md
78+
[redis_persistence]: https://redis.io/topics/persistence
79+
[signup]: https://plasso.com/s/epp4GbsJdp-redisql/signup/
80+
[redis_cluster]: https://redis.io/topics/cluster-tutorial
81+
[redis_replication]: https://redis.io/topics/replication

doc/docs/pro_motivations.md

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# RediSQL PRO Motivation
2+
3+
This document explains why we decide to offer a commercial PRO version alongside the free and open source community version.
4+
5+
## tl;dr;
6+
7+
* We sell a PRO version to make the project sustainable.
8+
* You can buy the PRO version [**here.**][signup]
9+
* We offer custom license term if your company need one.
10+
11+
## Necessity to make the project sustainable
12+
13+
We believe that in order to provide the most value Open Source should be sustainable.
14+
15+
Design, implementation and testing are all necessary and valuable steps of any software project, but they do require time.
16+
17+
Open sources projects that are able to really deliver value need to find a way to remunerate the time of their maintainers.
18+
19+
Some successful open source projects are backed by companies (Firefox, React, etc...), other sell supports (mongodb, vernemq, etc...) and other plug their software into a commercial offer (npm, docker, elatic, etc...).
20+
21+
## Our approach
22+
23+
In order to provide a open source, our approach is to offer two different product, a completely free open source one and a PRO version.
24+
25+
Selling the PRO version allows us to dedicate most of the time to the project, having a good work-life balance, enjoy time with our girlfriends, wives or kids and being productive developers and technical writers.
26+
27+
## Benefits for organizations and for the community
28+
29+
Moreover, we believe that this is the best way to serve our users and the community.
30+
31+
Indeed, we are able to maintain the project through the years so that any company or organization that decide to use our product will know that in 3/4/5 years we will still be there to help them if any problem should arise.
32+
33+
On top of this also single programmers, very small start-ups or small companies will benefit from us keeping maintaining the product in its two form, community and pro.
34+
35+
You can support us and buy the commercial version of this product [on this web page.][signup]
36+
37+
We also offer **custom license terms** if your organization needs one.
38+
39+
## About the cost
40+
41+
We set up the cost (€990 / year) to make it a bargain for every company that actually uses it.
42+
43+
Considering the amount of time necessary to replicate the PRO features:
44+
45+
1. Understand the working principle of Redis
46+
2. Understand SQLite and how to leverage it
47+
3. Understand the Redis Module API
48+
4. Design the product
49+
5. Implement it
50+
6. Test it
51+
7. Document it
52+
8. Maintain it
53+
54+
Multiply it by the hourly rate of a software engineer (~100 €/hours).
55+
56+
It is clear that after a little more than a single day of work our product will be a net positive for your organization.
57+
58+
Moreover, the PRO version comes with **support plan** to help you extract the most value out of the product.
59+
60+
Finally, we offer custom, business-friendly licenses if your business or lawyers need them.
61+
62+
[signup]: https://plasso.com/s/epp4GbsJdp-redisql/signup/

0 commit comments

Comments
 (0)