Nova postagem

Pesquisar

Artigo
· Dez. 16, 2024 3min de leitura

Mejoras en la interoperabilidad de InterSystems con IRIS Whiz

En la última competición de InterSystems "Convirtiendo Ideas en Realidad", estuve explorando el portal de ideas en busca de problemas de interfaz de usuario para intentar resolverlos.

Implementé las siguientes ideas en la extensión de navegador IRIS Whiz, así que si utilizáis el portal de gestión para ayudar con la administración diaria de integraciones, ¡esta extensión podría ser para vosotros!

Función añadida: Actualización de colas

Ahora IRIS incluye un desplegable de actualización automática para la página de Colas. Actualiza las colas al intervalo seleccionado. No se carga en Ensemble, ya que este ya cuenta con esta funcionalidad.

Útil si tenéis una próxima competencia de clics y necesitáis dar un descanso a vuestro dedo clicador.

Implementado a partir de la idea: https://ideas.intersystems.com/ideas/DPI-I-487

Función añadida: Exportar búsqueda como CSV
En la página del Visor de Mensajes, podéis hacer clic en el botón de exportación de Iris Whiz para descargar una copia en formato CSV de los datos que se encuentran actualmente en vuestra tabla de búsqueda.

Útil si queréis hacer un análisis rápido de vuestros datos pero no queréis usar la nueva y sofisticada página de Chart.JS que pasé horas creando (¡podéis verla en acción aquí).

Implementado a partir de la idea: https://ideas.intersystems.com/ideas/DPI-I-566

Función añadida: Ordenar colas en la página de producción
Se añadieron opciones para ordenar en la pestaña de colas de la página de producción. Por defecto, se ordena por la cantidad de errores. Haced clic en un encabezado de tabla para alternar entre el orden ascendente y descendente. Utilizad la barra de búsqueda para encontrar elementos rápidamente.

 

Útil si no queréis desplazaros para llegar a la lista más grande.

Implementado a partir de la idea: https://ideas.intersystems.com/ideas/DPI-I-628

Función añadida: Orden alfabético insensible a mayúsculas/minúsculas en el desplegable de categorías
Organiza alfabéticamente la lista desplegable de categorías en la página de producción, independientemente de las mayúsculas o minúsculas. Sin esta función, el orden depende del uso de mayúsculas.

Útil si queréis encontrar elementos en la lista de categorías sin tener que volver a categorizar todo usando el mismo formato de mayúsculas o minúsculas.

Implementado a partir de la idea: https://ideas.intersystems.com/ideas/DPI-I-625

¡Bonus!
También se ha añadido una tasa de actualización en la pestaña del visor de mensajes en la página de producción. Esto actualizará también la pestaña de colas si seleccionáis un intervalo y luego navegáis a la pestaña de colas.

Si os gustan alguna de estas ideas, por favor descargad la extensión para el navegador y compartidme vuestra opinión. Podéis encontrar un video de instalación en la página de OpenExchange, que recomiendo ver, ¡ya que necesitaréis completar algunos pasos para que la mayoría de las funciones funcionen correctamente!

Discussão (0)1
Entre ou crie uma conta para continuar
Resumo
· Dez. 16, 2024

Publications des développeurs d'InterSystems, semaine Décembre 09 - 15, 2024, Résumé

Artigo
· Dez. 16, 2024 9min de leitura

Usando IRIS y Presto para consultas SQL de alto rendimiento y escalabilidad

El auge de los proyectos de Big Data, las analíticas en tiempo real con herramientas self-service, los servicios de consultas en línea y las redes sociales, entre otros, han habilitado escenarios para consultas masivas y de alto rendimiento. En respuesta a este desafío, se creó la tecnología MPP (procesamiento masivamente paralelo) y rápidamente se consolidó. Entre las opciones de MPP de código abierto, Presto (https://prestodb.io/) es la más conocida. Surgió en Facebook y se utilizó para análisis de datos, pero luego se convirtió en código abierto. Sin embargo, desde que Teradata se unió a la comunidad de Presto, ahora ofrece soporte.

Presto se conecta a fuentes de datos transaccionales (Oracle, DB2, MySQL, PostgreSQL, MongoDB y otras bases de datos SQL y NoSQL) y proporciona procesamiento SQL distribuido y en memoria, combinado con optimizaciones automáticas de los planes de ejecución. Su objetivo, sobre todo, es ejecutar consultas rápidas sin importar si gestionáis gigabytes o terabytes de datos, escalando y paralelizando las cargas de trabajo.

Presto no tenía originalmente un conector nativo para la base de datos IRIS, pero afortunadamente, este problema se resolvió con un proyecto comunitario de InterSystems llamado presto-iris (https://openexchange.intersystems.com/package/presto-iris). Por ello, ahora podéis exponer una capa MPP frente a los repositorios de InterSystems IRIS para habilitar consultas, informes y paneles de alto rendimiento a partir de datos transaccionales en IRIS.

En este artículo, seguiremos una guía paso a paso para configurar Presto, conectarlo con IRIS y establecer una capa MPP que vuestros clientes puedan utilizar. También os mostraremos las principales características de Presto, sus comandos y herramientas principales, siempre utilizando IRIS como base de datos fuente.

Características de Presto

Presto contiene las siguientes características: 

  1. Arquitectura sencilla pero extensible.
  2. Conectores enchufables (Presto admite conectores enchufables para proporcionar metadatos y datos para las consultas).
  3. Ejecuciones en cadena (evita la sobrecarga innecesaria de latencia de E/S).
  4. Funciones definidas por el usuario (los analistas pueden crear funciones personalizadas definidas por el usuario para migrar fácilmente).
  5. Procesamiento vectorizado en columnas.


Beneficios de Presto

A continuación, podéis ver una lista de beneficios que ofrece Apache Presto:

Operaciones SQL especializadas.
Instalación y depuración sencillas.
Abstracción de almacenamiento simple.
Escalabilidad rápida para petabytes de datos con baja latencia.

Arquitectura de Presto


 

  • Clientes: Son los consumidores de PrestoDB. Los clientes utilizan el protocolo JDBC/ODBC/REST para comunicarse con los coordinadores.
  • Coordinadores: Son responsables de gestionar los nodos de trabajo asociados, analizar y manejar las consultas, y generar planes de ejecución. También se encargan de la entrega de datos para el procesamiento entre los trabajadores, creando planes lógicos compuestos por etapas, donde cada etapa se ejecuta de manera distribuida utilizando tareas asignadas a los trabajadores.
  • Trabajadores: Son nodos de cálculo responsables de ejecutar tareas y procesar datos, lo que permite escalar el procesamiento y consumo de datos.
  • Comunicación: Cada trabajador de Presto se anuncia al coordinador utilizando un servidor de descubrimiento para prepararse para trabajar.
  • Conectores: Cada tipo posible de fuente de datos tiene un conector empleado por Presto para consumir datos. El proyecto https://openexchange.intersystems.com/package/presto-iris permite que Presto utilice InterSystems IRIS.
  • Catálogo: Contiene información sobre la ubicación de los datos, incluidos esquemas y la fuente de datos. Cuando los usuarios ejecutan una instrucción SQL en Presto, la ejecutan contra uno o más catálogos.

Casos de uso de Presto

InterSystems IRIS y Presto juntos os permiten los siguientes casos de uso:

  • Consultas ad-hoc: Podéis ejecutar consultas ad-hoc con alto rendimiento sobre terabytes de datos.
  • Informes y paneles: Hay un motor para ofrecer consultas de datos de alto rendimiento para informes, herramientas de BI de autoservicio y análisis, como Apache Superset (consultad el ejemplo en este artículo).
  • Lakehouse abierto: Presto tiene los conectores y catálogos necesarios para unificar las fuentes de datos requeridas y ofrecer consultas escalables y datos utilizando SQL entre trabajadores.

InterSystems IRIS es un socio perfecto para Presto. Al ser un repositorio de datos de alto rendimiento que admite procesamiento distribuido con la ayuda de fragmentos (shards) y asociado con los trabajadores de Presto, cualquier volumen de datos puede ser consultado en solo unos pocos milisegundos.

Instalación y puesta en marcha de PrestoDB

Hay varias opciones (Docker y Java JAR) para instalar Presto. Podéis encontrar más detalles al respecto en https://prestodb.io/docs/current/installation/deployment.html. En este artículo, utilizaremos Docker. Para facilitar la comprensión y permitir un inicio rápido, hemos puesto a vuestra disposición una aplicación de ejemplo en Open Exchange (derivada de otro paquete https://openexchange.intersystems.com/package/presto-iris). Seguid estos pasos para probarlo vosotros mismos:

  1. Id a https://openexchange.intersystems.com/package/iris-presto-sample y descargad el ejemplo utilizado en este tutorial.
  2. Iniciad el entorno de demostración con docker-compose.
docker-compose up -d --build

Nota: Para fines de demostración, el entorno opera Apache Superset con superset-iris y los ejemplos que vienen incluidos. Por esa razón, tarda un tiempo en cargar.

  1. La interfaz de usuario de Presto estará disponible en este enlace: http://localhost:8080/ui/#.
  2. Esperad entre 15 y 20 minutos (hay una gran cantidad de datos de ejemplo para cargar). Cuando Superset termine de cargar los ejemplos después de 10-15 minutos, debería estar disponible en el enlace http://localhost:8088/databaseview/list. Introducid admin/admin como usuario y contraseña en la página de inicio de sesión.
  3. Ahora id a los paneles 
  4. Si visitáis http://localhost:8080/ui, podréis notar que Presto ha ejecutado consultas y está mostrando algunas estadísticas:

Arriba podéis ver la interfaz web de Presto para supervisar y gestionar consultas. Se puede acceder a través del número de puerto especificado en las Propiedades de Configuración del Coordinador (en este artículo, es el 8080).

Detalles sobre el código de ejemplo

Dockerfile

El Dockerfile se emplea para crear una imagen Docker de PrestoDB con el plugin presto-iris y el archivo JDBC de InterSystems IRIS incluidos:

# Official PrestoDB image on Docker Hub
FROM prestodb/presto

# From https://github.com/caretdev/presto-iris/releases
# Adding presto-iris plugin into the Docker image
ADD https://github.com/caretdev/presto-iris/releases/download/0.1/presto-iris-0.1-plugin.tar.gz /tmp/presto-iris/presto-iris-0.1-plugin.tar.gz

# From https://github.com/intersystems-community/iris-driver-distribution
# Adding IRIS JDBC driver into the Docker image
ADD https://raw.githubusercontent.com/intersystems-community/iris-driver-distribution/refs/heads/main/JDBC/JDK18/com/intersystems/intersystems-jdbc/3.8.4/intersystems-jdbc-3.8.4.jar /opt/presto-server/plugin/iris/intersystems-jdbc-3.8.4.jar

RUN --mount=type=bind,src=.,dst=/tmp/presto-iris \
    tar -zxvf /tmp/presto-iris/presto-iris-0.1-plugin.tar.gz -C /opt/presto-server/plugin/iris/ --strip-components=1

 

Archivo Docker-compose.yml

Este archivo crea 3 instancias de contenedor: una para InterSystems IRIS (servicio IRIS), una para PrestoDB (servicio Presto) y una para Superset (servicio Superset). El Superset es una herramienta de visualización de Analytics que se utiliza para ver los datos en cuadros de mando.

# from the project https://github.com/caretdev/presto-iris
services:
  # create an InterSystems IRIS container instance
  iris:
    image: intersystemsdc/iris-community
    ports:
      - 1972
      - 52773
    environment:
      IRIS_USERNAME: _SYSTEM
      IRIS_PASSWORD: SYS
  # create a PrestoDB container instance consuming the IRIS database
  presto:
    build: .
    volumes:
      # PrestoDB will use iris.properties to get connection information
       - ./iris.properties:/opt/presto-server/etc/catalog/iris.properties
    ports:
      - 8080:8080
  # create a Superset (Dashboard analytics tool) container instance
  superset:
    image: apache/superset:3.0.2
    platform: linux/amd64
    environment:
      SUPERSET_SECRET_KEY: supersecret
      # create an InterSystems IRIS connection to load sample data
      SUPERSET_SQLALCHEMY_EXAMPLES_URI: iris://_SYSTEM:SYS@iris:1972/USER
    volumes:
      - ./superset_entrypoint.sh:/superset_entrypoint.sh
      - ./superset_config.py:/app/pythonpath/superset_config.py
    ports:
      - 8088:8088
    entrypoint: /superset_entrypoint.sh

El archivo iris.properties

Este archivo contiene la información necesaria para conectar PrestoDB a InterSystems IRIS DB y crear una capa MPP para consultas de alto rendimiento y escalables desde cuadros de mando Superset.

# from the project https://github.com/caretdev/presto-iris
connector.name=iris
connection-url=jdbc:IRIS://iris:1972/USER
connection-user=_SYSTEM
connection-password=SYS

El archivo superset_entrypoint.sh 

Este script instala la librería superset-iris (para soporte Superset de IRIS), inits la instancia Superset, y carga datos de ejemplo en InterSystems IRIS DB. En tiempo de ejecución los datos consumidos por Superset vendrán de PrestoDB, que será una capa MPP para IRIS DB.

#!/bin/bash

# Install the InterSystems IRIS Superset extension
pip install superset-iris

superset db upgrade

superset fab create-admin \
            --username admin \
            --firstname Superset \
            --lastname Admin \
            --email admin@superset.com \
            --password ${ADMIN_PASSWORD:-admin}
superset init

# Load examples to IRIS
superset load-examples

# Change examples database URI to Presto
superset set-database-uri -d examples -u presto://presto:8080/iris

/usr/bin/run-server.sh

Sobre Superset

En este artículo se ha utilizado Superset para los cuadros de mando. Se trata de una moderna plataforma de exploración y visualización de datos que puede sustituir o aumentar las herramientas de inteligencia empresarial propias de muchos equipos. Superset se integra bien con una gran variedad de fuentes de datos.
Superset proporciona lo siguiente:

  • Una interfaz sin código para crear gráficos rápidamente
  • Un potente editor SQL basado en la web para consultas avanzadas
  • Una capa semántica ligera para definir dimensiones y métricas personalizadas de manera rápida
  • Soporte listo para usar para casi cualquier base de datos SQL o motor de datos
  • Una amplia gama de visualizaciones hermosas para mostrar vuestros datos, desde gráficos de barras simples hasta visualizaciones geoespaciales
  • Capa de almacenamiento en caché configurable y ligera para ayudar a reducir la carga en la base de datos
  • Roles de seguridad altamente extensibles y opciones de autenticación
  • Una API para personalización programática
  • Una arquitectura nativa en la nube diseñada desde cero para escalar

 

Fuentes y materiales adicionales para el aprendizaje:

  1. Tutorial extenso sobre PrestoDB: https://www.tutorialspoint.com/apache_presto/apache_presto_quick_guide.htm
  2. Documentación de PrestoDB: https://prestodb.io/docs/current/overview.html
  3. Plugin Presto-iris: https://openexchange.intersystems.com/package/presto-iris
  4. Ejemplo Iris-presto: https://openexchange.intersystems.com/package/iris-presto-sample
  5. Información sobre Superset: https://github.com/apache/superset
  6. Superset con InterSystems IRIS: https://openexchange.intersystems.com/package/superset-iris
Discussão (0)1
Entre ou crie uma conta para continuar
Resumo
· Dez. 16, 2024

Nuevas publicaciones en la Comunidad de InterSystems, 9-15 diciembre

Artículos
#InterSystems IRIS
#Comunidad de Desarrolladores Oficial
Anuncios
#InterSystems Official
#IRIS contest
Preguntas
#Caché
Versión evaluación CACHE
Por Bernabé Martín
9-15 diciembreWeek at a GlanceInterSystems Developer Community
Artigo
· Dez. 16, 2024 7min de leitura

Introduction to IRIS for SQL Developers and DBAs.

Are you familiar with SQL databases, but not familiar with IRIS?  Then read on...

About a year ago I joined InterSystems, and that is how IRIS got on my radar.  I've been using databases for over 40 years—much of that time for database vendors—and assumed IRIS would be largely the same as the other databases I knew.  However I was surprised to find that IRIS is in several ways quite unlike other databases, often much better.  With this, my first article in the Dev Community, I'll give a high-level overview of IRIS for people that are already familiar with the other databases such as Oracle, SQL Server, Snowflake, PostgeSQL, etc.   I hope I can make things clearer and simpler for you and save you some time getting started.

First of all, IRIS supports ANSI standard SQL commands and syntax. It has tables, columns, data types, stored procs, functions, ...  all that relational stuff.  And you can use ODBC, JDBC, and use DBeaver or whatever is your favorite DB browser.  So, yes, most of what you know and do from other DB's will work just fine on IRIS.  Yay!  

But what about those differences I mentioned?  Okay, buckle up:

Multi-Model: IRIS is a relational database, however it is also an object-oriented database, and also document store, and supports vectors, and cubes/MDX, and... well you see where I'm going.  The amazing thing about this is you can take advantage of all these models... in the same SQL statement!  And in many cases the data can be stored as multiple of these data structures — no need to store it twice — and certainly no need to have more than one type of DB!  When you access the very same data as though it were different data models InterSystems calls that CDP (Common Data Plane).  This is at least rare, if not unique, in the database industry.  Nobody paid much attention to CDP until the AI revolution made support for multi-model suddenly important. It's not a feature other DBs are likely to implement as it is baked right into the kernel.  IRIS makes multi-model and NoSQL and NewSQL easy for SQL folks:

For Object database, you extract a keyvals from the JSON tree, which is just the value in a regular table. 

-- example of Object database query
SELECT JSON_OBJECT('product':Product,'sizes':PopularSizes) FROM Sample.Clothing

-- this will return a list of key-val pairs. If a pair is missing IRIS 
-- will, by default, create one with a value of null.

For Vector, just think of it as simply another data type, but with some special functions that only work with that data type. 

-- example of creating a table with a vector column
CREATE TABLE Sample.CustEventV1 (
  CustID INTEGER,
  EventDt DATE,
  Vtest VECTOR(integer,4),
  EventValue NUMERIC(12,2),  
  EventCD VARCHAR(8)) 

-- You can use functions like VECTOR_DOT_PRODUCT or VECTOR_COSINE on Vtest

 

Taxonomy:  The terms database, schema, deployment, instance, etc are not used exactly the same by different database vendors. 

  • Instance: When you install the database software that is usually called an 'instance' by DB companies. I hear that term at InterSystems sometimes, but more often I hear the term 'deployment'.  This is probably because 'instance' is already used in the objected-oriented world.  Whichever you call it, the hierarchy for other databases is usually:
    • instance/deployment
      • database
        • schema
          • tables, views, etc.

            .. or maybe just:

  • instance/deployment (this *is* the database)
    • schema
      • tables, views, etc.

 

            .. but IRIS is a bit different in that it has an additional layer called 'namespace':

  • instance/deployment
    • namespace
      • database
        • schema
          • tables, views, etc.

Namespace is a logical entity that contains databases. Yet multiple namespaces can contain the same database so maybe it's not a hierarchy.  It's used mostly for access control. And it can contain databases from other instances/deployments!

HA: High Availability is accomplished through something called mirroring.  This is a type of replication where the entire DB is replicated, including code.  You may be thinking you don't want to replicate the entire database.  But because of namespaces, you can consider a database to be a sort of schema and break your data up so that what you want mirrored and not mirrored are in separate databases. 

Code Storage: So, yes, you heard me right; when you mirror a database the code goes with it!  This is a very new feature for some trendy databases but IRIS has always had this. You can put both code and data in the same database but typically people separate them.

ECP: Okay, Enterprise Cache Protocol is where IRIS gets really interesting.  I was not even aware this was possible, though I have since learned there are a couple of obscure NoSQL DB's that can do it.  With ECP you can set it up so that different deployments can share their caches!  Yes, I mean their actual memory caches.. not sharing the table data. It does this by keeping the cache of one deployment automatically in sync with that cache of a different deployment.  Talk about staying in sync!  It's super easy to set up, though it must be complicated behind-the-scenes. It's a whole different type of horizontal scaling and can make apps fly.

Translytical: This word, translytical, is used to describe a database that is both OLTP and OLAP. It may also be called HTAP or HOAP. Sometimes it's called hybrid but that term is too overused in the tech world so I'll stick with the T-word.  In the early days all DBs were translytical.  But with the advent of columnar and other structures, as well as new types of storage (think block store vs blob store) they got separated into OLTP and OLAP. Now vendors are trying to be both again.  It's a heck of a lot easier to add OLAP to an OLTP kernel than the other way around. Sure, DW-focused vendors can paste on some indexing for single-row lookups but I doubt you'll see them adding support for hard things, like triggers and fast inserts/updates, any time soon. The fact is that speedy OLTP is more complicated to build than OLAP.. it's a much more mature technology. IRIS is an excellent translytical database (see the analyst ratings to see why). For instance, some DBs support both row and column-store, but in separate tables.  IRIS can have row-store columns in the same table as column-store columns.

/* Example of row-store/column-store mix. 
   All columns are row-store (the default) except for EventValue.
   EventValue is explicitly defined as column-store. 
   If you queried average EventValue for the whole table it would be fAST! */
CREATE TABLE Sample.CustEvent (
  CustID INTEGER,
  EventDt DATE,
  EventValue NUMERIC(12,2) WITH STORAGETYPE = COLUMNAR,
  EventCD VARCHAR(8))

Installation: With other databases you usually need to either install it somewhere (on-prem or in the cloud) as you do with Postgres or SQL Server, or else use a cloud SAAS like RedShift or Snowflake. With IRIS it depends. There are three ways to get IRIS; via a license, via a managed service, or via Cloud SQL. 

  1. With a license you install, configure, and maintain it yourself. This can be on premises or whatever cloud you choose. Mostly, I've heard of it being run on AWS, Azure, GCP, and TenCent.
  2. With a managed service InterSystems will install, configure, and maintain IRIS for you on a public cloud. 
  3. With Cloud SQL it is a SAAS (or should I say PAAS? DBAAS?).  You don't install anything.  However Cloud SQL is a special case. It is designed to integrate into larger systems as a composable module, offering only a subset of IRIS functionality, such as SQL and machine learning (ML) functions.  The rest of this article is about licensed and managed IRIS, not Cloud SQL.

Embedded Languages: Besides SQL, IRIS has always supported an object oriented language called ObjectScript, which is a descendant of the MUMPS medical language. It's very powerful language but not many people know it. Don't worry, IRIS also supports Embedded Python. 

Documentation: Because IRIS has historically been intertwined with ObjectScript, the documentation tends to be worded in object-oriented terminology.  You may find simple things like tables referred to as 'persistent classes'.  But this seems to be fading from the documentation over time, and anyway you can just ignore it unless you want to be an IRIS coder.

So IRIS supports the SQL you know and love, as well as Python, is translytical, runs on prem or cloud, is multi-model, and has some futuristic features like ECP.  There is much more but these are the things that stood out to me as important and interesting.  I think they would be relevant to other SQL devs and DBAs coming from other products.   If that is you, and you are trying IRIS I would be interested to hear your thoughts on the experience.

Discussão (0)1
Entre ou crie uma conta para continuar