What do array keys in the database definition array mean? I have following code in my settings.php file:

$databases['default']['default2'] = array(
  'driver'    =&gt; 'mysql',
  'database'  =&gt; 'rotary',
  'username'  =&gt; 'root',
  'password'  =&gt; 'root',
  'host'      =&gt; 'localhost',
  'prefix'    =&gt; '',
);

$databases['rotary2']['default1'] = array(
  'driver'    =&gt; 'mysql',
  'database'  =&gt; 'rotary2',
  'username'  =&gt; 'root',
  'password'  =&gt; 'root',
  'host'      =&gt; 'localhost',
  'prefix'    =&gt; '',
);


I know that the first keys i.e. default &amp; rotary2 are the database names.

What are the keys default2 &amp; default3 for?
Here is the explanation from the setting.php file:


  For each database, you may optionally specify multiple "target" databases.
  A target database allows Drupal to try to send certain queries to a different database if it can but fall back to the default connection if not. That is useful for master/slave replication, as Drupal may try to connect to a slave server when appropriate and if one is not available will simply fall back to the single master server.
  
  &nbsp;
  
  The general format for the $databases array is as follows:

$databases['default']['default'] = $info_array;
$databases['default']['slave'][] = $info_array;
$databases['default']['slave'][] = $info_array;
$databases['extra']['default'] = $info_array;

  
  In the above example, $info_array is an array of settings described above. The first line sets a "default" database that has one master database (the second level default). The second and third lines create an array of potential slave databases. Drupal will select one at random for a given request as needed.  The fourth line creates a new database with a name of "extra".


I hope this will give you clear idea about default2 and default3.