Skip to content

lasp-lang/lasp_pg

Repository files navigation

Lasp PG

Build Status

Eventually consistent process registry, the spirtual successor to Riak PG.

Usage

What are groups?

-type group() :: term().

Join a process to a group (no need to pre-declare)

lasp_pg:join(group(), pid()) -> ok.

What about removing?

lasp_pg:leave(group(), pid()) -> ok.

You can also return the members.

lasp_pg:members(group()) -> {ok, sets:set(pid())}.

Clustering

Use the lasp_peer_service API to join and leave nodes:

lasp_peer_service:join({Name, IP, Port}).

Partisan

Our Partisan library drives what distribution facility you use: you can use the custom HyParView inspired backend, which scales to 512+ node Erlang clusters, or fall back to client/server or full-mesh with distributed Erlang.

This can be configured using the following command, before the Partisan application is started:

partisan_config:set(partisan_peer_service_manager, partisan_hyparview_peer_service_manager).

Available options are: partisan_client_server_peer_service_manager, partisan_default_peer_service_manager or partisan_hyparview_peer_service_manager.

Replication

Lasp PG uses the underlying Lasp KV store, which only has in-memory persistence currently, but a configurable API so that can be changed to use either RocksDB or LevelDB. Lasp KV is fully replicated across all nodes, but partial replication is coming soon.

Releases

No releases published

Packages

No packages published