I am using ReactiveMongo 0.12, and trying to understand the core differences between how different types of connection pooling works in ReactiveMongo.
ReactiveMongo seems to provide 3 ways in which we can establish connection with the database:
TYPE 1: Using Single Connection Pool Instance
import reactivemongo.api.MongoConnection
val driver1 = new reactivemongo.api.MongoDriver
val connection3 = driver1.connection(List("addressA: 27017", "addressB: 27017","addressC": 27017", "addressD: 27017"))
TYPE 2: Using multiple Connection Pool Instances
import reactivemongo.api.MongoConnection
val driver1 = new reactivemongo.api.MongoDriver
val connection1 = driver1.connection(List("addressA", "addressB"))
val connection2 = driver1.connection(List("addressC", "addressD"))
TYPE 3: Using multiple connection pools
import reactivemongo.api.MongoConnection
val driver1 = new reactivemongo.api.MongoDriver // first pool
val driver2 = new reactivemongo.api.MongoDriver // second pool
// Pick a connection from the first pool
def connection1 = driver1.connection(List("addressA", "addressB"))
// Pick a connection from the second pool
def connection2 = driver2.connection(List("addressC", "addressD"))
What are the differences between these 3 types of connection ? Which would be the best approach in terms of performance?