Search

Clear filter
Article
Timothy Leavitt · Jun 28, 2022

Unique indices and null values in InterSystems IRIS

An interesting pattern around unique indices came up recently (in internal discussion re: isc.rest) and I'd like to highlight it for the community. As a motivating use case: suppose you have a class representing a tree, where each node also has a name, and we want nodes to be unique by name and parent node. We want each root node to have a unique name too. A natural implementation would be: Class DC.Demo.Node Extends %Persistent { Property Parent As DC.Demo.Node; Property Name As %String [ Required ]; Index ParentAndName On (Parent, Name) [ Unique ]; Storage Default { <Data name="NodeDefaultData"> <Value name="1"> <Value>%%CLASSNAME</Value> </Value> <Value name="2"> <Value>Parent</Value> </Value> <Value name="3"> <Value>Name</Value> </Value> </Data> <DataLocation>^DC.Demo.NodeD</DataLocation> <DefaultData>NodeDefaultData</DefaultData> <IdLocation>^DC.Demo.NodeD</IdLocation> <IndexLocation>^DC.Demo.NodeI</IndexLocation> <StreamLocation>^DC.Demo.NodeS</StreamLocation> <Type>%Storage.Persistent</Type> } } And there we go! But there's a catch: as it stands, this implementation allows multiple root nodes to have the same name. Why? Because Parent is not (and shouldn't be) a required property, and IRIS does not treat null as a distinct value in unique indices. Some databases (e.g., SQL Server) do, but the SQL standard says they're wrong [citation needed; I saw this on StackOverflow somewhere but that doesn't really count - see also @Daniel.Pasco 's comment below on this and the distinction between indices and constraints]. The way to get around this is to define a calculated property that's set to a non-null value if the referenced property is null, then put the unique index on that property. For example: Property Parent As DC.Demo.Node; Property Name As %String [ Required ]; Property ParentOrNUL As %String [ Calculated, Required, SqlComputeCode = {Set {*} = $Case({Parent},"":$c(0),:{Parent})}, SqlComputed ]; Index ParentAndName On (ParentOrNUL, Name) [ Unique ]; This also allows you to pass $c(0) to ParentAndNameOpen/Delete/Exists to identify a root node uniquely by parent (there isn't one) and name. As a motivating example where this behavior is very helpful, see https://github.com/intersystems/isc-rest/blob/main/cls/_pkg/isc/rest/resourceMap.cls. Many rows can have the same set of values for two fields (DispatchOrResourceClass and ResourceName), but we want at most one of them to treated as the "default", and a unique index works perfectly to enforce this if we say the "default" flag can be set to either 1 or null then put a unique index on it and the two other fields. Maybe I'm missing something, but, beyond how nulls are treated, if you want parent to be unique within this definition you must define a unique index on parent (alone). The index you have defined only guarantees that the combination (parent, name) will be unique. Even if you declare the property as required it wouldn't still solve the uniqueness requirement. parameter INDEXNULLMARKER; Override this parameter value to specify what value should be used as a null marker when a property of the type is used in a subscript of an index map. The default null marker used is -1E14, if none is specfied for the datatype. However %Library.PosixTime and %Library.BigInt datatypes could have values that collate before -1E14, and this means null values would not sort before all non-NULL values. For beauty, I would also use the value of this parameter, for example:Class dc.test Extends %Persistent { Property idp As dc.test; Property idpC As %Integer(INDEXNULLMARKER = "$c(0)") [ Calculated, Private, Required, SqlComputeCode = {s {*}=$s({idp}="":$c(0),1:{idp})}, SqlComputed ]; Property Name As %String [ Required ]; Index iUnq On (idpC, Name) [ Unique ]; ClassMethod Test() { d ..%KillExtent() &sql(insert into dc.test(Name,idp)values('n1',1)) w SQLCODE,! ;0 &sql(insert into dc.test(Name,idp)values('n2',1)) w SQLCODE,! ;0 &sql(insert into dc.test(Name,idp)values('n2',1)) w SQLCODE,!! ;-119 &sql(insert into dc.test(Name,idp)values('n1',null)) w SQLCODE,! ;0 &sql(insert into dc.test(Name,idp)values('n2',null)) w SQLCODE,! ;0 &sql(insert into dc.test(Name,idp)values('n2',null)) w SQLCODE,!! ;-119 zw ^dc.testD,^dc.testI } }Output:USER>d ##class(dc.test).Test() 0 0 -119 0 0 -119 ^dc.testD=4 ^dc.testD(1)=$lb("",1,"n1") ^dc.testD(2)=$lb("",1,"n2") ^dc.testD(3)=$lb("","","n1") ^dc.testD(4)=$lb("","","n2") ^dc.testI("iUnq",1," N1",1)="" ^dc.testI("iUnq",1," N2",2)="" ^dc.testI("iUnq",$c(0)," N1",3)="" ^dc.testI("iUnq",$c(0)," N2",4)="" OrProperty idpC As %Integer [ Calculated, Private, Required, SqlComputeCode = {s {*}=$s({idp}="":$$$NULLSubscriptMarker,1:{idp})}, SqlComputed ]; Output:USER>d ##class(dc.test).Test() 0 0 -119 0 0 -119 ^dc.testD=4 ^dc.testD(1)=$lb("",1,"n1") ^dc.testD(2)=$lb("",1,"n2") ^dc.testD(3)=$lb("","","n1") ^dc.testD(4)=$lb("","","n2") ^dc.testI("iUnq",-100000000000000," N1",3)="" ^dc.testI("iUnq",-100000000000000," N2",4)="" ^dc.testI("iUnq",1," N1",1)="" ^dc.testI("iUnq",1," N2",2)="" What about defining a super parent, which is the only node with a NULL parent? In that case every other root node has this node as a parent and filtering is easy (WHERE parent IS NULL filters only the super parent). And there's no need for an additional calculated property in that case. Thank you for pointing this out! I saw this in docs but believe it wouldn't work for object-valued properties. There would still need to be some enforcement of the super parent being the only node with a NULL parent (and the point here is that the unique index wouldn't do that). Also finding all of the top-level nodes (assuming we could have multiple independent trees) would be a slightly more complicated. I have to throw in my opinions and possibly a few facts regarding nulls and unique constraints. IRIS Unique index - this is primarily a syntactical shortcut as it defines not only an index but also a unique constraint on the index key. Most pure SQL implementations don't merge the two concepts and the SQL standard doesn't define indexes. The SQL Standard does define unique constraints. Keep in mind that both IDKEY and PRIMARYKEY are modifiers of a unique constraint (and, in our world, the index defined as IDKEY is also special). There can be at most one index flagged as IDKEY and one that is flagged as PRIMARYKEY. An index can be both PRIMARYKEY and IDKEY. There was once an SQL implementation that defined syntax for both "unique index" and "unique constraint" with different rules. The difference between them was simple - if an index is not fully populated (not all rows in the table appear in the index - we call this a conditional index) then the unique index only checked for uniqueness in the rows represented in the index. A unique constraint applies to all rows. Also keep in mind that an index exists for a singular purpose - to improve the performance of a subset of queries. Any SQL constraint can be expressed as a query. The SQL Standard is a bit inconsistent when it comes to null behavior. In the Framework document there is this definition: A unique constraint specifies one or more columns of the table as unique columns. A unique constraint is satisfied if and only if no two rows in a table have the same non-null values in the unique columns. In the Foundation document, there exists two optional features, F291 and F292. These features define a unique predicate (291) and unique null treatment (292). These features appear to provide syntax where the user can define the "distinct-ness" of nulls. Both are optional features, both are relatively recent (2003? 2008?). The rule when these features are not supported is left to the implementor. IRIS is consistent with the Framework document statement - all constraints are enforced on non-null keys only. A "null" key is defined as a key in which any key column value is null. Thank you Dan! The index/constraint distinction and SQL standard context are particularly helpful facts for this discussion. :) the best part of this article is "IRIS does not treat null as a distinct value in unique indices"
Announcement
Dmitry Maslennikov · Sep 16, 2022

InterSystems extension for Docker Desktop is now published

Great news, the extension to Docker Desktop for InterSystems Container Registry is now publicly available for everyone. It is already available in the marketplace in Docker Desktop. It was published today, and it requires restarting Docker Desktop to see it. Feel free to post any feedback in the GitHub repository, here
Question
Robson Tenorio · Oct 14, 2022

InterSystems Caché - ARM64 ODBC driver

Hi! Is there any ARM64 ODC driver available for InterSystems Caché? It would be really very useful! There is not. Cache has not been ported to ARM64. IRIS has ARM ODBC drivers if that's an option for your application.
Announcement
Anastasia Dyubaylo · May 30, 2022

[WEBINAR] InterSystems IRIS Tech Talk: Python

Hey Developers, You're very welcome to join the upcoming InterSystems webinar called "InterSystems IRIS Tech Talk: Python"! Date: Wednesday, June 08, 2022Time: 11:00 AM EDT In this tech talk, we’ll go into detail about the breadth of support Python developers have using the InterSystems IRIS data platform, including: Python running inside the database kernel for fast data access and seamless interaction with ObjectScript The InterSystems IRIS Python SDK, which includes Python Native API for accessing native InterSystems IRIS data structures for ultimate flexibility DB-API driver, which enables seamless access to InterSystems IRIS from compliant applications Python Gateway to enable InterSystems IRIS to execute Python code out-of-process – even out-of-server – from the InterSystems IRIS kernel There will be time for Q&A at the end. Speakers:🗣 @Raj.Singh5479, Product Manager, Developer Experience, InterSystems🗣 @Robert.Kuszewski, Product Manager, Developer Experience, InterSystems ➡️ Register for the webinar today! Hey Developers, The recording of this webinar is available on InterSystems Developers YouTube! Please welcome: ⏯ InterSystems IRIS Tech Talk: Python
Announcement
Anastasia Dyubaylo · Jun 23, 2022

[Webinar] InterSystems IRIS Tech Talk: Kafka

Hey Community, In this webinar, we’ll discuss how you can now easily integrate Apache Kafka within InterSystems IRIS data platform, including via interoperability productions and programmatically via API calls, as both a producer as well as a consumer of Apache Kafka messages: ⏯ InterSystems IRIS Tech Talk: Kafka Presenters:🗣 @Kinshuk.Rakshith, InterSystems Sales Engineer🗣 @Robert.Kuszewski, InterSystems Product Manager Enjoy watching the new video on InterSystems Developers YouTube and stay tuned!
Article
Michael Braam · Aug 17, 2022

Leveraging the external messaging API in InterSystems IRIS

Being interoperable is more and more important nowadays. InterSystems IRIS 2022.1 comes with a new messaging API to communicate with event streaming platforms like Kafka, AWS SQS/SNS, JMS and RabbitMQ.This article shows how you can connect to Kafka and AWS SQS easily.We start with a brief discussion of the basic concepts and terms of event streaming platforms. Event streaming platforms purpose and common terms Event streaming platforms like Kafka or AWS SQS are capable to consume a unbound stream of events in a very high frequency and can react to events. Consumers read the data from streams for further processing. They are often used in IoT environments. Common terms in this arena are: Topic/Queue, the place where data is stored Producer, creates and sends data (events, messages) to a topic or queue Consumer, reads events/messages from one or more topics or queues Publish/Subscribe, producers send data to a queue/topic (publish), consumers subscribe to a topic/queue and get automatically notified if new data arrives Polling, consumers have to actively poll a topic/queue for new data Why are they used? Decoupling of producers and consumers Highly scalable for real time data Do I really need them? As a InterSystems IRIS developer probably not, but you are not alone... The external messaging API The new API classes are located in the %External.Messaging package. It contains generic Client-, Settings- and Message classes. The specialized classes for Kafka, AWS SQS/SNS, JMS, RabbitMQ are subclasses of these generic classes. The basic communication flow is: Create a settings object for your target platform. This is also responsible for the authentication against the target platform. Create a specific client object and pass the settings object to it Create a message object and send it to the target. The following sections demonstrate how you can communicate with Kafka and AWS SQS (Simple Queue Service). Interacting with Kafka Let's start with a Kafka example. First we create a class which leverages the new %External Messaging API to create a topic, send and receive a message to and from Kafka. It first creates a Kafka settings object set tSettings = ##class(%External.Messaging.KafkaSettings).%New() set tSettings.servers = $$$KAFKASERVER set tSettings.groupId = "iris-consumer" After setting the Kafka server address it sets a Kafka group id.With these settings a Kafka client object is created: set tClient = ##class(%External.Messaging.Client).CreateKafkaClient(tSettings.ToJSON(),.tSc) It then creates a topic by invoking the CreateTopic() method of the Kafka client: Set tSC = tClient.CreateTopic(pTopicName,tNumberOfPartitions,tReplicationFactor) Below is the full code sample: Include Kafka.Settings Class Kafka.api [ Abstract ] { ClassMethod CreateTopic(pTopicName As %String) As %Status { #dim tSc as %Status = $$$OK try { set tSettings = ##class(%External.Messaging.KafkaSettings).%New() set tSettings.servers = $$$KAFKASERVER set tSettings.groupId = "iris-consumer" set tClient = ##class(%External.Messaging.Client).CreateKafkaClient(tSettings.ToJSON(),.tSc) $$$ThrowOnError(tSc) Set tNumberOfPartitions = 1 Set tReplicationFactor = 1 Set tSC = tClient.CreateTopic(pTopicName,tNumberOfPartitions,tReplicationFactor) $$$ThrowOnError(tSC) $$$ThrowOnError(tClient.Close()) } catch tEx { set tSc = tEx.AsStatus() } return tSc } } After creating a topic we can send and receive messages from Kafka. The code is similiar to the above code ClassMethod SendMessage(pMessage As %String, pTopic As %String) As %Status { #dim tSettings as %External.Messaging.KafkaSettings #dim tClient as %External.Messaging.KafkaClient #dim tMessage as %External.Messaging.KafkaMessage #dim tSc as %Status = $$$OK try { set tSettings = ##class(%External.Messaging.KafkaSettings).%New() set tSettings.servers = $$$KAFKASERVER set tSettings.groupId = "iris-consumer" set tMessage = ##class(%External.Messaging.KafkaMessage).%New() set tMessage.topic = pTopic set tMessage.value = pMessage set tClient = ##class(%External.Messaging.Client).CreateKafkaClient(tSettings.ToJSON(),.tSc) $$$ThrowOnError(tSc) Set producerSettings = "{""key.serializer"":""org.apache.kafka.common.serialization.StringSerializer""}" $$$ThrowOnError(tClient.UpdateProducerConfig(producerSettings)) $$$ThrowOnError(tClient.SendMessage(tMessage)) $$$ThrowOnError(tClient.Close()) } catch tEx { set tSc = tEx.AsStatus() } return tSc } ClassMethod ReceiveMessage(pTopicName As %String, pGroupId As %String = "iris-consumer", Output pMessages) As %Status { #dim tSettings as %External.Messaging.KafkaSettings #dim tClient as %External.Messaging.KafkaClient #dim tMessage as %External.Messaging.KafkaMessage #dim tSc as %Status = $$$OK try { set tSettings = ##class(%External.Messaging.KafkaSettings).%New() set tSettings.servers = $$$KAFKASERVER set tSettings.groupId = pGroupId set tClient = ##class(%External.Messaging.Client).CreateKafkaClient(tSettings.ToJSON(),.tSc) $$$ThrowOnError(tSc) Set producerSettings = "{""key.serializer"":""org.apache.kafka.common.serialization.StringSerializer""}" $$$ThrowOnError(tClient.UpdateProducerConfig(producerSettings)) $$$ThrowOnError(tClient.ReceiveMessage(pTopicName, .pMessages)) $$$ThrowOnError(tClient.Close()) } catch tEx { set tSc = tEx.AsStatus() } return tSc } Let's try it. I have a Kafka instance running and first we create a topic community with the CreateTopic method above: Please ignore the log4j warnings here. The method returns a status code OK. So the topic was created. Next let's send a message to this topic. To verify that the message is sent to the topic, I have a generic Kafka consumer running. This consumer listens to the topic community: So let's send a message to this topic. I'll send a JSON-String to it, but basically you can send any message format to a topic. Let's check if the consumer received the message: The message was successfully received by the consumer. Receiving messages and deleting topics is similiar to the above sample. Below is the full sample implementation. The include file Kafka.settings only contains a macro definition: #define KAFKASERVER <Kafka server location and port>. Include Kafka.Settings Class Kafka.api [ Abstract ] { ClassMethod CreateTopic(pTopicName As %String) As %Status { #dim tSc as %Status = $$$OK try { set tSettings = ##class(%External.Messaging.KafkaSettings).%New() set tSettings.servers = $$$KAFKASERVER set tSettings.groupId = "iris-consumer" set tClient = ##class(%External.Messaging.Client).CreateKafkaClient(tSettings.ToJSON(),.tSc) $$$ThrowOnError(tSc) Set tNumberOfPartitions = 1 Set tReplicationFactor = 1 Set tSC = tClient.CreateTopic(pTopicName,tNumberOfPartitions,tReplicationFactor) $$$ThrowOnError(tSC) $$$ThrowOnError(tClient.Close()) } catch tEx { set tSc = tEx.AsStatus() } return tSc } ClassMethod DeleteTopic(pTopicName As %String) As %Status { #dim tSc as %Status = $$$OK try { set tSettings = ##class(%External.Messaging.KafkaSettings).%New() set tSettings.servers = $$$KAFKASERVER set tSettings.groupId = "iris-consumer" set tClient = ##class(%External.Messaging.Client).CreateKafkaClient(tSettings.ToJSON(),.tSc) $$$ThrowOnError(tSc) Set tNumberOfPartitions = 1 Set tReplicationFactor = 1 Set tSC = tClient.DeleteTopic(pTopicName) $$$ThrowOnError(tSC) $$$ThrowOnError(tClient.Close()) } catch tEx { set tSc = tEx.AsStatus() } return tSc } ClassMethod SendMessage(pMessage As %String, pTopic As %String) As %Status { #dim tSettings as %External.Messaging.KafkaSettings #dim tClient as %External.Messaging.KafkaClient #dim tMessage as %External.Messaging.KafkaMessage #dim tSc as %Status = $$$OK try { set tSettings = ##class(%External.Messaging.KafkaSettings).%New() set tSettings.servers = $$$KAFKASERVER set tSettings.groupId = "iris-consumer" set tMessage = ##class(%External.Messaging.KafkaMessage).%New() set tMessage.topic = pTopic set tMessage.value = pMessage set tClient = ##class(%External.Messaging.Client).CreateKafkaClient(tSettings.ToJSON(),.tSc) $$$ThrowOnError(tSc) Set producerSettings = "{""key.serializer"":""org.apache.kafka.common.serialization.StringSerializer""}" $$$ThrowOnError(tClient.UpdateProducerConfig(producerSettings)) $$$ThrowOnError(tClient.SendMessage(tMessage)) $$$ThrowOnError(tClient.Close()) } catch tEx { set tSc = tEx.AsStatus() } return tSc } ClassMethod ReceiveMessage(pTopicName As %String, pGroupId As %String = "iris-consumer", Output pMessages) As %Status { #dim tSettings as %External.Messaging.KafkaSettings #dim tClient as %External.Messaging.KafkaClient #dim tMessage as %External.Messaging.KafkaMessage #dim tSc as %Status = $$$OK try { set tSettings = ##class(%External.Messaging.KafkaSettings).%New() set tSettings.servers = $$$KAFKASERVER set tSettings.groupId = pGroupId set tClient = ##class(%External.Messaging.Client).CreateKafkaClient(tSettings.ToJSON(),.tSc) $$$ThrowOnError(tSc) Set producerSettings = "{""key.serializer"":""org.apache.kafka.common.serialization.StringSerializer""}" $$$ThrowOnError(tClient.UpdateProducerConfig(producerSettings)) $$$ThrowOnError(tClient.ReceiveMessage(pTopicName, .pMessages)) $$$ThrowOnError(tClient.Close()) } catch tEx { set tSc = tEx.AsStatus() } return tSc } } Interacting with AWS SQS How would you communicate with AWS SQS (Simple Queue Service)? The basic procedure is pretty similiar. But AWS requires authentication and AWS doesn't use the term topic. They talk about queues. You can send a message to a queue and consumers can receive messages from one or more queues. Similar to my api class above I've created something for AWS SQS. Class AWS.SQS.api [ Abstract ] { ClassMethod SendMessage(pMessage As %String, pQueue As %String) As %Status { #dim tSettings as %External.Messaging.SQSSettings #dim tMessage as %External.Messaging.SQSMessage #dim tClient as %External.Messaging.SQSClient #dim tSc as %Status = $$$OK try { $$$ThrowOnError(##class(AWS.Utils).GetCredentials(.tCredentials)) set tSettings = ##class(%External.Messaging.SQSSettings).%New() set tSettings.accessKey = tCredentials("aws_access_key_id") set tSettings.secretKey = tCredentials("aws_secret_access_key") set tSettings.sessionToken = tCredentials("aws_session_token") set tSettings.region = "eu-central-1" set tMessage = ##class(%External.Messaging.SQSMessage).%New() set tMessage.body = pMessage set tMessage.queue = pQueue set tClient = ##class(%External.Messaging.Client).CreateSQSClient(tSettings.ToJSON(),.tSc) $$$ThrowOnError(tSc) $$$ThrowOnError(tClient.SendMessage(tMessage)) } catch tEx { set tSc = tEx.AsStatus() } return tSc } ClassMethod ReceiveMessage(pQueueName As %String, Output pMessages) As %Status { #dim tSettings as %External.Messaging.SQSSettings #dim tClient as %External.Messaging.SQSClient #dim tSc as %Status = $$$OK try { $$$ThrowOnError(##class(AWS.Utils).GetCredentials(.tCredentials)) set tSettings = ##class(%External.Messaging.SQSSettings).%New() set tSettings.accessKey = tCredentials("aws_access_key_id") set tSettings.secretKey = tCredentials("aws_secret_access_key") set tSettings.sessionToken = tCredentials("aws_session_token") set tSettings.region = "eu-central-1" set tClient = ##class(%External.Messaging.Client).CreateSQSClient(tSettings.ToJSON(),.tSc) $$$ThrowOnError(tSc) $$$ThrowOnError(tClient.ReceiveMessage(pQueueName, .pMessages)) } catch tEx { set tSc = tEx.AsStatus() } return tSc } ClassMethod DeleteMessage(pQueueName As %String, pReceiptHandle As %String) As %Status { #dim tSettings as %External.Messaging.SQSSettings #dim tClient as %External.Messaging.SQSClient #dim tSc as %Status = $$$OK try { $$$ThrowOnError(##class(AWS.Utils).GetCredentials(.tCredentials)) set tSettings = ##class(%External.Messaging.SQSSettings).%New() set tSettings.accessKey = tCredentials("aws_access_key_id") set tSettings.secretKey = tCredentials("aws_secret_access_key") set tSettings.sessionToken = tCredentials("aws_session_token") set tSettings.region = "eu-central-1" set tClient = ##class(%External.Messaging.Client).CreateSQSClient(tSettings.ToJSON(),.tSc) $$$ThrowOnError(tSc) $$$ThrowOnError(tClient.DeleteMessage(pQueueName, pReceiptHandle)) } catch tEx { set tSc = tEx.AsStatus() } return tSc } ClassMethod CreateQueue(pQueueName As %String) As %Status { #dim tSettings as %External.Messaging.SQSSettings #dim tClient as %External.Messaging.SQSClient #dim tSQSSettings as %External.Messaging.SQSQueueSettings #dim tSc as %Status = $$$OK try { $$$ThrowOnError(##class(AWS.Utils).GetCredentials(.tCredentials)) set tSettings = ##class(%External.Messaging.SQSSettings).%New() set tSettings.accessKey = tCredentials("aws_access_key_id") set tSettings.secretKey = tCredentials("aws_secret_access_key") set tSettings.sessionToken = tCredentials("aws_session_token") set tSettings.region = "eu-central-1" set tClient = ##class(%External.Messaging.Client).CreateSQSClient(tSettings.ToJSON(),.tSc) $$$ThrowOnError(tSc) set tSQSSettings = ##class(%External.Messaging.SQSQueueSettings).%New() $$$ThrowOnError(tClient.CreateQueue(pQueueName,tSQSSettings)) } catch tEx { set tSc = tEx.AsStatus() } return tSc } ClassMethod DeleteQueue(pQueueName As %String) As %Status { #dim tSettings as %External.Messaging.SQSSettings #dim tClient as %External.Messaging.SQSClient #dim tSQSSettings as %External.Messaging.SQSQueueSettings #dim tSc as %Status = $$$OK try { $$$ThrowOnError(##class(AWS.Utils).GetCredentials(.tCredentials)) set tSettings = ##class(%External.Messaging.SQSSettings).%New() set tSettings.accessKey = tCredentials("aws_access_key_id") set tSettings.secretKey = tCredentials("aws_secret_access_key") set tSettings.sessionToken = tCredentials("aws_session_token") set tSettings.region = "eu-central-1" set tClient = ##class(%External.Messaging.Client).CreateSQSClient(tSettings.ToJSON(),.tSc) $$$ThrowOnError(tSc) $$$ThrowOnError(tClient.DeleteQueue(pQueueName)) } catch tEx { set tSc = tEx.AsStatus() } return tSc } } It contains methods for creating and deleting queues and sending and receiving messages to and from a queue. One of the key points here is how to authenticate. I didn't want to have my credentials in my code. So I created a little helper method to retrieve the credentials from my local credentials file and return it as subscripted array to use it in my api methods: ClassMethod GetCredentials(Output pCredentials) As %Status { #dim tSc as %Status = $$$OK set tFilename = "/dur/.aws/credentials" try { set tCredentialsFile = ##class(%Stream.FileCharacter).%New() $$$ThrowOnError(tCredentialsFile.LinkToFile(tFilename)) // first read the header set tBuffer = tCredentialsFile.ReadLine() for i=1:1:3 { set tBuffer = tCredentialsFile.ReadLine() set pCredentials($piece(tBuffer," =",1)) = $tr($piece(tBuffer,"= ",2),$c(13)) } } catch tEx { set tSc = tEx.AsStatus() } return tSc } To complete this article, let's create a queue community in the AWS region "eu-central-1" (Frankfurt, Germany). The queue has been successfully created and is visible in the AWS console for my account: Next, let's send a message to this queue: The method call returns 1. So the message has been successfully sent. Finally let's poll the queue from the AWS console: The message has been successfully delivered to the queue. Conclusion The external messaging api in InterSystems IRIS 2022.1 makes it really simple to communicate with event streaming platforms.Hope you find this useful.
Announcement
Anastasia Dyubaylo · Sep 22, 2022

[Video] Analytics with InterSystems New and Next 2022

Hi Developers, Enjoy watching the new video on InterSystems Developers YouTube: ⏯ Analytics with InterSystems New and Next 2022 @ Global Summit 2022 In this video, you'll see an overview of new and improved capabilities for analytics and artificial intelligence on data managed by InterSystems. We'll take a look at analytics across InterSystems IRIS and InterSystems IRIS for Health platforms, HealthShare, and TrakCare. This session will help you determine which additional sessions about analytics and artificial intelligence are relevant to you. Presenters:🗣 @Carmen.Logue, Product Manager, Analytics & AI, InterSystems🗣 @tomd, Product Specialist, Machine Learning, InterSystems🗣 @Benjamin.DeBoe, Product Manager, InterSystems Enjoy watching and stay tuned! 👍🏼
Announcement
Anastasia Dyubaylo · Sep 29, 2022

InterSystems Developer Ecosystem Summer News 2022

Hello and welcome to the Developer Ecosystem Summer News! This summer was full of exciting events and activities in the InterSystems Developer Ecosystem. In case you missed something, we've prepared for you a selection of the hottest news and topics to read! For your convenience, here we gathered everything worth noting that happened this last season at a glance. Read on! News 🎉 Incredible Milestones on Dev Community: 10K posts, 11K members, 5M reads 💡 InterSystems Ideas announced 🆕 Brand New "About Us" Page 🆕 DC rubric: "InterSystems Memes" (+part 1) 🆕 DC rubric: Key Questions ⛱ Inquisitive Summer on DC: ask questions - get double points ☕️ Dev Random Coffee on Global Masters: join our new networking activity 🔗 DC in French > < Global Masters API integration released Contests & Events 🔥 InterSystems Global Summit 2022 Main announcement Live from the Summit: part 1, part 2 InterSystems Developers at the Summit: how it was? Watch the Keynotes 🏆 InterSystems Full Stack Contest 2022 Rules & prizes Kick-off Webinar Winners announcement Meetup with winners 🏆 InterSystems Tech Article Contest: Python Edition Rules & prizes New contest bonuses introduced Winners announcements 🧩 Code of Golf challenge ⏯ Webinar organized by DC: Scaling InterSystems FHIR Server on Amazon Web Services with ECP 👩‍💻 Women's health - FemTech panel hosted by InterSystems 👋 InterSystems Developer Meetup on Python Interoperability in Boston Latest Releases ⬇️ InterSystems IRIS, IRIS for Health, & HealthShare Health Connect 2022.2 developer previews Preview 1 Preview 2 Preview 3 Preview 4 Preview 5 Preview 6 ⬇️ InterSystems IRIS, IRIS for Health, & HealthShare Health Connect 2022.1 ⬇️ InterSystems API Manager 2.8.1 🆕 Developer Community Release, July 2022 🆕 UX/UI change on Open Exchange 🆕 New Open Exchange feature: ObjectScript Quality status Best Practices & Key Questions 🔥 Best Practices of Summer 2022 DB Migration using SQLgateway SystemPerformance Utility (pka pButtons) API (and REST API) [and sample UI] Ensemble Orphaned Messages Formation on InterSystems' interoperability framework using ONLY Python Mastering the %SYSTEM.Encryption class Method to recompile classes and routines after a major upgrade ❓ Key Questions of Summer 2022: July, August People to Know About 👋 Meet new DC Moderator: Niangang Huang 🌟 Global Masters of Summer 2022: June, July, August Job Opportunities 💼 Sr. Application Development Analyst - The Ohio State University Wexner Medical Center 💼 InterSystems IRIS Developer - French Speaking - based in Paris - France 💼 Potential HealthShare opportunity 💼 Senior Software Developer - International Healthcare 💼 Looking for a Fully Remote InterSystems IRIS Developer So... Here is our take on the most interesting and important things! What were your highlights from this summer/winter? Share them in the comments section and let's remember the joy we've had! Proud of our Dev Ecosystem Team! Thanks, @Anastasia.Dyubaylo for sharing! My favorites are Random Coffee, New About page, and Key Questions! And of course the Memes! Who says that summer is a quiet time - not in the InterSystems Developer Community! hahaha))) indeed! Proud of our milestone achievements! Great numbers, aren't they? ;) For now: 🎉🎉🎉
Announcement
Olga Zavrazhnova · Oct 4, 2022

Meet InterSystems at TechCrunch Disrupt 2022

Meet InterSystems at TechCrunch Disrupt 2022 - the biggest event for startups! This year we will host 4 roundtables at TechCrunch as well as a developer meetup in San Francisco on October 19! At TechCrunch we invite you to join our roundtables to discuss the following topics: Roundtable: Breaking Into the Healthcare Monolith: Strategies for working with Payors and Providers How do you build a health-tech startup that can achieve high growth? What can startups do to make their technologies more compelling to the biggest players in healthcare: payors and health systems? In this session, we will discuss the pain points of getting into healthcare, as well as strategies to open doors to these organizations for pilots and sustainable revenue. You’ll leave this round table discussion with a list of best practices from InterSystems’ 40+ years in the healthcare industry. The session will run twice: Tuesday 10/18 and Wednesday at 10:30 - 11:00 am Roundtable: What the heck is Interoperability Anyways? In a world where data is commonly available at a coder’s fingertips, why is it so hard to connect to some customers? Doesn’t everyone have APIs we can use to get to data? What is interoperability anyways? Can cloud technologies and data fabrics solve our problems? How can our startups be better prepared to enter the data ecosystems in industries like healthcare, financial services, or supply chain? This round table will give you an overview of what interoperability is, why these established industries interface the way they do, and strategies to make this process less painful as you develop your products. The session will run twice: Tuesday 10/18 and Wednesday at 10:30 - 11:00 am Speaker: Neal Moawed, Global Head of Industry Research, InterSystems Who will be there? Let us know!
Announcement
Anastasia Dyubaylo · Apr 27, 2022

InterSystems Grand Prix Programming Contest 2022

The annual competition for InterSystems IRIS developers is coming! We're super excited to invite you all to join the Grand Prix contest for building open-source solutions using InterSystems IRIS data platform! New developers are welcome to join --> create an account now. 🏆 InterSystems Grand Prix Programming Contest 🏆 In prizes: more than $22,000 Contest running: May 9 - 29, 2022 Voting period: May 30 - June 5, 2022 The topic InterSystems Grand Prix is our annual programming contest to find the best application that uses InterSystems IRIS. We welcome applications on any topic! Present any application which uses InterSystems IRIS as a backend (API or database) with any type of InterSystems IRIS API or data model. You are welcome to improve your applications which you presented in the InterSystems contest series last year and submit them for the Grand Prix. And you are welcome to submit a 100% new application. General Requirements: Accepted applications: new to Open Exchange apps or existing ones, but with a significant improvement. Our team will review all applications before approving them for the contest. The application should work either on IRIS Community Edition or IRIS for Health Community Edition or IRIS Advanced Analytics Community Edition. The application should be Open Source and published on GitHub. The README file to the application should be in English, contain the installation steps, and contain either the video demo or/and a description of how the application works. Only 3 submissions from one developer are allowed. Contest Prizes: 1. Experts Nomination – winners will be selected by the team of InterSystems experts: 🥇 1st place - $7,000 🥈 2nd place - $5,000 🥉 3rd place - $3,000 🌟 4-20th places - $100 2. Community winners – applications that will receive the most votes in total: 🥇 1st place - $3,000 🥈 2nd place - $2,000 🥉 3rd place - $1,000 ✨ Global Masters badges for all winners included! Note: If several participants score the same amount of votes, they all are considered winners, and the money prize is shared among the winners. Important Deadlines: 🛠 Application development and registration phase: May 9, 2022 (00:00 EST): Contest begins. May 29, 2022 (23:59 EST): Deadline for submissions. ✅ Voting period: May 30, 2022 (00:00 EST): Voting begins. June 5, 2022 (23:59 EST): Voting ends. Note: Developers can improve their apps throughout the entire registration and voting period. Who Can Participate? Any Developer Community member, except for InterSystems employees (ISC contractors allowed). Create an account! Developers can team up to create a collaborative application. Allowed from 2 to 5 developers in one team. Do not forget to highlight your team members in the README of your application – DC user profiles. Helpful Resources: ✓ How to work with InterSystems IRIS (for beginners): Build a Server-Side Application with InterSystems IRIS Learning Path for beginners ✓ For beginners with ObjectScript Package Manager (ZPM): How to Build, Test and Publish ZPM Package with REST Application for InterSystems IRIS Package First Development Approach with InterSystems IRIS and ZPM ✓ How to submit your app to the contest: How to publish an application on Open Exchange How to submit an application for the contest ✓ Sample IRIS applications: intersystems-iris-dev-template rest-api-template native-api-contest-template integratedml-demo-template iris-fhir-template iris-fullstack-template iris-interoperability-template iris-analytics-template Need Help? Join the contest channel on InterSystems' Discord server or talk with us in the comment to this post. We can't wait to see your projects! Good luck 👍 By participating in this contest, you agree to the competition terms laid out here. Please read them carefully before proceeding. Exciting - good luck everyone!! Hey developers, We have extended the deadline for application development - 3 weeks for submitting your projects! 🛠 Application development and registration phase: May 9, 2022 (00:00 EST): Contest begins. May 29, 2022 (23:59 EST): Deadline for submissions. ✅ Voting period: May 30, 2022 (00:00 EST): Voting begins. June 5, 2022 (23:59 EST): Voting ends. Note: Developers can improve their apps throughout the entire registration and voting period. Hey Community! Don't miss the opportunity to join InterSystems Grand Prix Contest Kick-off Webinar 2022! The webinar starts on Monday, May 9 – 11:00 AM EDT We are waiting for your participation! WOW! Developers! There are already 2 applications that have been uploaded by @Robert.Cemper1003 ! What a speed! ⚡ db-migration-using-SQLgatewayCrossECP-IRISGo check it out! So, who will be next? Devs! Another application has been added by @Robert.Cemper1003 ! M-N-Contests Check it out! Hello Developers! The second week of the registration period has ended, only one week left! So, upload your applications and participate! Developers! Check out the technical bonuses that can help you to win! Upload your apps and join the contest! A new application has been added to the competition! cryptocurrency-rate-forecasting by @Oleh.Dontsov Devs! Only 4 days left to the end of the registration phase! What will the next great app be added?👀 Developers! A lot of applications have been added to the competition! Here they are: FHIR Patient Viewer by @Dan.BergesIRIS import manager by @Oleh.Dontsov test-data by @Oliver.Wilms Docker InterSystems Extension by @Dmitry.Maslennikov apptools-infochest by @MikhailenkoSergey iris-mail by @Oliver.Wilms production-monitor by @Oliver.Wilms iris-megazord by @José.Pereira apptools-admin by @MikhailenkoSergey webterminal-vscode by @John.Murray ESKLP by @Aleksandr.Kalinin6636 Disease Predictor by @Yuri.Gomes iris-fhir-client by @Muhammad.Waseem Water Conditions in Europe by @Evgeniy.Potapov FHIR Pseudonymization Proxy by @Marcus.Wurlitzer ObjectScript-Syntax-For-GitLab by @Lorenzo.Scalese Check them out! Only one day left to the end of the registration phase! So, don't miss your opportunity to join the InterSystems Grand Prix Programming Contest 2022! Hi Irina, My application "CloudStudio" was submitted 5 hours ago but its still pending approval. I can't move the application into the competition form until someone there has done this. Could I lodge my inclusion into the competition here until that has been done. Many Thanks,Sean.
Announcement
Bob Kuszewski · Mar 15, 2022

InterSystems Kubernetes Operator 3.3 is published

The InterSystems Kubernetes Operation (IKO) version 3.3 is now available via the WRC download page and the InterSystems Container Registry. IKO simplifies working with InterSystems IRIS or InterSystems IRIS for Health in Kubernetes by providing an easy-to-use irisCluster resource definition. See the documentation for a full list of features, including easy sharding, mirroring, and configuration of ECP. IKO 3.3 Highlights: Support for 2021.2 and 2022.1 editions of InterSystems IRIS & IRIS for Health Support for Kuberentes 1.21 Deploy common System Alerting and Monitoring (SAM) configurations as part of your irisCluster InterSystems API Manager (IAM) can now also be deployed and managed as part of the irisCluster Automatic tagging of mirror pair active side, so a service can always point to the active mirror member.
Announcement
Vadim Aniskin · Sep 15, 2022

Categorizing your ideas on InterSystems Ideas is easy!

Hello Community, In the previous announcement, we introduced our feedback portal – InterSystems Ideas! Now we'd like to tell you more about it, notably about the topics which are covered there. You can submit your ideas in the following categories: 💡 InterSystems Products where you can post ideas for new development directions for our products: InterSystems IRIS data platform InterSystems IRIS for Health InterSystems HealthShare InterSystems TrakCare 💡 InterSystems Services where you can post ideas on how we can make our services even better than they are now: Developer Community Open Exchange app gallery Global Masters gamification platform Partner Directory Documentation Certification Learning and InterSystems Ideas Portal itself There is also the category "Other" for feedback that is not related directly neither to InterSystems Products or Services. After choosing a category, feel free to also add keywords / tags: Feel free to share your suggestions for categories and keywords worth adding to the portal. We will be glad to hear from you! See you on the InterSystems Ideas portal ✌️
Announcement
Shannon Puebla · Oct 21, 2022

REMOTE InterSystems Object Developer with Docker Experience

We are seeking an InterSystems Object Developer With Docker Experience to join our team! You will develop and implement unique web-based applications. This role is Remote, Full Time and a 1099 position. Required Qualifications: 4+ years InterSystems Object Technology developing applications utilizing industry best practices for software development. 2+ years using Docker Preferred: Healthcare industry experience Demonstrate the ability to adapt and work with team members of various experience levels. Ability to work in a fast paced environment while maintaining standards and best practices. Strong Communicator VA Experience Only applicants with the required qualifications will be considered. If you are interested in this position provide your resume, phone number, and times you are available.
Announcement
Anastasia Dyubaylo · Jun 15, 2022

InterSystems Tech Article Contest: Python Edition

Hello and welcome to the next InterSystems technical article writing competition! 🐍 InterSystems Tech Article Contest: Python Edition 🐍 Write an article on any topic related to the usage of Python with InterSystems technologies from June 20 to July 20 July 31– extended! 🎁 Prizes for everyone: A special prize pack for each author who takes part in the competition! 🏆 Main Prizes: AirPods Max; Apple Watch SE; Apple HomePod mini / Apple Pencil Prizes 1. Everyone is a winner in InterSystems Tech Article Contest! Any user who writes an article during the competition period will receive special prizes: 🎁 InterSystems Branded Apple AirTag 🎁 InterSystems Branded Rubik's 9-Panel Cube 2. Expert Awards – articles will be judged by InterSystems experts: 🥇 1st place: Apple AirPods Max 🥈 2nd place: Apple Watch SE 🥉 3rd place: Apple HomePod mini / Apple Pencil Or as an alternative: Alternatively, any winner can choose a prize from a lower prize tier than his own. 3. Developer Community Award – article with the most likes. The winner will have an option to choose one of the following prizes: 🎁 Apple Pencil 🎁 Apple HomePod mini Note: The author can only be awarded once per category (in total the author will win 2 prizes: one for Expert and one for the Community) In the event of a tie, the number of votes of the experts for the tied articles will be considered as a tie-breaking criterion. Who can participate? Any Developer Community member, except for InterSystems employees. Create an account! Contest period 📝 June 20 - July 20: Publication of articles and voting time. Publish an article(s) throughout this period. DC members can vote for published articles with Likes – votes in the Community award. Note: The sooner you publish an article(s), the more time you will have to collect both Experts & Community votes. What are the requirements? ❗️ Any article written during the contest period and satisfying the requirements below will automatically enter the competition: The article must be related to the usage of Python with InterSystems technologies (Embedded Python or Python API). The article must be in English. The article must be 100% new (it can be a continuation of an existing article). The article cannot be a translation of an article already published in other communities. The article must contain DC tag(s): Python or Embedded Python tags (depending on your topic). Article size: 750 words (links and code are not counted towards the word limit). Multiple entries from the same author are allowed. Articles on the same topic from different authors are allowed. 🎯 [NEW] EXTRA BONUSES This time we decided to add additional bonuses that will help you to win the prize! Please welcome: Bonus Nominal Details Topic bonus 5 If your article is on the topic from the list of the proposed topics (listed below), you will receive a bonus of 5 Expert votes (vs 1st place selected by an Expert = 3 votes). Video bonus 3 Format of the presentation of the content of the article: besides publishing the article make an explanatory video. Discussion bonus 1 Article with the most useful discussion, as decided by InterSystems experts. Only 1 article will get this bonus. Translation bonus 1 Publish a translation of your article on any of the regional Communities. Learn more. Note: Only 1 vote per article. New member bonus 3 If you haven't participated in the previous contests, your article will get 3 Expert votes. Proposed topics Here's a list of proposed topics that will give your article extra bonuses for topic: # Topic Details 1 Useful Python libraries for InterSystems Data Platforms Describe which libraries you have used to produce applications on InterSystems platforms. 2 Embedded Python from Interoperability Explore how Embedded Python can be leveraged from an Interoperability production. 3 Embedded Python: Translating by Language Constructs While we aim for seamless Embedded Python integration there are some tips & tricks to smooth things over. Underscore methods, dictionaries, lists, and others. What are the best ways of calling Python features from ObjectScript? 4 PEX for Python Examples Describe a Python-centric approach to leveraging the power of InterSystems IRIS. Data models in Native Python architecting. 5 Native API for Python Examples Describe which libraries you have used to produce applications on InterSystems platforms. Note: Articles on the same topic from different authors are allowed. ➡️ Join InterSystems Discord to chat about the rules, topics & bonuses. So, It's time to show your writing skills! Good luck ✨ Important note: Prizes cannot be delivered to residents of Crimea, Russia, Belarus, Iran, North Korea, Syria, or other US embargoed countries. I joined with an article and a video.Might be an inspiration for other writers. The first article has been added to the competition: Working with Globals in Embedded Python by @Robert.Cemper1003 Check it out :) Mr. Cemper is always an inspiration for us Hey everyone, We've prepared a quick guide on how to make a translation on DC: 👉 How to translate and publish post on any regional Developer Community It's time to practice another language! Post a translation of your article to get our Translation bonus 😉 Hey Developers! Check out one more article that has been added to the contest! Accessing Management Portal System Dashboard information and display cache table data on the web page with the help of jquery datatable by using embedded python by @Muhammad.Waseem What great work by Muhammad! Hi Devs! Half of the registration period has passed! Do not miss your opportunity to participate and publish your excellent article! Have a great weekend! Hello,i've added an article for using embedded python with ASB (Azure service bus) https://community.intersystems.com/post/iris-embedded-python-azure-service-bus-asb-use-case Hey Community, You asked – we did it! ❗️ We extend the contest period until July 31 More time to write your article! Don't miss your chance to win 😉 Devs! Two more articles have been uploaded to the contest! IRIS Embedded Python with Azure Service Bus (ASB) use case by @Yaron.Munz8173 Time zone conversion utility using embedded python by @Veerarajan.Karunanithi9493 Don't forget about the new Extra Bonuses that can help you get more expert points! Check it in the post! Developers! Another article has been added to the contest! Create Stored Procedures using Embedded Python by @Yuri.Gomes Thanks! Python inside IRIS works like a charm! Developers! A new article has been written for the contest: Getting known with Django by @Dmitry.Maslennikov 🚨 Last week of the 3rd Tech Article Contest 🚨 You can still join at >> community.intersystems.com/contests/current << And don't forget to support our participants with your likes = votes in the Community nomination ;) Hi All, One more article in the Contest! Getting known with Django part 2 by @Dmitry.Maslennikov Great! Hey Devs! Another article has joined the Contest😉 Introduction to Web Scraping with Python - Let’s Extract python job’s by @Rizmaan.Marikar2583 Support our members with your votes! There are only a few days left before the end of the contest. Your vote is very important! Thanks to all! Community! @Renato.Banzai have joined the competition! Check out his article:Dealing with large content in Python Native API Devs, only three days left to the end of the contest! Don't miss your chance to take participation!
Announcement
Anastasia Dyubaylo · Jul 18, 2022

InterSystems Full Stack Contest 2022: Winners!

Hey Community, We are super excited to announce the winners of the InterSystems Full Stack Contest 2022! Thank you all for participating in our coding competition! And the winners are... Experts Nomination 🥇 1st place and $4,000 go to the Kozo app by @Sean.Connelly 🥈 2nd place and $2,000 go to the iris-climate-change app by @Muhammad.Waseem 🥉 3rd place and $1,000 go to the Carbon Footprint Counter app by @Yuri.Gomes More winners: 🏅 $100 go to the interoperability-manager app by @Oliver.Wilms 🏅 $100 go to the Arctic sea ice viewer app by @Oleh.Dontsov 🏅 $100 go to the iris-for-money app by @Oliver.Wilms Community Nomination 🥇 1st place and $1,000 go to the Kozo app by @Sean.Connelly 🥈 2nd place and $750 go to the iris-climate-change app by @Muhammad.Waseem 🥉 3rd place and $500 go to the Carbon Footprint Counter app by @Yuri.Gomes Our BIG congrats to all the participants and winners! See you in the next contest. 😎 Hi Community and Experts, Many thanks for all the votes!I have big plans for Kozo Pages, lots of work still do to, as well as integration with CloudStudio. Not sure I will have time for any more competitions for some while :) I also have an exciting second part to the Kozo Pages solution that I have not revealed yet, so lots more to come! Thanks to the experts and community for your votes. Congratulations to all 👏 and thanks to DC