All Products
Document Center

Data Lake Analytics:Background and preparations

Last Updated:May 19, 2022


Data Lake Analytics (DLA) serves as a hub for in-cloud data processing. It allows you to query and analyze data in ApsaraDB for RDS, Table Store, and OSS through standard JDBC.

In DLA, you can also create a database (mapping database) connecting to an ApsaraDB for MongoDB (MongoDB) database. Then, you can use a MySQL client or MySQL command-line interface (CLI) tool to connect to DLA and execute standard SQL statements to read and write data from and to the MongoDB database. Alternatively, after analyzing the massive amounts of data stored in Alibaba Cloud Object Storage Service (OSS) and Table Store , you can write the result back to the MongoDB database for front-end service use.


Before using DLA to read and write data from and to the MongoDB database, you must follow these steps to prepare the test data in the MongoDB database:

  1. Create a MongoDB instance.

    DLA and the MongoDB instance must be in the same region.

    DLA connects to a MongoDB database over the VPC of the MongoDB instance. Therefore, we recommend that you select VPC as the network type when creating the MongoDB instance. You can click Switch to VPC to switch the network type of the MongoDB instance from classic network to VPC.

  2. Configure the whitelist.

  3. Connect to the instance.

  4. Insert test data

The example in this topic describes how to create a database named mongo_test in your MongoDB instance, create a collection named person in the mongo_test database, and then insert the following test data into the person collection:

  1. db.person.insert({id:1, name: "james", age: 10, create_time: new Date()});
  2. db.person.insert({id:2, name: "bond", age: 20, create_time: new Date()});
  3. db.person.insert({id:3, name: "lily", age: 30, create_time: new Date()});
  4. db.person.insert({id:4, name: "lucy", age: 20, create_time: new Date()});


Before creating a MongoDB schema in DLA, you must add the CIDR block to your MongoDB whitelist.

Your MongoDB instance is in a VPC, and by default DLA cannot access resources in the VPC. To enable DLA to access your MongoDB instance, you need to use the reverse VPC technology, that is, add the CIDR block to the whitelist of your MongoDB instance.

Permission statement: When you add the CIDR block to the whitelist of your MongoDB instance, you agree that we can use the reverse VPC technology to read and write data from and to your MongoDB database.


  1. Create a MongoDB schema

  2. Create a MongoDB table and read and write data from and to the table