New post

Find

Article
· Mar 29, 2024 2m read

.NET Client-Side Development on IRIS Data Platform

InterSystems IRIS provides a complete application development environment for building sophisticated data- and analytics-intensive applications that connect data and application silos. It is designed to work with all of the common development technologies in an open, standards-based fashion and supports both server-side and client-side programming.

InterSystems IRIS supports server-side application development with both Python and InterSystems ObjectScript. InterSystems IRIS also supports client-side development using many popular development technologies, including Java, C#/.NET, Node.js, Python, and ObjectScript.

The purpose of this article will be to focus on client-side development using a popular environment, the .NET development environment.

The ADO.NET Managed Provider, NET Native SDK, XEP API, and the Entity Framework Provider are a set of powerful APIs that combine to cover your bases regarding client-side InterSystems IRIS data platform development by leveraging the .NET framework.

ADO.NET Managed Provider

The ADO.NET Managed Provider is the InterSystems implementation of the ADO.NET data access interface, which will enable connection to IRIS from your .NET application, enabling the use of SQL queries to access data. The other three APIs use this underlying connection protocol.

.NET Native SDK

The .NET Native SDK will provide direct access to InterSystems IRIS objects, globals, and ObjectScript functionality, such as running classes and routines. Directly accessing globals, the fundamental storage structure for data in IRIS, can speed up data retrieval for your .NET application.

XEP API

The XEP API will facilitate high-speed access to InterSystems objects. This is most useful when working with high throughput objects with low to medium complexity.

The Entity Framework Provider and Object Relational Mapping (ORM)

The Entity Framework Provider is the InterSystems implementation of the Entity Framework, the object-relational mapping for ADO.NET.

  • What is Object-Relational Mapping or ORM?
    • A technique that lets you query and manipulate data from a database using an object-oriented paradigm. These techniques are often implemented as libraries, such as the SQLAlchemy library for Python.
    • If you're drawing a blank thinking of the equivalent library that implements ORM in IRIS, you should be. IRIS can be treated as a relational database (you can use SQL queries to query data stored in IRIS), so there is no need for a library implementing ORM techniques when ORM is built into the platform itself.

.NET developers can leverage any of these APIs alone or in conjunction with the stipulation of requiring the InterSystems.Data.IRISClient.dll assembly file to be referenced in their .NET project. Each API has its pros and cons, but a measured use of each one's capabilities provides a balanced approach to developing on the InterSystems IRIS data platform with the .NET Framework.

1 Comment
Discussion (1)1
Log in or sign up to continue
Question
· Mar 27, 2024

Test Objectscript code in VS Code

I used to mannually test objectscript code in InterSystems Studio.  Does anyone know how to do this is VS Code?

2 Comments
Discussion (2)2
Log in or sign up to continue
Article
· Mar 27, 2024 2m read

A Better data import experience for LOAD DATA

In recent versions of IRIS, a powerful new data loading command has been introduced to SQL: LOAD DATA. This feature has been highly optimized to import data into IRIS extremely fast, allowing hundreds of gigabytes of data to be inserted in seconds instead of hours or days. 

This is a very exciting improvement. However, a big problem in the data loading experience still exists. Namely, the time and hassle it takes to:

  1. Define the schema for the table in which you want to load data.
  2. Figure out the syntax for the LOAD DATA command.

I've developed a user interface that invisibly handles the CREATE TABLE step and then generates the syntax for LOAD DATA, all in a handy wizard!

At least in my case -- although I've been in the database business for decades -- I only import data a few times a year. Therefore, my CREATE TABLE skills get rusty, and it's really nice to have a tool take care of that for me. And this tool doesn't just handle syntax. It also inspects the input CSV file using a utility from the SQL Utilities library from @Benjamin De Boe to figure out the data types and their length. Then it asks a few more questions to define the syntax of the required LOAD DATA command. The app can run it, or you can just copy the syntax and tweak it yourself. 

Here's a walkthrough.

Step 1: Install the app and review the CSV file

After following the instructions to install the solution, you will have an Angular app published as a CSP application and a backend ObjectScript application that serves as the API to interface with the database.

Take a look at my sample data set (using the Rainbow CSV extension in VS Code). It has a mix of numeric, text and empty columns.

Step 2: Go to the app

You will probably find the app at http://localhost:52773/csp/dataloadapp/index.html if you use the default IRIS port and web application name.

Step 3: Specify the CSV file location

Step 4: Specify the CSV file's format

LOAD DATA needs to know some things like the column delimiter character and where to start in the file. 

Step 5: Define a destination table name, with the schema name as well

Step 6: Fine tune the field names and data types

Most of this will be filled in for you, and should be pretty accurate, but you will probably want to adjust some names or field lengths.

And that's it! Press "Load CSV" and the client-side app will make a call to the server to run a CREATE TABLE SQL command, then run LOAD DATA with the syntax shown in the black box on the right. Going into the Management Portal (or any other SQL client), you can see I now have the CSV file loaded into IRIS.

 

I must apologize in advance that there isn't much error checking yet, but this is open source so if you find this tool useful, join me in improving it on GitHub.

7 Comments
Discussion (7)4
Log in or sign up to continue
Article
· Mar 25, 2024 10m read

新しい FHIR サーバープロファイルベースのバリデーション

バージョン 2023.3(InterSystems IRIS for Health)の新機能は、FHIR プロファイル基準の検証を実行する機能です。

(*)

この記事では、この機能の基本的な概要を説明します。

FHIR が重要な場合は、この新機能を絶対にお試しになることをお勧めします。このままお読みください。

Discussion (0)0
Log in or sign up to continue
Article
· Mar 24, 2024 5m read

Quickstart guide to IRIS DB on Linux Systems

Introduction

This is a quickstart guide to IRIS for Linux systems administrators who need to be able to support the IRIS DB as well as other normal infrastructure tasks.

IRIS is a DB system from Intersystems. An IRIS DB can hold code (in the form of a Class) or data (in the form of Globals). IRIS DB are Linux files called IRIS.DAT.

IRIS was previously called Cache. There may be some references to Cache in the Intersystems documentation or forums or in some of your system documentation.

IRIS classes are coded in language call ObjectScript. IRIS classes have properties and methods.

IRIS classes can be run as interactive jobs or as scheduled tasks all within IRIS.

 

IRIS code can be in terms of a procedure.

 

IRIS DBs are typically journalled in case transactions need to be rolled back or DBs need to be recovered from a backup via a rolled forward process.

 

IRIS DBs can be mirrored to provide a level of redundancy across 2 servers. If DBs are mirrored then the transaction updates must be committed to both mirror members before the application is advised that the update is successful. Intersystems terms the mirror members as “failover members”. One of the failover members is termed the PRIMARY and the other member is termed BACKUP.

 

There is also an arbiter node(server) so that there is a quorum. Quorum members “vote” as to which failover member has failed.

 

There can be a asynchronous mirror node. The asynchronous mirror node is updated on a store and forward basis from journals.

 

IRIS DB has a product called Ensemble that supports productions. There can be only one production per name space. Ensemble can be used to develop applications using a concept of Services (input queues), Processes (how to process the input queue) and Operations (output queue).

 

IRIS DB has a product called JReports for developing reports. The development of reports is intended to be like Crystal reports.

 

Interacting with IRIS

You can connect to IRIS with:

iris session <instance name>

 

You can find out how many instances there are defined on your system:

iris list

 

You can also connect to IRIS via the Management Portal which is GUI/web based.

 

There is also a command like interface called WebTerminal which is often installed.

 

IRIS is configured via a configuration/parameter file typically called iris.cpf.

The iris.cpf file will show the location of the IRIS.DAT file for each defined database. The iris.cpf file will also show the mirror configuration.

 

Namespace vs DB

DB files by convention live in a directory that has the name of the DB itself.

 

Namespace are a logical concept that stores data or code.

 

A namespace provides access to data and to code, which is stored (typically) in multiple databases. Databases (IRIS.DAT) are the physical manifestation of the namespace.

 

All InterSystems IRIS systems will have a namespace of “%SYS” and “USER”. There are other default namespaces:

https://docs.intersystems.com/irislatest/csp/docbook/DocBook.UI.Page.cls?KEY=GORIENT_enviro#GORIENT_enviro_namespace_system

 

Journalling

Journal records are written to journal files which are located on one of 2 directories/filesystems – a primary and secondary area. When the primary area is full then journals will be written to the  secondary area. When the secondary area is full then journals will be written to the  primary area.  When the primary area is full then journals will be written to the  secondary area….

Journal files are switched when backups start, backups finish, under operator control or when the configured journal size is exceeded.

When both journal areas are full then all transactions stop.

There is usually a scheduled task that deletes old journal based on the age (number of days prior to today) or the number of previous backups. The default is 2 days old or 2 backups completed. 

 

 

Objectscript

These are some basic commands:

DO <- run a class method or procedure that is stored in the namespace/database

SET <- assign a value to a variable. Variable can be set to a literal or output from a method or class property. Variables do not need to be declared.

KILL <- deletes a variable

WRITE <- write text or variable contents or combination

 

Variable names are case-sensitive.

 

If the variable name starts with a ^ then it is a global. Global are multi dimensional storage areas. Where the variable is a global (variable name starting with ^) this structure is written persistently to the namespace then to the database(s).

Intersystems documentation says:

In InterSystems IRIS, a database contains globals and nothing else; even code is stored in globals. At the lowest level, all access to data is done via direct global access — that is, by using commands and functions that work directly with globals.”

 

All other variables only exist in current user session.

 

If the name with DO  starts with a ^ then it is a procedure. For example

DO ^MIRROR

DO ^JOURNAL

 

ZN “%SYS” <- Change namespace

set status=##class(%SYS.Journal.System). GetState() <- Get the journal status

write $CASE(status,                                                          <- Print the journal status using a case statement

            0:"Enabled",1:"Disabled",2:"Suspended",

            3:"Frozen",4:"Paused")

 

List all namespaces

DO ##class(%SYS.Namespace).ListAll(.result)

zwrite result

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