Skip to content

Storage

Keith Sterling edited this page Oct 7, 2018 · 5 revisions

Version 3 introduces a completely new storage system. Prior to this version, all data was stored in text files on the local bot file system. This is the standard for most Chatbots, however, Program-Y now allows you to store your data in a number of storage engines, specifically

  • File - Stores all data as files on the file system
  • SQL - Stores all data in a series of SQL tables
  • Mongo - Stores all data as a series of JSON documents
  • Redis - Used to cache user properties only
  • Logger - Allows conversations to be written to system log files

Some engines such as File, SQL and Mongo allow all data to be stored in them, while others such as Redis or Logger only allow a specific data type. See each storage type for what it can store.

Each engine ships with scripts and tools to allow you to upload your text-based files into their respective storage engines. See each engine for details of how this works

Configuration

The choice of storage is driven by configuration, for each entity type you define what storage engine to use, you then use the specific storage engine configuration to specify the specific storage options for the entity itself.

An example is probably the best way to describe how this works. In the example below, we have a client named 'console'. In its configuration, there should be a section called 'storage', and in this section, there should then be a subsection called 'entities'. For each entity type, we specify the storage engine as 'file'

console:
  storage:
      entities:
          categories: file
          errors: file
          duplicates: file
          learnf: file
          conversations:   file

          maps: file
          sets: file
          rdf: file

          denormal: file
          normal: file
          gender: file
          person: file
          person2: file
          regex_templates: file

          properties: file
          variables: file

          twitter: file

          spelling_corpus: file
          license_keys: file

          template_nodes: file
          pattern_nodes: file

          binaries: file
          braintree: file

          preprocessors: file
          postprocessors: file

          usergroups: file
Clone this wiki locally