Storage

AFS provides an API for the data storage that must be implemented to support a new way to store data. PowSyBl provides three implementations of that API.

Local storage

This implementation exposes a folder of the local hard-drive in read-only. It’s used to import/export data from the user computer to AFS.

Configuration

To access to the local drive, you have to configure the local-app-file-system module in the configuration file. A local AFS drive has a name and a path to a folder.

YAML configuration

local-app-file-system:
    drive-name: my-local-drive
    root-dir: /home/user/drive

MapDB storage

This implementation relies on a MapDB database. This is a simple but functional implementation used for prototyping or standalone applications. Note that this implementation cannot be shared between several applications.

Configuration

To access to a MapDB drive, you have to configure the mapdb-app-file-system module in the configuration file. A MapDB drive has a name and a path to a MapDB file, where the data will be stored.

YAML configuration

mapdb-app-file-system:
    drive-name: drive1
    db-file: /home/user/drive1.db

Cassandra storage

This implementation relies on a Cassandra database. It has been tested on Cassandra v3.11.5 and is expected to be tested against more recent versions soon.

Configuration

To access to a Cassandra database, you have to configure the cassandra-app-file-system and the cassandra-app-storage modules in the configuration file.

YAML configuration

cassandra-app-file-system:
  drive-name: drive1
  ip-addresses:
    - 127.0.0.1
    - <other IP>
  local-dc: dc1
  remotely-accessible: true

cassandra-app-storage:
  flush-maximum-change: 100
  double-query-partition-size: 100
  string-query-partition-size: 100

Remote storage

This is a special implementation of the storage API that allows creating a relay to another AFS storage instance, exposing the API through a web-service.

To make a drive remotely accessible, set the remotely-accessible property of this drive to true:

mapdb-app-file-system:
    drive-name: drive1
    db-file: /home/user/drive1.db
    remotely-accessible: true

On the client side, you have to configure the remote-service module in the configuration file to give the URL of the server and the name of the drive.

YAML configuration

remote-service:
    host-name: my-afs-server
    app-name: my-server-app
    secure: false
    port: 8080

Going further

To go further with AFS, check out the following content