Connecting To NoSQL

From DreamFactory
Jump to: navigation, search
DreamFactoryTutorialsConnecting To NoSQL
(Non-Bitnami)
 
(23 intermediate revisions by 3 users not shown)
Line 1: Line 1:
'''MongoDB'''
+
== MongoDB ==
  
Bitnami DreamFactory installs come with MongoDB already installed and configured as a DreamFactory service. This includes a MongoDB server plus the drivers to connect to it. You can connect to this pre-configured service without any additional setup.
+
=== Bitnami ===
 +
Bitnami installs come with MongoDB already installed and configured as a DreamFactory service. This includes a MongoDB server plus the PHP driver (mongo.so) to connect to it. You can connect to this pre-configured service without any additional set up.
  
If you want to connect to some other MongoDB server you must add a new MongoDB service using the following steps.
+
=== Non-Bitnami ===
 +
If you are not using Bitnami, you need to make sure the PHP driver for MongoDB (mongo.so) is installed on your system. Otherwise the admin console will report an error when you try to create the service. Below are the steps to install the MongoDB driver for PHP on Ubuntu Linux. Set up for other Linux distros would be similar. After these steps you'll be able to create your new MongoDB service. For OS X or Windows, we recommend using the Bitnami installer, which already includes the MongoDB driver. 
 +
<pre>
 +
sudo apt-get install build-essential php-dev php-pear
 +
sudo pecl install mongodb 
 +
sudo vi /etc/php/7.0/mods-available/mongodb.ini  (add the line    extension=mongodb.so  to the file)
 +
sudo phpenmod mongodb
 +
sudo service apache2 restart
 +
</pre>
 +
 
 +
=== Creating a New MongoDB Service ===
 +
If you want to connect to a MongoDB server other than the one provided by Bitnami installs, you must add a new MongoDB service using the following steps.
  
 
* Go to the Services tab in the admin console.   
 
* Go to the Services tab in the admin console.   
 
* Click Create.   
 
* Click Create.   
* Set the Service Type to MongoDB.   
+
* Set the Service Type to Database-->MongoDB.   
 
* Enter a name and label for the service. Name will be part of the URL for accessing the service via the REST API.   
 
* Enter a name and label for the service. Name will be part of the URL for accessing the service via the REST API.   
 
* Go to the Config tab for the new service.   
 
* Go to the Config tab for the new service.   
Line 13: Line 25:
 
* Credentials can be part of the connection string or included in the Options section. See [http://php.net/manual/en/mongoclient.construct.php here] for available options.   
 
* Credentials can be part of the connection string or included in the Options section. See [http://php.net/manual/en/mongoclient.construct.php here] for available options.   
 
* Click Create Service to save your new service.   
 
* Click Create Service to save your new service.   
* Go to the API Docs tab in the admin console to test your new service
+
* Go to the API Docs tab in the admin console to test your new service.
<br />
+
 
'''NOTE''' In order to create a new MongoDB service you must have the PHP driver installed on your system. Otherwise the admin console will report an error when you try to create the service. Here are the steps to install MongoDB drivers for PHP on Ubuntu Linux. After these steps you'll be able to create your new MongoDB service. For OS X or Windows we recommend using the Bitnami installer, which already has the MongoDB driver installed.
+
== AWS DynamoDB ==
<br />
+
 
<pre>
+
To create a service for connecting to Amazon DynamoDB, follow these steps.
sudo apt-get install php5-dev php5-cli php-pear
+
 
sudo pecl install mongo 
+
*Go to the Services tab in the admin console.
sudo vi /etc/php5/apache2/php.ini  (search for 'extension=' and add 'extension=mongo.so' to this section of file, then save file)
+
*Click Create.
sudo service apache2 restart
+
*Set the Service Type to Database-->AWS DynamoDB.
</pre>
+
*Enter a name and label for the service. Name will be part of the URL for accessing the service via the REST API.
 +
*Go to the Config tab for the new service.
 +
*Enter your AWS access key, secret key, and region.
 +
*Click Create Service to save your new service.
 +
*Go to the API Docs tab in the admin console to test your new service.
 +
 
 +
== CouchDB ==
 +
 
 +
To create a service for connecting to CouchDB, follow these steps.
 +
 
 +
*Go to the Services tab in the admin console.
 +
*Click Create.
 +
*Set the Service Type to Database-->CouchDB.
 +
*Enter a name and label for the service. Name will be part of the URL for accessing the service via the REST API.
 +
*Go to the Config tab for the new service.
 +
*Enter the connection string for your database, like http://username:[email protected]:5984/db.
 +
*Click Create Service to save your new service.
 +
*Go to the API Docs tab in the admin console to test your new service.
 +
 
 +
== Azure Tables ==
 +
 
 +
To create a service for connecting to Azure Tables, follow these steps.
 +
 
 +
*Go to the Services tab in the admin console.
 +
*Click Create.
 +
*Set the Service Type to Database-->Azure Table Storage.
 +
*Enter a name and label for the service. Name will be part of the URL for accessing the service via the REST API.
 +
*Go to the Config tab for the new service.
 +
*Enter all requested info pertaining to your storage account.
 +
*Click Create Service to save your new service.
 +
*Go to the API Docs tab in the admin console to test your new service.
 +
 
 +
== Cassandra ==
 +
 
 +
To create a service for connecting to Cassandra, follow these steps.
 +
 
 +
*Go to the Services tab in the admin console.
 +
*Click Create.
 +
*Set the Service Type to Database-->Cassandra.
 +
*Enter a name and label for the service. Name will be part of the URL for accessing the service via the REST API.
 +
*Go to the Config tab for the new service.
 +
*Enter all requested info pertaining to your storage account, including host, port (defaults to 9042), and keyspace.
 +
*Click Create Service to save your new service.
 +
*Go to the API Docs tab in the admin console to test your new service.

Latest revision as of 13:25, 2 March 2017

MongoDB

Bitnami

Bitnami installs come with MongoDB already installed and configured as a DreamFactory service. This includes a MongoDB server plus the PHP driver (mongo.so) to connect to it. You can connect to this pre-configured service without any additional set up.

Non-Bitnami

If you are not using Bitnami, you need to make sure the PHP driver for MongoDB (mongo.so) is installed on your system. Otherwise the admin console will report an error when you try to create the service. Below are the steps to install the MongoDB driver for PHP on Ubuntu Linux. Set up for other Linux distros would be similar. After these steps you'll be able to create your new MongoDB service. For OS X or Windows, we recommend using the Bitnami installer, which already includes the MongoDB driver.

sudo apt-get install build-essential php-dev php-pear
sudo pecl install mongodb  
sudo vi /etc/php/7.0/mods-available/mongodb.ini  (add the line    extension=mongodb.so   to the file)
sudo phpenmod mongodb
sudo service apache2 restart

Creating a New MongoDB Service

If you want to connect to a MongoDB server other than the one provided by Bitnami installs, you must add a new MongoDB service using the following steps.

  • Go to the Services tab in the admin console.
  • Click Create.
  • Set the Service Type to Database-->MongoDB.
  • Enter a name and label for the service. Name will be part of the URL for accessing the service via the REST API.
  • Go to the Config tab for the new service.
  • Enter the connection string for the MongoDB server you want to connect to.
  • Credentials can be part of the connection string or included in the Options section. See here for available options.
  • Click Create Service to save your new service.
  • Go to the API Docs tab in the admin console to test your new service.

AWS DynamoDB

To create a service for connecting to Amazon DynamoDB, follow these steps.

  • Go to the Services tab in the admin console.
  • Click Create.
  • Set the Service Type to Database-->AWS DynamoDB.
  • Enter a name and label for the service. Name will be part of the URL for accessing the service via the REST API.
  • Go to the Config tab for the new service.
  • Enter your AWS access key, secret key, and region.
  • Click Create Service to save your new service.
  • Go to the API Docs tab in the admin console to test your new service.

CouchDB

To create a service for connecting to CouchDB, follow these steps.

  • Go to the Services tab in the admin console.
  • Click Create.
  • Set the Service Type to Database-->CouchDB.
  • Enter a name and label for the service. Name will be part of the URL for accessing the service via the REST API.
  • Go to the Config tab for the new service.
  • Enter the connection string for your database, like http://username:[email protected]:5984/db.
  • Click Create Service to save your new service.
  • Go to the API Docs tab in the admin console to test your new service.

Azure Tables

To create a service for connecting to Azure Tables, follow these steps.

  • Go to the Services tab in the admin console.
  • Click Create.
  • Set the Service Type to Database-->Azure Table Storage.
  • Enter a name and label for the service. Name will be part of the URL for accessing the service via the REST API.
  • Go to the Config tab for the new service.
  • Enter all requested info pertaining to your storage account.
  • Click Create Service to save your new service.
  • Go to the API Docs tab in the admin console to test your new service.

Cassandra

To create a service for connecting to Cassandra, follow these steps.

  • Go to the Services tab in the admin console.
  • Click Create.
  • Set the Service Type to Database-->Cassandra.
  • Enter a name and label for the service. Name will be part of the URL for accessing the service via the REST API.
  • Go to the Config tab for the new service.
  • Enter all requested info pertaining to your storage account, including host, port (defaults to 9042), and keyspace.
  • Click Create Service to save your new service.
  • Go to the API Docs tab in the admin console to test your new service.