Reactive Scala Driver for MongoDB

Asynchronous & Non-Blocking

Alibaba ApsaraDB

ApsaraDB is the database service available on Alibaba Cloud platform, with some compatibility with MongoDB.

A free trial is available.

Once the ApsaraDB service is enabled, it can be configured, first with the subscription (Region/Zone, Database Version, …).

Alibaba ApsaraDB Basic configuration

The Network Type is another important section of the configuration. For DB connectivity, Alibaba Cloud offers either Virtual Private Cloud (VPC) or Classic Network.

Alibaba ApsaraDB Network Type

If choosing VPC, the DB cannot be accessible from outside the Cloud Platform, and the a VPC need to be created before configuring Apsara.

Alibaba Cloud Create VPC

Once the network is configured, the password must be set on ApsaraDB.

Alibaba ApsaraDB Password

When the ApsaraDB is created, Connection Info is visible in the service details.

Alibaba ApsaraDB Connection Info

Using VPC, it must require to set a network whitelist.

The connection details can be displayed from there. At this point, it’s still possible to update the Network Type associated with the DB service.

Alibaba ApsaraDB Network update

After the service is fully configured, the Connection String URI is visible.

Alibaba ApsaraDB Network update

Finally for ReactiveMongo connection, the replicaSet option can be removed from the URI, and the password placeholder must be replaced with the actual value.

# Must be updated according the service configuration

mongodb.uri = "mongodb://root:${APSARADB_PASSWORD}@dds-4e6322c0290348c49176-pub.mongodb.germany.rds.aliyuncs.com:3717,dds-5e2a468b7a9a46b1ab06-pub.mongodb.germany.rds.aliyuncs.com:3717/${APSARADB_DBNAME}"

See the documentation

Suggest changes