DeepSee: Databases, Namespaces, and Mappings - Part 1 of 5
Tags: analytics, tutorial, database, beginners
Published: 2021-11-26 18:39:02

<p dir="ltr" id="docs-internal-guid-f3c03295-67ce-2cca-e268-e21215d9ec6b" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt;">
  <span style="font-size:11pt;font-family:Arial;color:#000000;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;">I am planning to implement Business Intelligence based on the data in my instances. What is the best way to set up my databases and environment to use DeepSee?</span>
</p>

<p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt;">
   
</p>

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/y8up5plcqf1sm95ofrqt.png)


<span>This tutorial addresses this question by showing three examples of architecture for DeepSee. We will start from a basic architectural model and highlight its limitations. The subsequent model is recommended for Business Intelligence applications of intermediate complexity and should be sufficient for most use cases. We will end this tutorial by describing how to enhance the flexibility of the architecture for managing advanced implementations. </span>

Each example in this tutorial introduces a new databases and global mappings, together with a discussion on why and when they should be set up. While building up the architecture, the benefits provided by the more flexible examples will be highlighted.

<h2 dir="ltr">
  Before starting
</h2>

<h3 dir="ltr">
  Primary and Analytics servers
</h3>

<p dir="ltr">
  To make data highly available InterSystems generally recommends using mirroring or shadowing and base a DeepSee implementation on the mirror/shadow server. The machine hosting the original copy of the data is called the Primary server, whereas the machines hosting copies of the data and the Business Intelligence applications are often called the Analytics (or sometimes Reporting) servers.
</p>

<p dir="ltr">
  Having Primary and Analytics servers is very important, the main reason being to avoid performance problems on either server. Please check the documentation about <a href="docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY=D2IMP_ch_overview#D2IMP_overview_architecture">Recommended Architecture</a>.
</p>

<h3 dir="ltr">
  Data and application code
</h3>

<p dir="ltr">
  Storing source data and code in the same database usually works well only for small-scale applications. For more extensive applications it is recommended to store source data and code in two dedicated databases, which allows you to share code with all namespaces where DeepSee runs while keeping the data separate. The database for source data should be mirrored from the Production server. This database can be either Read-only or Read-Write. It is recommended to keep journaling enabled for this database.
</p>

<p dir="ltr">
  Source classes and custom applications should be stored in a dedicated database on both the Production and Analytics servers. Note that these two databases for source code do not need to be in-synch or even run the same Caché version. Journaling is usually not needed, provided the code is regularly backed up elsewhere.
</p>

<p dir="ltr">
  In this tutorial we will have the following configuration. The APP namespace on the Analytics server has the APP-DATA and the APP-CODE as default databases. The APP-DATA database has access to the data (the source table class and its facts) on the source data Database on the Primary. The APP-CODE database stores the Caché code (.cls and .INT files) and other custom code. This separation of data and code is a typical architecture and allows the user, for example, to efficiently deploy DeepSee code and custom application.
</p>

<p dir="ltr">
   
</p>

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5vnv0iw8gxm1trci2xcn.png)

<h3 dir="ltr" style="line-height:1.38;margin-top:16pt;margin-bottom:4pt;">
  <span style="font-size:13.999999999999998pt;font-family:Arial;color:#434343;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;">Running DeepSee on different namespaces</span>
</h3>

<p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt;">
  <span style="font-size:11pt;font-family:Arial;color:#000000;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;">Business Intelligence implementations using DeepSee often run from different namespaces. In this post we will show how to set up a single APP namespace but the same procedure applies to all namespaces where the business intelligence application runs. </span>
</p>

<h3 dir="ltr" style="line-height:1.38;margin-top:16pt;margin-bottom:4pt;">
  <span style="font-size:13.999999999999998pt;font-family:Arial;color:#434343;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;">Documentation</span>
</h3>

<p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt;">
  <span style="font-size:11pt;font-family:Arial;color:#000000;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;">It is recommended to get familiar with the documentation page </span><a href="http://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY=D2IMP_ch_setup"><span style="font-size:11pt;font-family:Arial;color:#1155cc;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:underline;-webkit-text-decoration-skip:none;text-decoration-skip-ink:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;">Perform the Initial Setup</span></a><span style="font-size:11pt;font-family:Arial;color:#000000;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;">. This page includes setting up web applications, how to place DeepSee globals in separate databases, and a list of alternative mappings for DeepSee globals. </span>
</p>

<p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt;">
   
</p>

* * *

<span style="font-size:11pt;font-family:Arial;color:#000000;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;">In the <a href="https://community.intersystems.com/post/deepsee-databases-namespaces-and-mappings-part-2-5">second part</a> of this series we will show with the implementation of a basic architectural model </span>