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, …).
The Network Type is another important section of the configuration. For DB connectivity, Alibaba Cloud offers either Virtual Private Cloud (VPC) or Classic Network.
If choosing VPC, the DB cannot be accessible from outside the Cloud Platform, and the a VPC need to be created before configuring Apsara.
Once the network is configured, the password must be set on ApsaraDB.
When the ApsaraDB is created, Connection Info is visible in the service details.
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.
After the service is fully configured, the Connection String URI is visible.
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}"