All documentation
  • Introduction
  • Connecting to data source
    1. Supported data sources
    2. Connecting to other data sources
  • Browser compatibility
  • Documentation for older versions
  • Approaches for connecting to SQL databases

    This is an overview of different approaches for connecting Flexmonster to a relational database:

    • Flexmonster Data Server (recommended)
    • Converting data to JSON or CSV
    • Custom data source API

    Learn about each approach:

    The Data Server

    Flexmonster Data Server is a server-side solution developed by Flexmonster. The Data Server fetches your data from a database, aggregates the data, and then passes it to Flexmonster Pivot in a ready-to-show format.

    This approach is recommended for the majority of situations and has the following advantages:

    • Ready-to-use solution. The Data Server allows connecting to databases out of the box.
    • Saves browser resources. All manipulations with data are performed by the server, resulting in faster data visualization and more efficient use of the browser's resources.
    • Optimized data loading. Using the Data Server, you can load data from a database in small subsets. This allows you to work with the data you need and reduce the number of data manipulations on the server.
    • Built-in security and authorization. The Data Server provides a convenient way of managing security and establishing authorized access to data.
    • Cross-platform support. Flexmonster Data Server is available for Windows (32-bit and 64-bit), macOS (64-bit and ARM64), and Ubuntu/Linux (64-bit and ARM64).
    • Suitable for different use cases. Flexmonster Data Server can be used as a Windows/Unix service, as a DLL, or as a console application. Each usage type provides unique features that are useful in different scenarios.

    The Data Server might not suit you in the following cases:

    • Your server is limited in RAM size. The Data Server stores all the data in RAM. Depending on your queries, the data can take up to 200%–300% of its original size.
    • You want database queries to be affected by the user's input. You need to predefine database queries that the Data Server will use to fetch data. This means that the queries cannot be changed based on the user's input.

    Converting data to JSON or CSV

    Create a server-side script that returns data from the database as JSON or CSV.

    You might consider this approach for the following reasons:

    • Database-independent. Since your server-side script is responsible for fetching and processing data, you can connect to any database.
    • Simple. This approach requires creating only a single server endpoint that loads the necessary dataset and returns it as JSON/CSV data.
    • Easy to integrate into existing logic. You can adjust the script to fit into an existing server API, as the only requirement for the script is to return data in JSON or CSV format.
    • Customizable. You can adjust how data from a database is loaded and preprocessed to make it efficient for your use cases.

    However, this approach has some downsides:

    • Only for small data. Using this approach for datasets larger than 100 MB will significantly increase the component's loading time.
    • Uses browser resources. All calculations are performed in the user's browser. If your component usage involves complex calculations, the application's performance might drop.

    Custom data source API

    The custom data source API is our custom communication protocol designed to retrieve aggregated data from a server to Flexmonster Pivot. The server is responsible for fetching, aggregating, and passing your data to Flexmonster Pivot in a ready-to-show format.

    This approach is especially useful if you already have a server that can work with data. You may also consider this approach because of the following advantages:

    • Database-independent. You can connect to any database since your server is responsible for fetching and processing data.
    • Full control over data. The custom data source API allows you to implement custom methods of loading, caching, and aggregating data. For example, you can create a new aggregation or change how an existing aggregation works.
    • Easy to integrate into existing logic. The custom data source API is a set of requests and responses, so it's easy to integrate into an existing server API.

    The custom data source API might not suit you for the following reasons:

    • Implementing completely new logic. If you don't have a ready-to-use server that can retrieve data from the database and process the data, you will need to develop such a server from scratch.
    • Requires more time and effort from developers. While developing your server allows you to create logic tailored for specific usage, it also requires more resources. The developers will need to read more documentation, create the new logic, and test this logic for bugs and errors.

    Guides in this section will be focused on using the Data Server approach.

    Supported databases

    With Flexmonster Data Server, you can connect to the following databases:

    To connect to MongoDB, use Flexmonster MongoDB Connector. If you use other NoSQL databases or data warehouses, refer to our Connecting to other data sources tutorial.