riptide v0.5.0-beta6 Riptide.Store.Riptide View Source

This store forwards all mutations and queries to another Riptide instance. This is useful if you have multiple Riptide instances but want all of them to write and read from a primary node. This is comparable to web applications that write to a centralized Postgres database. Used in conjuction with Riptide.Store.Composite will allow you to store some data globally and some data locally.

Configuration

A primary node will only accept connections from nodes configured with the same token. In your primary node be sure to set the following configuration with a random token:

  config :riptide, %{
    store: %{
      token: "mytoken"
    }
  }

In your child node add the following configuration:

  config :riptide, %{
    store: %{
      read: {Riptide.Store.Riptide, []},
      write: {Riptide.Store.Riptide, []},
    }
  }

Additionally in the child nodes setup a connection to the primary node in your application.ex:

children = [
  {Riptide.Store.Riptide,
     [
       url: "https://primary-node:12000/socket",
       name: :riptide,
       token: "mytoken"
     ]},
  Riptide,
]

This will startup a connection to the primary node before starting up Riptide locally. All data now will be written to and read from the primary node.

Options

  • :name - name of connection to primary node, defaults to :riptide (optional)

Link to this section Summary

Functions

Starts a connection to a remote Riptide instance

Link to this section Functions

Starts a connection to a remote Riptide instance

Options

  • :name - name of connection
  • :url - url of remote node (required)
  • :token - authorization token (required)