Apache CouchDB

The Apache CouchDB connector lets you perform insert, delete, update, and read operations on a CouchDB database.

Before you begin

Before using the Apache CouchDB connector, do the following tasks:

Configure the connector

A connection is specific to a data source. It means that if you have many data sources, you must create a separate connection for each data source. To create a connection, do the following:

  • In the Cloud console, go to the Integration Connectors > Connections page and then select or create a Google Cloud project.

    Go to the Connections page

  • Click + CREATE NEW to open the Create Connection page.
  • In the Location section, choose the location for the connection.
    1. Region: Select a location from the drop-down list.

      For the list of all the supported regions, see Locations.

    2. Click NEXT.
  • In the Connection Details section, complete the following:
  • Connector: Select Apache CouchDB from the drop down list of available Connectors.
  • Connector version: Select the Connector version from the drop down list of available versions.
  • In the Connection Name field, enter a name for the Connection instance.

    Connection names must meet the following criteria:

  • Optionally, enter a Description for the connection instance.
  • Optionally, enable Cloud logging, and then select a log level. By default, the log level is set to Error.
  • Service Account: Select a service account that has the required roles.
  • Optionally, configure the Connection node settings:

    A node is a unit (or replica) of a connection that processes transactions. More nodes are required to process more transactions for a connection and conversely, fewer nodes are required to process fewer transactions. To understand how the nodes affect your connector pricing, see Pricing for connection nodes. If you don't enter any values, by default the minimum nodes are set to 2 (for better availability) and the maximum nodes are set to 50.

  • Flexible Schema: Set FlexibleSchema to true to scan for additional metadata on the query result set. Otherwise, the metadata will remain the same.
  • (Optional) In the Advanced settings section, select the Use proxy checkbox to configure a proxy server for the connection and configure the following values:
  • Optionally, click + ADD LABEL to add a label to the Connection in the form of a key/value pair.
  • Click NEXT.
  • In the Destinations section, enter details of the remote host (backend system) you want to connect to.
    1. Destination Type: Select a Destination Type.
      • To specify the destination hostname or IP address, select Host address and enter the address in the Host 1 field.
      • To establish a private connection, select Host Address and add the endpoint attachment created for the SAP Gateway using the HTTPS protocol.

      If you want to establish a public connection to your backend systems with additional security, you can consider configuring static outbound IP addresses for your connections, and then configure your firewall rules to allowlist only the specific static IP addresses.

      To enter additional destinations, click +ADD DESTINATION.

    2. Click NEXT.
  • In the Authentication section, enter the authentication details.
    1. Select an Authentication type and enter the relevant details.

      The following authentication types are supported by the Apache CouchDB connection:

      • Username and password
    2. To understand how to configure these authentication types, see Configure authentication.

    3. Click NEXT.
  • Review: Review your connection and authentication details.
  • Click Create.
  • Configure authentication

    Enter the details based on the authentication you want to use.

    Connection configuration samples

    This section lists the sample values for the various fields that you configure when creating the Apcache CouchDB connection.

    Ensure that you have an admin user role to authenticate to Apache CouchDB.

    For information about Apache CouchDB, see Quickstart with Apache CouchDB. For more information about Apache CouchDB platform, see Apache CouchDB platform overview. For information about Apache CouchDB SSL configuration, see Apache CouchDB 3.5.2. HTTPS (SSL/TLS) Options and How Do I Configure SSL (HTTPS) in Apache CouchDB?.

    Basic authentication connection type

    Field name Details Location us-central1 Connector Apache CouchDB Connector version 1 Connection Name couchdb-vm-connection Enable Cloud Logging Yes Service Account SERVICE_ACCOUNT_NAME@PROJECT_ID.iam.gserviceaccount.com List Views Yes Flexible Schema Yes Minimum number of nodes 2 Maximum number of nodes 50 Destination Type(Server) Host address Host address http://198.51.100.0 Username USERNAME Password PASSWORD Secret version 1

    Proxy connection type

    Field name Details Location us-central1 Connector Apache CouchDB Connector version 1 Connection Name couchdb-proxy-conn Enable Cloud Logging Yes Service Account SERVICE_ACCOUNT_NAME@PROJECT_ID.iam.gserviceaccount.com List Views No Flexible Schema No Proxy use proxy Proxy Auth Scheme Digest Proxy User PROXY_USER Proxy Password PROXY_PASSWORD Minimum number of nodes 2 Maximum number of nodes 50 Destination Type(Server) Host address Host address http://198.51.100.0 Username USERNAME Password PASSWORD Secret version 1

    SSL connection (insecure) connection type

    Field name Details Location us-central1 Connector Apache CouchDB Connector version 1 Connection Name couchdb-ssl-conn Enable Cloud Logging Yes Service Account SERVICE_ACCOUNT_NAME@PROJECT_ID.iam.gserviceaccount.com List Views No Flexible Schema No Minimum number of nodes 2 Maximum number of nodes 50 Trust store (choose the trust model) Insecure Connection Destination Type(Server) Host address Host address http://198.51.100.0 Username USERNAME Password PASSWORD Secret version 1

    SSL connection (private) connection type

    Field name Details Location us-central1 Connector Apache CouchDB Connector version 1 Connection Name couchdb-proxy-conn Enable Cloud Logging Yes Service Account SERVICE_ACCOUNT_NAME@PROJECT_ID.iam.gserviceaccount.com List Views No Flexible Schema No Minimum number of nodes 2 Maximum number of nodes 50 Trust store (choose the trust model) Private Custom Trust store Self-signed certificate. Secret Version 1 Destination Type(Server) Host address Host address https://198.51.100.0 Username USERNAME Password PASSWORD Secret version 1

    JWT Authentication connection type

    Field name Details Location us-central1 Connector Apache CouchDB Connector version 1 Connection Name couchdb-vm-jwt-conn Enable Cloud Logging Yes Service Account SERVICE_ACCOUNT_NAME@PROJECT_ID.iam.gserviceaccount.com List Views No Flexible Schema No Proxy No Minimum number of nodes 2 Maximum number of nodes 50 Destination Type(Server) Host address Host address http://203.0.113.0 JWT Subject admin JWT Algorithm HS256 JWT Key Type Symmetric JWT Key JWT_KEY Secret version 1

    Entities, operations, and actions

    All the Integration Connectors provide a layer of abstraction for the objects of the connected application. You can access an application's objects only through this abstraction. The abstraction is exposed to you as entities, operations, and actions.

    System limitations

    The Apache CouchDB connector can process a maximum of 5 transactions per second, per node, and throttles any transactions beyond this limit. By default, Integration Connectors allocates 2 nodes (for better availability) for a connection.

    For information on the limits applicable to Integration Connectors, see Limits.

    Entity operation examples

    Example - List all customer records

    This example lists all customer records in the Customer entity.

    1. In the Configure connector task dialog, click Entities.
    2. Select Customer from the Entity list.
    3. Select the LIST operation, and then click Done.
    4. Optionally, you can enter values in the filterClause to filter the result set.

    Example - Get a customer record

    This example gets a specific customer record from the Customers entity.

    1. In the Configure connector task dialog, click Entities.
    2. Select Customers from the Entity list.
    3. Select the GET operation, and then click Done.
    4. In the Task Input section of the Connectors task, click EntityId and then enter cust-2 in the Default Value field.

      Here, cust-2 is the primary key value of the Customers entity.

    Example - Add a customer

    This example creates a customer record in the Customers entity.

    1. In the Configure connector task dialog, click Entities.
    2. Select Customers from the Entity list.
    3. Select the Create operation, and then click Done.
    4. In the Task Input section of the Connectors task, click connectorInputPayload and then enter a value similar to the following in the Default Value field:
      {
      "name": "John",
      "_id": "cust-3"
      }

      If the integration is successful, the connector task's connectorOutputPayload field will have a value similar to the following:

      {
      "_id": cust-3
      }

    Example - Update a customer record

    This example updates the specified customer record in the Customers entity.

    1. In the Configure connector task dialog, click Entities.
    2. Select Customers from the Entity list.
    3. Select the Update operation, and then click Done.
    4. In the Task Input section of the Connectors task, click connectorInputPayload and then enter a value similar to the following in the Default Value field:
      {
            "name": "Jason",
          }
          
    5. Click entityId, and then enter cust-5 in the Default Value field.

      Alternately, instead of specifying the entityId, you can also set the filterClause to cust-5.

      If the integration is successful, the connector task's connectorOutputPayload field will have a value similar to the following:

      {
      "_id": cust-5
      }
          

    Example - Delete a customer record

    This example deletes the specified customer record from the Customers entity.

    1. In the Configure connector task dialog, click Entities.
    2. Select Customers from the Entity list.
    3. Select the Delete operation, and then click Done.
    4. In the Task Input section of the Connectors task, click entityId and then enter cust-6 in the Default Value field.

    Create connections using Terraform

    You can use the Terraform resource to create a new connection.

    To learn how to apply or remove a Terraform configuration, see Basic Terraform commands.

    To view a sample terraform template for connection creation, see sample template.

    When creating this connection by using Terraform, you must set the following variables in your Terraform configuration file:

    Parameter name Data type Required Description
    flexible_schema BOOLEAN False Set FlexibleSchema to true to scan for additional metadata on the query result set. Otherwise, the metadata will remain the same.
    proxy_enabled BOOLEAN False Select this checkbox to configure a proxy server for the connection.
    proxy_auth_scheme ENUM False The authentication type to use to authenticate to the ProxyServer proxy. Supported values are: BASIC, DIGEST, NONE
    proxy_user STRING False A user name to be used to authenticate to the ProxyServer proxy.
    proxy_password SECRET False A password to be used to authenticate to the ProxyServer proxy.
    proxy_ssltype ENUM False The SSL type to use when connecting to the ProxyServer proxy. Supported values are: AUTO, ALWAYS, NEVER, TUNNEL

    Use the Apache CouchDB connection in an integration

    After you create the connection, it becomes available in both Apigee Integration and Application Integration. You can use the connection in an integration through the Connectors task.

    Get help from the Google Cloud community

    You can post your questions and discuss this connector in the Google Cloud community at Cloud Forums.

    What's next