You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+97-40Lines changed: 97 additions & 40 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,16 +21,13 @@ See [Docker](#docker) and [Sample Code](#sample-code) sections to get started!
21
21
* Supports atomic operations,
22
22
* Supports [distributed queries](#query) on keys,
23
23
* Provides a plugin interface for service discovery daemons,
24
-
* Provides a locking primitive which inspired by [SETNX of Redis](https://redis.io/commands/setnx#design-pattern-locking-with-codesetnxcode).
24
+
* Provides a locking primitive which inspired by [SETNX of Redis](https://redis.io/commands/setnx#design-pattern-locking-with-codesetnxcode),
25
+
* Supports [distributed topic](#distributed-topic) data structure,
25
26
26
27
## Possible Use Cases
27
28
28
-
With this feature set, Olric is suitable to use as a distributed cache. But it also provides data replication, failure detection
29
-
and simple anti-entropy services. So it can be used as an ordinary key/value data store to scale your cloud application.
30
-
31
-
## Project Status
32
-
33
-
Olric is in early stages of development. The package API and client protocol may change without notification.
29
+
With this feature set, Olric is suitable to use as a distributed cache. But it also provides distributed topics, data replication,
30
+
failure detection and simple anti-entropy services. So it can be used as an ordinary key/value data store to scale your cloud application.
34
31
35
32
## Table of Contents
36
33
@@ -49,28 +46,34 @@ Olric is in early stages of development. The package API and client protocol may
49
46
*[olric-stats](#olric-stats)
50
47
*[olric-load](#olric-load)
51
48
*[Usage](#usage)
52
-
*[Put](#put)
53
-
*[PutIf](#putif)
54
-
*[PutEx](#putex)
55
-
*[PutIfEx](#putifex)
56
-
*[Get](#get)
57
-
*[Expire](#expire)
58
-
*[Delete](#delete)
59
-
*[LockWithTimeout](#lockwithtimeout)
60
-
*[Lock](#lock)
61
-
*[Unlock](#unlock)
62
-
*[Destroy](#destroy)
63
-
*[Stats](#stats)
64
-
*[Ping](#ping)
65
-
*[Query](#query)
66
-
*[Cursor](#cursor)
67
-
*[Range](#range)
68
-
*[Close](#close)
69
-
*[Atomic Operations](#atomic-operations)
70
-
*[Incr](#incr)
71
-
*[Decr](#decr)
72
-
*[GetPut](#getput)
73
-
*[Pipelining](#pipelining)
49
+
*[Distributed Map](#distributed-map)
50
+
*[Put](#put)
51
+
*[PutIf](#putif)
52
+
*[PutEx](#putex)
53
+
*[PutIfEx](#putifex)
54
+
*[Get](#get)
55
+
*[Expire](#expire)
56
+
*[Delete](#delete)
57
+
*[LockWithTimeout](#lockwithtimeout)
58
+
*[Lock](#lock)
59
+
*[Unlock](#unlock)
60
+
*[Destroy](#destroy)
61
+
*[Stats](#stats)
62
+
*[Ping](#ping)
63
+
*[Query](#query)
64
+
*[Cursor](#cursor)
65
+
*[Range](#range)
66
+
*[Close](#close)
67
+
*[Atomic Operations](#atomic-operations)
68
+
*[Incr](#incr)
69
+
*[Decr](#decr)
70
+
*[GetPut](#getput)
71
+
*[Pipelining](#pipelining)
72
+
*[Distributed Topic](#distributed-topic)
73
+
*[Publish](#publish)
74
+
*[AddListener](#addlistener)
75
+
*[RemoveListener](#removelistener)
76
+
*[Destroy](#destroy)
74
77
*[Serialization](#serialization)
75
78
*[Golang Client](#golang-client)
76
79
*[Configuration](#configuration)
@@ -121,7 +124,8 @@ Olric is in early stages of development. The package API and client protocol may
121
124
* Provides a plugin interface for service discovery daemons and cloud providers,
122
125
* Provides a command-line-interface to access the cluster directly from the terminal,
123
126
* Supports different serialization formats. Gob, JSON and MessagePack are supported out of the box,
124
-
* Provides a locking primitive which inspired by [SETNX of Redis](https://redis.io/commands/setnx#design-pattern-locking-with-codesetnxcode).
127
+
* Provides a locking primitive which inspired by [SETNX of Redis](https://redis.io/commands/setnx#design-pattern-locking-with-codesetnxcode),
128
+
* Supports [distributed topic](#distributed-topic) data structure,
125
129
126
130
See [Architecture](#architecture) section to see details.
127
131
@@ -130,7 +134,6 @@ See [Architecture](#architecture) section to see details.
130
134
* Distributed queries over keys and values,
131
135
* Database backend for persistence,
132
136
* Anti-entropy system to repair inconsistencies in DMaps,
133
-
* Publish/Subscribe for messaging,
134
137
* Eviction listeners by using Publish/Subscribe,
135
138
* Memcached interface,
136
139
* Client implementations for different languages: Java, Python and JavaScript,
@@ -428,15 +431,6 @@ When you call **Start** method, your process joins the cluster and will be respo
428
431
indefinitely. So you may need to run it in a goroutine. Of course, this is just a single-node instance, because you didn't give any
429
432
configuration.
430
433
431
-
Create a **DMap** object to access the cluster:
432
-
433
-
```go
434
-
dm, err:= db.NewDMap("my-dmap")
435
-
```
436
-
437
-
DMap object has *Put*, *PutEx*, *PutIf*, *PutIfEx*, *Get*, *Delete*, *Expire*, *LockWithTimeout* and *Destroy* methods to access
438
-
and modify data in Olric. We may add more methods for finer control but first, I'm willing to stabilize this set of features.
439
-
440
434
When you want to leave the cluster, just need to call **Shutdown** method:
441
435
442
436
```go
@@ -447,6 +441,14 @@ This will stop background tasks and servers. Finally purges in-memory data and q
447
441
448
442
***Please note that this section aims to document DMap API in embedded member mode.*** If you prefer to use Olric in
449
443
Client-Server mode, please jump to [Golang Client](#golang-client) section.
444
+
445
+
### Distributed Map
446
+
447
+
Create a **DMap** instance:
448
+
449
+
```go
450
+
dm, err:= db.NewDMap("my-dmap")
451
+
```
450
452
451
453
### Put
452
454
@@ -797,6 +799,61 @@ There is no hard-limit on message count in a pipeline. You should set a convenie
797
799
798
800
The `Flush` method returns errors along with success messages. Furthermore, you need to know the command order for matching responses with requests.
799
801
802
+
### Distributed Topic
803
+
804
+
Distributed topic is an asynchronous messaging service that decouples services that produce events from services that process events. It has two delivery modes:
805
+
806
+
***olric.UnorderedDelivery**: Messages are delivered in random order. It's good to distribute independent events in a distributed system.
807
+
***olric.OrderedDelivery**: Messages are delivered in some order. Not implemented yet.
808
+
809
+
You should know that:
810
+
811
+
* Communication between parties is one-to-many (fan-out).
812
+
* All data is in-memory, and the published messages are not stored in the cluster.
813
+
* Fire&Forget: message delivery is not guaranteed.
Distributed topic is an asynchronous messaging service that decouples services that produce events from services that process events. It has two delivery modes:
379
+
380
+
***olric.UnorderedDelivery**: Messages are delivered in random order. It's good to distribute independent events in a distributed system.
381
+
***olric.OrderedDelivery**: Messages are delivered in some order. Not implemented yet.
382
+
383
+
You should know that:
384
+
385
+
* Communication between parties is one-to-many (fan-out).
386
+
* All data is in-memory, and the published messages are not stored in the cluster.
387
+
* Fire&Forget: message delivery is not guaranteed.
0 commit comments