MongoDB - Configure an Analytics node
Configure a dedicated Analytics node in your Public Cloud Databases for MongoDB to support analytics workloads
Configure a dedicated Analytics node in your Public Cloud Databases for MongoDB to support analytics workloads
Last updated 19th September 2022
This guide shows how to configure a node in your cluster dedicated to analytics-type queries in a Public Cloud Databases for MongoDB cluster. This allows you to run such queries, or BI (Business Intelligence) tools - including MongoDB BI Connector in a way that doesn't degrade the operational performance of the cluster.
Let's imagine you're operating a popular recipes website. You might use a MongoDB database to store recipes, some kind of API/backend layer to offer access to that data, and a frontend presentation layer - a website or an app - in order to display those recipes attractively to your end-users.
Now, when an end-user wants to search for and display a recipe, the API/backend layer needs to be able to find and fetch the right document quite quickly, because your end-user is already hungry and we all know a snappy user experience is nicer. And then, since that recipes website is quite popular, you need to be able to serve a large number of end-users at the same time, thus lots of similar queries at the same time. In other words, operational queries often need to meet low latency requirements, tend to be scoped to a small subset of the database as a whole and you might end up running a lot of smaller queries.
On the other hand, as the operator of that popular site, you want to understand the usage patterns as a whole. In order to do that, you might need to query your database in order to gain insights on your system state, e.g. Who are the top users? Where are they located? What time of day is your site most active? Those analytical queries have different requirements than the former set: they tend to access a larger set of the database, they are less latency-critical, and you don't want those to disrupt the end-user experience.
Simply put, an analytics node in your Public Cloud Databases for MongoDB cluster allows you to run those analytical queries while ensuring your operational queries don't suffer, by directing those to a specific node in the cluster.
Using the API, you can create a new cluster with:
Using the nodeList parameter, you can define the nodes for the cluster. The role attribute can take the value STANDARD
or ANALYTICS
depending on the role you want for the given node.
In case you already have an existing cluster, you can add a new node using the API endpoint:
Specifying the role attribute, STANDARD
or ANALYTICS
, allows to request the role you want for the given node.
You can change the role of a given node using:
Once again the role attribute (STANDARD
/ ANALYTICS
) allows to make a node fulfill the requested role.
The cluster can now be reached through two different connection strings:
mongodb+srv://<username>:<password>@<cluster hostname>/admin?replicaSet=replicaset&tls=true
for the operational connections, e.g. in the application configuration.mongodb+srv://<username>:<password>@<cluster hostname>/admin?replicaSet=replicaset&tls=true&readPreference=secondary&readPreferenceTags=nodeType:ANALYTICS
for the analytics workload, e.g. in your BI tools.Notice the extra query parameters readPreference=secondary
and readPreferenceTags=nodeType:ANALYTICS
: they direct the queries towards the Analytics node we configured.
nodeNumber
parameter:You can either use the delete node endpoint to remove the Analytics node, or turn that Analytics node into a standard one before scaling down the cluster.
Join our community of users on https://community.ovh.com/en/.
We would love to help answer questions and appreciate any feedback you may have. Are you on Discord? Connect to our channel at https://discord.gg/ovhcloud and interact directly with the team that builds our databases service!
Si lo desea, también puede enviarnos sus sugerencias para ayudarnos a mejorar nuestra documentación.
Imágenes, contenido, estructura...: ayúdenos a mejorar nuestra documentación con sus sugerencias.
No podemos tratar sus solicitudes de asistencia a través de este formulario. Para ello, haga clic en "Crear un tíquet" .
¡Gracias! Tendremos en cuenta su opinión.
¡Acceda al espacio de la OVHcloud Community! Resuelva sus dudas, busque información, publique contenido e interactúe con otros miembros de la comunidad.
Discuss with the OVHcloud community