Find

Article
· Apr 8 5m read

Lifting InterSystems IRIS to the Cloud: Migration Options

Migrating InterSystems IRIS and InterSystems IRIS for Health from on-premises to the cloud offers many advantages for Application Providers and Solution Providers. These advantages include simplified operations, access to flexible resources, and enhanced resilience. Companies no longer need to worry about the physical constraints and expenses associated with maintaining on-prem infrastructure, such as power and space requirements and expensive computer hardware.

One of the most compelling benefits is the ability to accelerate speed to market. By removing the burden of infrastructure maintenance, cloud environments enable faster development and deployment cycles, allowing businesses to respond quickly to market demands and opportunities. Operational costs are also lowered, because companies can scale resources up or down based on actual needs, leading to more efficient use of capital. Moreover, migrating to the cloud can contribute to a reduced carbon footprint by optimizing energy usage through shared cloud infrastructure.

Transitioning to the cloud may involve significant changes. Companies may benefit from a more operational focus, managing and optimizing cloud resources continuously. This shift may require changes to business models, reconsideration of margins, and strategies for scaling operations up or out. While requiring more investment, embracing these changes can lead to improved agility and competitive advantage in the marketplace.

Architectural Choices in Cloud Migration

When considering the simplest cloud migration, lifting an existing on-premises application to one of the public clouds requires companies to choose one or more services (AWS, Azure, Google, or another). Companies then face an important architectural choice: migrate entirely to the cloud or create a prem-to-cloud hybrid cluster. Both InterSystems IRIS and InterSystems IRIS for Health fully support either option. A hybrid cluster mirrors the on-prem instance to the cloud asynchronously. This alternative can be helpful in situations such as when the OLTP continues to run on-prem, but the cloud instance provides support for analytics, reporting, and other read-only operations.

Migration Options

Each architectural choice for cloud migration has advantages and limitations,  making it essential for companies to evaluate their specific needs and goals when planning a cloud strategy. The first step is to choose between a full move to the cloud or a hybrid setup.

Migration choice Number of  InterSystems IRIS deployments after migration Characteristics
Lift & Shift: full move to cloud 1 Local on-premises setup moved to a cloud-based architecture
Hybrid Cluster: on-prem plus cloud mirror copy (“stretch cluster”) 2 On-premises cluster mirrored to an asynchronously updated, read-only cloud copy

The Lift & Shift choice allows leveraging of cloud benefits while maintaining ownership of a single copy of InterSystems IRIS.

The Hybrid choice combines the stability and familiarity of on-premises systems with the flexibility and scalability of the cloud.

See our online documentation for more information on Mirroring.

Multi-Tenant vs. Single Tenant Architecture with InterSystems IRIS

Although migration does not require changes to your tenancy method, the cloud offers powerful options for scaling and billing. For this reason, you may want to re-evaluate your tenancy model. For any of our offerings, when deploying InterSystems IRIS applications in the cloud, companies can choose between the following architectures for multiple customers:

  • Single Tenant: Multiple deployments; one for each of your customers.
  • Multi-Tenant: Multiple customers on a single deployment.

Each architecture offers distinct advantages and drawbacks. This is especially important for application and solution providers with solutions built with InterSystems IRIS technology that have large numbers of customers, are destined for major expansion, or that house sensitive or regulated data.

Scaling of Resources and Operations

  • Multi-Tenant: Scaling a multi-tenant environment involves adding resources to a single shared instance for each customer (tenant), which can be more cost-effective and simpler to manage. However, the performance of one tenant can affect others if adequate resources are not allocated, leading to resource contention.
  • Single Tenant: Scaling a single tenant environment means provisioning more resources for each customer individually. While this offers more predictable performance, the need for additional infrastructure and management overhead can make this choice more complex to scale.

Isolation of Data

  • Multi-Tenant: In a multi-tenant configuration, multiple tenants share the same instance of the application and database. Data isolation is achieved through softwarelevel partitioning, ensuring that each tenant’s data remains secure and separate from others. This approach can be efficient in its use of resources but can require robust security measures to prevent data breaches.
  • Single Tenant: With a single tenant architecture, each customer has a separate instance of the application and database. This setup provides a higher level of data isolation, as each tenant’s data resides in a separate environment. This choice can be more secure and easier to manage, facilitating compliance with data protection regulations. 

Migration Methods

Multiple approaches are available to migrate your InterSystems IRIS solution from on-premises to the cloud service of your choice.

The two most common methods are described next. They both start with the same step of mirroring an existing deployment to the cloud, but then diverge.

Choosing Mirror or Lift-and-Shift

Both the mirror method and the lift-and-shift method start by copying your existing InterSystems IRIS from on-prem to a cloud platform. Once the cloud copy is synchronized with the on-prem instance, you make a final choice of where the migration path ends:

  • Mirror: Continue to use the on-prem instance as primary and the cloud instance for backup and read-only operations, like analytics and machine learning. The cloud instance is asynchronous but periodically updated.
  • Lift-and-Shift: With the on-prem primary instance and the cloud-based secondary instances now in sync, “fail over” operations from the on-prem instance to the cloud copy, which now becomes the primary subsequently for all operations (not just readonly). At that point, the on-prem deployment can be archived as a snapshot backup.

Mirroring your existing local InterSystems IRIS instance to the cloud is the most common, resilient, and straightforward way to migrate your on-prem deployment. For more information, see the Server Migration Guide in our online documentation.


More articles on the subject:

Source: Lifting InterSystems IRIS to the Cloud

Discussion (0)0
Log in or sign up to continue
Announcement
· Apr 8

Vídeos do InterSystems Developers, Recapitulação Março 2025

Olá e Bem-vindos a recapitulação do canal da Comunidade de Desenvolvedores no YouTube de Março de 2025.
 
InterSystems Global Summit
By Andreas Dieckow, Amy Farley
By Timothy Leavitt, Gerrit Henning, Stephan du Plooy
By Keren Skubach, Vic Sun, Steve Mallam
FHIR Object Model
By Patrick Jamieson, Jaideep Majumdar 
"Code to Care" vídeos
Is your data ready for AI?
By Don Woodlock, Head of Global Healthcare Solutions, InterSystems
Energy Consumption for AI
By Jessica Jowdy, Manager of Healthcare Sales Engineering, InterSystems
Mais de Desenvolvedores InterSystems 
[Hebrew Webinar]: GenAI + RAG - Leveraging Intersystems IRIS as your Vector DB
By Ariel Glikman, Sales Engineer InterSystems Israel
A better way of buidling index for IRIS
By Mihoko Iijima, Training Sales Engineer, InterSystems
Quick wins with InterSystems IRIS Vector DB
By Vivian Lee, Applications Developer, InterSystems
Building and Deploying React Frontend for the InterSystems FHIR server in 20 minutes with Lovable AI
By Evgeny Shvarov, Senior Manager of Developer and Startup Programs, InterSystems
Unlocking Hands-On Learning with Instruqt
By Dean Andrews, Head of Developer Relations, InterSystems
Developer Ecosystem: Latest News
By Dean Andrews, Head of Developer Relations, InterSystems
Discussion (0)1
Log in or sign up to continue
Question
· Apr 8

Best Practices for Git Integration with Developer Namespaces in IRIS

Greetings,

Our team is transitioning to Git in the foreseeable future, and I'm trying to figure out how to design the best development workflow. Being new to IRIS, I am having trouble wraping my head around a few concepts.

Current Setup:

  • All code is hosted on a remote server
  • Each developer works in their own dedicated Namespace, on that server
  • Classes are locked to avoid conflicts
  • Committed code is imported into the Development NS, then redestributed to developers

Challenge:

Initially, I assumed we could replace this setup with Git Branches, following a typical workflow (one shared repository, developers work in feature branches, merge into staging). But I’ve realized that while branches isolate code, they do not isolate runtime environments the way namespaces do.

Question:

What are the architectural options here?

  • Is it common to assign one repository per namespace?
  • If so, how are changes across namespaces coordinated and merged into a staging or production namespace?
  • Has anyone transitioned from a "namespace-per-dev" model to Git, and how did you handle runtime vs. version control isolation?

Thanks in advance for any insight or examples of how this is typically done in real-world IRIS projects.

Edit: We're planning to use the git-source-control package (https://github.com/intersystems/git-source-control) and work with both, the deprecated Iris Studio and VSCode (based on Developer preference). This should also have some impact, as you cannot easily change branches within Studio if I understand correctly.

2 Comments
Discussion (2)4
Log in or sign up to continue
Discussion (3)2
Log in or sign up to continue
Article
· Apr 8 10m read

SQL statistics with Grafana, InfluxDB, and Telegraf

Introduction

Database performance has become a critical success factor in a modern application environment. Therefore identifying and optimizing the most resource-intensive SQL queries is essential for guaranteeing a smooth user experience and maintaining application stability. 

This article will explore a quick approach to analyzing SQL query execution statistics on an InterSystems IRIS instance to identify areas for optimization within a macro-application.

Rather than focusing on real-time monitoring, we will set up a system that collects and analyzes statistics pre-calculated by IRIS once an hour.  This approach, while not enabling instantaneous monitoring, offers an excellent compromise between the wealth of data available and the simplicity of implementation. 

We will use Grafana for data visualization and analysis, InfluxDB for time series storage, and Telegraf for metrics collection.  These tools, recognized for their power and flexibility, will allow us to obtain a clear and exploitable view.

More specifically, we will detail the configuration of Telegraf to retrieve statistics. We will also set up the integration with InfluxDB for data storage and analysis, and create customized dashboards in Grafana. This will help us quickly identify queries requiring special attention.

To facilitate the orchestration and deployment of these various components, we will employ Docker.

logos.png

Prerequisites

Before you start, make sure you have the following:

  • Git: Git is required to clone the project repository containing configuration files and scripts.
  • Docker or Docker Desktop: Docker can be used to containerize InfluxDB, Telegraf, and Grafana applications, making them easier to deploy and manage.
  • InterSystems IRIS instance:At least version 2022.1, ideally 2023.1 or higher, with the sql-stats-api package installed.  This package is essential for exposing IRIS SQL statistics and enabling Telegraf to collect them. [Link to OpenExchange]

Although our docker-compose includes an IRIS instance, it will not contain any SQL statistics data since it is freshly built and started. Therefore it will not be a convenient choice for testing the system. That is why we strongly recommend that you have another “active” IRIS instance (the one with a history of SQL queries) to have the ability to visualize real data and test the analysis tool.

About statistics

IRIS collects SQL query execution statistics at hourly and daily granularity. Hourly statistics identify performance variations throughout the day, whereas daily statistics provide an overview of database activity.

Below you can see the data we will collect for each SQL query:

  • Number of executions: It Indicates the number of times the query has been executed.
  • Total execution time: It measures the total execution time of the query.
  • Variance of execution times: It is used to identify performance variations and one-off problems.
  • Total number of rows returned (RowCount): Available for IRIS 2023.1 and higher, this metric indicates the total number of rows returned by the query. It can help you identify resource-hungry queries.
  • Total number of commands executed: Also available for IRIS 2023.1 and up, this metric facilitates a more detailed analysis of database activity, and pinpoints queries that could be optimized by reducing the number of operations.

This information can be accessed via the following tables:

  • INFORMATION_SCHEMA.STATEMENT_DAILY_STATS
  • INFORMATION_SCHEMA.STATEMENT_HOURLY_STATS

These tables have been available since IRIS 2022.1. Below we placed an example of an SQL query to retrieve statistics:

SELECT ds.* 
FROM INFORMATION_SCHEMA.STATEMENT_DAILY_STATS ds
INNER JOIN INFORMATION_SCHEMA.STATEMENTS st On ds.Statement = st.Hash


SELECT DATEADD('hh',"Hour",$PIECE(hs."Day",'||',2)) As DateTime, hs.*
FROM INFORMATION_SCHEMA.STATEMENT_HOURLY_STATS hs
INNER JOIN INFORMATION_SCHEMA.STATEMENTS st On $PIECE(hs."Day",'||',1) = st.Hash

For versions older than IRIS 2022.1, I highly recommend the article by David Loveluck, which explains how to retrieve similar statistics.

Architecture

The project is based on the interaction of four key components: IRIS, Grafana, InfluxDB, and Telegraf. The diagram below illustrates the overall architecture of the system and the flow of data between various components:

archi.png

  • InterSystems IRIS: It is the instance we will utilize to retrieve statistics.
  • Package sql-stats-api: This ObjectScript package exposes IRIS statistical data via the REST API. It offers two output formats: JSON for general use and Line Protocol, a format optimized for rapid ingestion of time series data into InfluxDB.
  • Telegraf: It is a metrics collection agent that provides the link between IRIS and InfluxDB. In this project, we will use two instances of Telegraf:
    • One agent periodically queries the IRIS REST API to retrieve SQL statistics in real time.
    • Another agent operates in “directory scan” mode. It monitors a directory with stored files and transmits them to InfluxDB, enabling the integration of data inaccessible via the REST API.
  • InfluxDB:  This time series database stores and manages the SQL statistics collected by Telegraf since its architecture is optimized for this data type. InfluxDB also offers native integration with Grafana, facilitating data visualization and analysis. We chose InfluxDB over Prometheus because the latter is more geared towards real-time monitoring and is not well suited for storing aggregated data, e.g., sums or averages per hour or day, which are essential for our analysis.
  • Grafana: It is a visualization tool that lets you create customized, interactive dashboards to analyze SQL performance. It retrieves data from InfluxDB and offers a variety of graphs and widgets to visualize statistics clearly and usably.

Installation

Start by cloning the repository:

git clone https://github.com/lscalese/iris-sql-dashboard.git
cd irisiris-sql-dashboard

Setting up the environment

This project uses Docker to orchestrate Grafana, InfluxDB, Telegra, and IRIS. For security reasons, such sensitive information as API keys and passwords is stored in a .env file.

Create the .env file using the example provided below:

cp .env.example .env

Edit the .env file to configure the variables:

Variable configuration

  • TZ: Time zone. You should modify this variable according to your time zone to ensure correct time-stamped data.
  • DOCKER_INFLUXDB_INIT_PASSWORD: This is the Administrator password to access InfluxDB.
  • IRIS_USER: It is an IRIS user of the IRIS Docker instance (_system by default).
  • IRIS_PASSWORD : It is an IRIS Docker instance password (SYS by default).

API keys allow the following connections:

  • GRAFANA_INFLUX_API_KEY : Grafana <-> InfluxDB.
  • TELEGRAF_INFLUX_API_KEY : Telegraf <-> InfluxDB.

API Key Generation

For security reasons, InfluxDB requires API keys for authentication and authorization.  Those keys are used to identify and authorize various components (Telegraf, Grafana) to access Influx DB.

The init-influxdb.sh script, included in the repository, facilitates the generation of these keys.  It will be run automatically the first time the infxludb2 container is started:

docker compose up -d influxdb2

After a few seconds, the .env file will be updated with your generated API keys.

Note: this step should only be performed the first time you start the container.

Check whether you have access to the InfluxDB administration interface via the URL http://localhost:8086/

Log in with the “admin” login and password specified in the “DOCKER_INFLUXDB_INIT_PASSWORD” environment variable in the “.env” file. When Browsing “Load Data >> Buckets”, you should discover a pre-configured “IRIS_SQL_STATS” buckets.   

influxdb-2.png

While going through “Load Data >> API Tokens”, you should locate our 2 API keys: “Grafana_IRIS_SQL_STATS” and “Telegraf_IRIS_SQL_STATS”:

influxdb-3.png

The environment is ready now, and we can move on to the next step!

Start

Since the environment has been configured and the API keys have been generated, you can finally launch the container set. Do to that, run the following command in the project root directory:

docker compose up -d

This command will start all the services defined in the docker-compose.yml file in the background: InfluxDB, Telegraf, Grafana, and the IRIS instance.

Dashboard Grafana

Grafana is now available at http://localhost:3000.

Connect to Grafana

Open your web browser and go to http://localhost:3000. The default username and password are admin/admin. However, you will be prompted to change the password the first time you log in.

grafana-login.png

Checking the InfluxDB data source

The InfluxDB data source is pre-configured in Grafana. All you need to do is to check if it is working properly.

Go to “Connections > Data sources”.

grafana-ds.png

You should see a data source named “influxdb”.Click it to modify it.

Then click “Save & Test”. The message “Datasource is working. 1 bucket found” should appear on the screen now.

grafana-datasources-influxdb.png

Exploring dashboards

At this point, you have verified that communication between Grafana and InfluxDB is established, meaning you can explore the predefined dashboards.

Proceed to “Dashboards”.

grafana-dashboard-list.png

You'll find encounter two predefined dashboards:

  • InfluxDB - SQL Stats: This dashboard displays general SQL query execution statistics, e.g., number of executions, total execution time, and execution time variance.
  • InfluxDB - SQL Stats Details: This dashboard provides more detailed information on each SQL query, e.g., the total number of returned rows or executed commands.

Why dashboards are empty

If you open the dashboards, you will notice that they are empty.  This is because our Telegraf agent is currently connected to the IRIS instance provided in the Docker repository, which contains no statistical data in its tables. SQL statistics are only collected if the IRIS instance is active and retains a history of SQL queries.

In the next section, we will explore how to inject data into the IRIS instance to view statistics in Grafana.

 

Telegraf

The monitoring system operates two Telegraf agents with specific roles:

  • telegraf-iris.conf:This agent collects real-time data from an active IRIS instance. It queries the IRIS REST API to retrieve SQL statistics to send them to InfluxDB.
  • telegraf-directory-scan.conf: This agent integrates historical data stored in files. It monitors the ./telegraf/in/ directory, reads files containing SQL statistics, and sends them to InfluxDB.

To collect real-time data, you should connect Telegraf to an active IRIS instance with the installed sql-stats-api package.  This package exposes SQL statistics via a REST API, enabling Telegraf to access them.

Configuring telegraf-iris.conf

To connect Telegraf to your IRIS instance, you must to modify the ./telegraf/config/telegraf-iris.conf. Belowyou can find an example of the configuration:

[[inputs.http]]
  ## One or more URLs from which to read formatted metrics
  urls = [
    "http://iris:52773/csp/sqlstats/api/daily",
    "http://iris:52773/csp/sqlstats/api/hourly"
  ]
  ## HTTP method
  method = "GET"

  ## Optional HTTP headers
  headers = {"Accept" = "text/plain"}
  ## Optional HTTP Basic Auth Credentials
  username = "${IRIS_USER}"
  password = "${IRIS_PASSWORD}"
  data_format = "influx"

Ensure that the ${IRIS_USER} and ${IRIS_PASSWORD} are correctly defined in your .env file.
Note: You can copy the file and edit the parameters to connect Telegraf to several IRIS instances.

Restart Telegraf:

After modifying the configuration file, you need to restart the Telegraf container for the changes to take effect:

docker compose up -d telegraf --force-recreate

Retrieving historical data

To retrieve historical SQL statistics, use the ObjectScript CreateInfluxFile method on your IRIS instance:

; Adapt the path to your needs
Set sc = ##class(dc.sqlstats.services.SQLStats).CreateInfluxFile("/home/irisowner/dev/influxdb-lines.txt",,1)

This script will write the SQL statistics history in text files, with a maximum length of 10,000 lines per file. You can then place those files in the ./telegraf/in/ directory to process them and inject them into InfluxDB.

Checking data injection

You can verify that data has been accurately injected into InfluxDB with the help of the web interface. Go to the “Data Explorer” and check it out:

influxdb-explorer.png

Data visualization in Grafana

Once the data has been injected, you can view it in your provisioned Grafana dashboards.

grafana-dashboard-daily-stats.png

grafana-dashboard-daily-details.png

We have come to the end of this article. I hope it was useful for you and taught you how to easily set up a system for monitoring and analyzing SQL statistics on your IRIS instances.

As you might have noticed, this article focused on the practical aspects of configuring and employing various tools. We have not researched all the details of the inner workings of InfluxDB, the Line Protocol format, or the Flux Query language, nor did we examine the multitude of plugins available for Telegraf.

Those topics, however fascinatingthey are, would have required a much longer article.  I strongly encourage you to consult the official documentation for InfluxDB Get started with InfluxDB and Telegraf Plugin Directory to deepen your knowledge and discover all the possibilities offered by these tools.

Do not hesitate to share your experiences in the comments.

Thanks for reading, and see you soon!

Discussion (0)1
Log in or sign up to continue