查找

Article
· Juil 13, 2024 3m de lecture

How to separate source code and data in different databases

   

 

📜 Santa Tecla, verse 8: "Hover your mouse over the screen, and the sea of data will open a path before you!!"

 

Hello community, first of all, apologies if anyone was offended by the blasphemy 😔

Have you ever thought it would be interesting to have the source code separated from the database data? Perhaps you'd like to be able to back up your code without copying gigabytes of client data.

Below, I'll explain the steps to separate your sea formed by the source code and data into two different databases within a namespace.

For this example, I'll start with a new namespace that I'll create for the demonstration.

 

First, we will create 2 new databases:

1. Access the portal and navigate to the section for Local Databases:

 

We will click on the "Create New Database" button:

 

We will give it a name and specify the folder where it will be stored (I've prefixed it with "Tutorial" because I plan to name the Namespace "Tutorial"):

 

Now it allows us to choose the size we want to allocate and whether we want to enable journaling for it:

 

We select "Create New Resource":

 

We assign the name of the new resource, provide a description, and if appropriate, mark the permissions for public access:

 

Next, we follow the same steps for the other database for the data:

We also select "Create New Resource":

 

Now we have our two databases created.

 

Now we will create the new Namespace and assign the 2 Databases we just created to it.

We access the Namespaces section:

 

 

We click on the "Create new Namespace" button.

 

We give it a name and choose the database for the data and for the source code, then we click the "Save" button.

 

And voilà, we now have our shiny new namespace created with 2 separate databases—one for data and another for source code.

This could also be very useful in situations like... Imagine you have a database with a massive amount of data that is shared by all members of the development team.

These team members might have laptops that they carry around, and you wouldn't want those laptops to have a local copy of the database data, either for security reasons or because it would require creating test data on all of them.

In that case, it could be a good idea to create the source code Namespace locally and the routines in a remote database. "What? How would you connect to a remote database?" Piece of cake!

 

Connecting to a remote database. **You need to configure the remote server as ECP (I'll explain it at the end of the tutorial).

We go to the section for remote servers to configure it (if it's not already configured).

 

We click on the "Data Servers" button:

 

And we add the new server.

 

We fill in the information:

 

 

By default, it will create it as disabled. Click the "Change State" button to activate it:

 

 

Now we go to the section for Remote Databases.

 

And we click on the "Create Remote Database" button:

We will select the server that hosts the remote database and choose it from the dropdown menu:

 

Next, we are going to create a new "Hybrid" Namespace with the source code information on the local machine and the data on a remote server.

We access the Namespaces section and click on the create Namespace button. This time, under the database section for globals, we will select the Remote Database option and choose the remote Database we have created:

 

And now we have our amazing Hybrid Namespace configured!

**Configuring server as ECP (to serve remote databases, requires a paid license):

 

We set the maximum number of data servers, SSL options, etc., and then click on the "Save" and "Activate" buttons:

 

Now, we could indeed have our data separated within the same server or even across different servers.

Here's a video on how to create databases and create/configure a Namespace:

 

 

I hope this tutorial makes the long journey through the desert 🌴🐪 to earn forgiveness from the CTO / CIO and reach the promised retirement more enjoyable.

See you in the next post! Let me know if you found this article interesting; all your comments or questions are always welcome. 🙌

Discussion (0)1
Connectez-vous ou inscrivez-vous pour continuer
Question
· Juil 13, 2024

How to read the routine object code

How to see the code of the routine objects in the database. While importing the routine in the xml format the object code is in Database64 format but not able to see the actual code. How to decompile or how to see the code of the routines. 

3 Comments
Discussion (3)1
Connectez-vous ou inscrivez-vous pour continuer
Discussion (8)2
Connectez-vous ou inscrivez-vous pour continuer
Article
· Juil 12, 2024 6m de lecture

Base de Dados Multivolume: um molho assombroso!

 

IS Comunidade de Desenvolvedores, Eu 👑 você.

Base de Dados Multivolume

Eu obtive essa explicação diretamente da documentação, mas suponhamos que eu tenha perguntado a uma LLM para evitar dizer que a copiei :)

Por defeito, sua base de dados em IRIS usa um único arquivo IRIS.DAT. Você pode configurar sua base de dados para que se expanda automaticamente em volumes adicionais (IRIS-0001.VOL, IRIS-0002.VOL, e assim sucessivamente)  ao alcançar um limite de tamanho específico. Também pode expandir deliberadamente sua base de dados em volumes adicionais. Os volumes adicionais podem residir no mesmo diretório que IRIS.DAT e/ou em um conjunto de diretórios adicionais.

estou passando rapidamente por essa característica e estou a colocando em prova, mas o que quero fazer é estabelecer um limite pequeno e revisar a operação de expansão em múltiplos volumes em um PVC alternativo (diretório). Sem dúvida, as ramificações em respeito a Mirroring, Rendimento (farra!) e Gestão são enormes e o seguinte que necessito é um meio simples para entendê-las, então aqui está. A solução mais direta considera se há um "callback" onde possamos por exemplo portar um novo volume na nuvem antes que a expansão chegue ao tamanho limite.

Ambiente

Tenho um deploy em execução em 2024.1 (Build 263U) com um PVC OpenEBS de 50 GiB para o meu $ISC_DATA_DIRECTORY, o configurei há aproximadamente um mês.

Adicionei um PVC OpenEBS adicional ao meu namespace:

#kind: PersistentVolumeClaim
#apiVersion: v1
#metadata:
#  name: jiva-iris-volume-claim
#spec:
#  storageClassName: openebs-jiva-csi-default
#  accessModes:
#    - ReadWriteOnce
#  resources:
#    requests:
#      storage: 50Gi
#--
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
  name: jiva-iris-volume-claim-mv
spec:
  storageClassName: openebs-jiva-csi-default
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: 50Gi

O apliquei

sween@run1:~$ kubectl apply -f deezwatts-volume.yaml -n rivian
persistentvolumeclaim/jiva-iris-volume-claim-mv created

O juntei e apliquei no meu deploy através do meu container init:

<snips>
volumes:
   - name: task-pv-storage
        persistentVolumeClaim:
            claimName: jiva-iris-volume-claim
        - name: task-pv-storage-mvd
          persistentVolumeClaim:
            claimName: jiva-iris-volume-claim-mv
<snips>
volumeMounts:
    - name: task-pv-storage
   mountPath: /data
    - name: task-pv-storage-mvd
   mountPath: /data-mvd

Agora estamos configurando outro volume para a expansão multinível para `/data-mvd`.



Configuração

Aqui está a forma rápida na qual o fiz, disfarçando-me de Administrador de Sistemas (Advertência: modo escuro não ativado 🕶️)

Vamos criar a base de dados no volume principal para a instância e revisar as novas propriedades da operação.

Criando a base de dados "mvd" no volume principal, as novidades são as seguintes:

O limite do novo volume é onde planejamos as coisas inicialmente para o gatilho de expansão. Há outros lugares para configurar o lugar onde se criarão os arquivos .DAT de transbordamento. É claro, preste atenção ao texto de ajuda que aparece abaixo do parâmetro de configuração, receberá de imediato uma lição sobre as melhores práticas 💯💯.

Coloque o valor zero para desabilitar a criação automática de novos volumes. Se colocar um valor diferente de zero, quando o IRIS.DAT se expandir para além desse limite, se criará um novo arquivo de volume chamado IRIS-0001.VOL. Quando a expansão fizer crescer esse arquivo para além desse limite, se criará IRIS-0002.VOL, e assim sucessivamente. Para valores diferentes de zero, se recomenda um mínimo d e1 terabyte para evitar um número excessivo de arquivos. Cada base de dados está limitada a 200 volumes.

Agora, monte a nova base de dados. Não poderá configurá-la posteriormente até que esteja montada.

Encontrará na lista de bases de dados a coluna de volumes.

Aqui é onde se configura o lugar alternativo para a base de dados que queremos expandir volumes múltiplos.



Expandir

Com o limite da base de dados sendo bastante pequeno, me confundi um pouco com a ordem das coisas, mas valeu a pena mostrar.

Para gerar um esgotamento de espaço em IRIS.DAT, adicionei um namespace em cima da base de dados:

Uma vez que tive o namespace configurado, configurei o administrador de pacotes ZPM e instalei algumas coisas do openexchange.
 

irisowner@iris-deezwatts-deployment-7b9bfcff8f-dssln:~$ irissession IRIS

Node: iris-deezwatts-deployment-7b9bfcff8f-dssln, Instance: IRIS

USER>zn "MVD"
MVD>zn "%SYS" d ##class(Security.SSLConfigs).Create("z") s r=##class(%Net.HttpRequest).%New(),r.Server="pm.community.intersystems.com",r.SSLConfiguration="z" d r.Get("/packages/zpm/latest/installer"),$system.OBJ.LoadStream(r.HttpResponse.Data,"c")

Load started on 06/04/2024 13:43:08
Loading file /data/IRIS/mgr/Temp/z9mu1CvnPnaGbA.xml as xml
Imported class: %ZPM.Installer
Compiling class %ZPM.Installer
Compiling routine %ZPM.Installer.1
Load finished successfully.

%SYS>zpm

=============================================================================
|| Welcome to the Package Manager Shell (ZPM). version 0.7.1               ||
|| Enter q/quit to exit the shell. Enter ?/help to view available commands ||
|| Current registry https://pm.community.intersystems.com                  ||
=============================================================================
zpm:%SYS>install "zpm-registry"

Agora podemos ver o "molho" de base de dados multivolume na interface de usuário da base de dados:

E também na estrutura de pastas do pod:

irisowner@iris-deezwatts-deployment-7b9bfcff8f-dssln:/data-mvd$ ls -ltr /data-mv*
total 5140
drwxrwxrwx 2 irisowner irisowner   16384 Jun  4 11:56 lost+found
-rw-rw---- 1 irisowner irisowner      20 Jun  4 12:11 iris.dbdir
-rw-rw---- 1 irisowner irisowner 5242880 Jun  4 12:25 IRIS-0022.VOL
irisowner@iris-deezwatts-deployment-7b9bfcff8f-dssln:/data-mvd$ ls -ltr /data/IRIS/mgr/mvd
total 164
drwxrwxrwx 2 irisowner irisowner    4096 Jun  4 11:15 stream
-rw-rw---- 1 irisowner irisowner      63 Jun  4 12:01 iris.lck
-rw-rw---- 1 irisowner irisowner 5242880 Jun  4 12:11 IRIS-0001.VOL
-rw-rw---- 1 irisowner irisowner 5242880 Jun  4 12:11 IRIS-0002.VOL
-rw-rw---- 1 irisowner irisowner 5242880 Jun  4 12:11 IRIS-0003.VOL
-rw-rw---- 1 irisowner irisowner 5242880 Jun  4 12:11 IRIS-0004.VOL
-rw-rw---- 1 irisowner irisowner 5242880 Jun  4 12:11 IRIS-0005.VOL
-rw-rw---- 1 irisowner irisowner 5242880 Jun  4 12:11 IRIS-0006.VOL
-rw-rw---- 1 irisowner irisowner 5242880 Jun  4 12:11 IRIS-0007.VOL
-rw-rw---- 1 irisowner irisowner 5242880 Jun  4 12:11 IRIS-0008.VOL
-rw-rw---- 1 irisowner irisowner 5242880 Jun  4 12:11 IRIS-0009.VOL
-rw-rw---- 1 irisowner irisowner 5242880 Jun  4 12:11 IRIS-0010.VOL
-rw-rw---- 1 irisowner irisowner 5242880 Jun  4 12:11 IRIS-0012.VOL
-rw-rw---- 1 irisowner irisowner 5242880 Jun  4 12:11 IRIS-0015.VOL
-rw-rw---- 1 irisowner irisowner 5242880 Jun  4 12:11 IRIS-0018.VOL
-rw-rw---- 1 irisowner irisowner 5242880 Jun  4 12:11 IRIS-0016.VOL
-rw-rw---- 1 irisowner irisowner 5242880 Jun  4 12:11 IRIS-0019.VOL
-rw-rw---- 1 irisowner irisowner 5242880 Jun  4 12:11 IRIS-0020.VOL
-rw-rw---- 1 irisowner irisowner 5242880 Jun  4 12:11 IRIS-0017.VOL
-rw-rw---- 1 irisowner irisowner 5242880 Jun  4 12:11 IRIS-0014.VOL
-rw-rw---- 1 irisowner irisowner 5242880 Jun  4 12:11 IRIS-0013.VOL
-rw-rw---- 1 irisowner irisowner 5242880 Jun  4 12:11 IRIS-0011.VOL
-rwxrwxrwx 1 irisowner irisowner 5242880 Jun  4 13:08 IRIS.DAT
-rw-rw---- 1 irisowner irisowner 5242880 Jun  4 13:08 IRIS-0021.VOL

Acho que tenho um novo brinquedo para me entreter!


Conclusão

Definitivamente isso foi uma publicação rápida e tenho que voltar ao trabalho. Provavelmente deveria ter convertido em uma discussão em lugar de artigo, mas espero com ansiedade futuras experiências e ações compartilhadas da comunidade com essa característica a medida que seja adotada.

Discussion (0)1
Connectez-vous ou inscrivez-vous pour continuer
Annonce
· Juil 12, 2024

[Vidéo] Comment construire une Supply Chain agile, résiliente et intelligente ?

Salut la Communauté!

Profitez de regarder la nouvelle vidéo sur la chaîne Youtube d'InterSystems France :

📺 Comment construire une Supply Chain agile, résiliente et intelligente ?

Intervenants :
🗣 Isabelle Bouchoucha, Directeur Conseil - Expert Supply Chain, CGI Business Consulting sur le sujet " Intégration de bout en bout : le facteur clé d'une supply chain plus durable "
🗣 Hervé Hillion, Associé, SCALE sur le sujet " Modéliser, évaluer, simuler et optimiser la supply chain de bout en bout grâce au jumeau numérique "
🗣 @Sylvain Guilbaud, Expert InterSystems France  sur le sujet " Les évolutions technologiques nécessaires pour accroître la visibilité, l'agilité et la résilience de votre supply chain "

Abonnez-vous à notre chaîne youtube pour plus de vidéos et restez à l'écoute !

Discussion (0)0
Connectez-vous ou inscrivez-vous pour continuer