What is the appropriate way to store arrays of information with configuration API? In Drupal 7 with custom forms and variables, one could easily store arrays of information in the 'variables' table. I would sometimes construct configuration forms that provided a setting per say user role. Then I could either store the setting for each role in a separate variable, or pack all the settings into one array and store it that way. 

I am wondering what the standard best practices way of doing a similar thing in Drupal 8.

in Drupal 7 I would have something like this for a form code:

// build list of roles
  $user_roles = user_roles(TRUE);
  // remove authenticated user role from options
  if (isset($user_roles[2])) {
    unset($user_roles[2]);
  }
$role_settings = variable_get('MYMODULE_role_type_mapping', $role_settings);
foreach ($user_roles as $rid =&gt; $role) {
      $form['roles']['other_roles']['MYMODULE_role_' . $rid . '_type_mapping'] = [
        '#title'         =&gt; $role,
        '#type'          =&gt; 'select',
        '#options'       =&gt; $membership_types,
        '#default_value' =&gt; !empty($role_settings[$rid]) ? $role_settings[$rid] : '',
      ];
    }


and then something like this in the form submit callback:

    // build list of roles
      $user_roles = user_roles(TRUE);
      // remove authenticated user role from options
      if (isset($user_roles[2])) {
        unset($user_roles[2]);
      }
      foreach ($user_roles as $rid =&gt; $role) {
        $role_settings[$rid] = !empty($form_state['values']['MYMODULE_role_' . $rid . '_type_mapping']) ? $form_state['values']['MYMODULE_role_' . $rid . '_type_mapping'] : '';
      }
variable_set('MYMODULE_role_type_mapping', $role_settings);


This type of thing is necessary when you install the custom module on multiple sites, where there could be different number of roles on each site. 

So now with Drupal 8 we have this new Configuration API. I can't assume I know the roles in advance. 

I was hoping to achieve this with "Simple Configuration" but I realize it may be necessary to create a custom configuration entity, although if it can be done without that that would be nice and "simple".

According to this resource: https://www.drupal.org/node/1905070#types
There are just a few schema types for configuration fields, none of which seem intuitively appropriate to this case. 

Reading that page, it is not obvious even how one would store the value of a multi-valued select list in configuration, let alone variable that could be an array of all kinds of different information. In D7 a multi-valued select list would return an array. In D7 variables are stored as serialized variables. Even D7's "simple_settings_form" would handle this no problem.

Surely this type of problem has been solved many times, but it is not "simple" to find any information.

So the problem is two-fold
1) Just storing an array of values into configuration, with unknown number of array elements, number depending on custom site conditions (like user roles on a site)
2) Unpacking this array and setting up form elements for it, which on submit, packs it all up into one variable.

Similar question, simpler question is:
If one is defining configuration schema for a multi-valued select list, what data type does one use? String? 

Is the model I used here for D7 even portable to D8, there's probably some better way to go no doubt, but making a configuration entity for each role in the site and all of that doesn't seem simple and definitely not as simple as could be done in D7. I do want to give a thought to config export / import between sites. dev/staging/production versions of the site may all have the same user roles, but definitely not separate websites altogether.

Although I ask several questions in this post, the common theme is how to store arrays of information as configuration appropriately in Drupal 8? Simple case is the value of a multi-valued select list, more complex scenario of the setting per user role like I describe.

Thanks in advance!
You define a schema type sequence:

Example: /core/modules/options/config/schema/options.schema.yml

# Schema for the configuration files of the Options module.

field.storage_settings.list_integer:
  type: mapping
  label: 'List (integer) settings'
  mapping:
    allowed_values:
      type: sequence
      label: 'Allowed values list'
      sequence:
        type: mapping
        label: 'Allowed value with label'
        mapping:
          value:
            type: integer
            label: 'Value'
          label:
            type: label
            label: 'Label'


You'll find the form for this example in /core/modules/options/src/Plugin/Field/FieldType/ListItemBase.php

More info https://www.drupal.org/docs/8/api/configuration-api/configuration-schemametadata