Create a View from custom database I love the features the view provides in Drupal. Sortable tables, Filters, as well as ability to use external modules like views bulk export. 
My problem is that I want to display a separate database (Call this X), using views. What would be the best way to go about it? 

To get around this problem in Drupal 6, I created a content type with all fields that were in Database X, then I created view for that content type by frontend. After that I used hook_pre_render_view() to push data from X to the view. Right now I want to achieve similar results in Drupal 8. I could use this same approach but it doesn't feel very Drupally. I was wondering if there is a better way to achieve this.
You can connect a external database inorderto let Drupal Know about it:

$databases['external']['default'] = array(
  'database' =&gt; 'custom_database',
  'username' =&gt; 'root',
  'password' =&gt; '',
  'prefix' =&gt; '',
  'host' =&gt; php_sapi_name() == 'cli' ? '127.0.0.1' : 'localhost',
  'port' =&gt; '3306',
  'namespace' =&gt; 'Drupal\\Core\\Database\\Driver\\mysql',
  'driver' =&gt; 'mysql',
);


Then you can connect to that database:

/*
* Switch to external db
*/
\Drupal\Core\Database\Database::setActiveConnection('custom_database');

/*
* Get connection
*/
$db = \Drupal\Core\Database\Database::getConnection();


Then do you stuff and don't footgrt to switch again to the standard database:

/*
* Switch back
*/
\Drupal\Core\Database\Database::setActiveConnection();


You can store your external database info into a content type programatically and the show in views.