BEEM Gateway: Installation and Configuration

Technical guide for installing and configuring the BEEM Gateway agent, including environment setup, source and destination configuration, scheduling, and IAM requirements.

The BEEM Gateway is a lightweight, self-contained agent deployed inside your network. It handles secure data extraction from on-premises sources (databases, files, SFTP) and data delivery to on-premises destinations (e.g., Microsoft SQL Server). Data is transferred through an S3 bucket in your dedicated BEEM environment.

📘

For a high-level overview of pushing data to on-premises databases, see Gateway Destinations: Writing to On-Premises Databases.

Requirements

  • OS: Windows x64
  • Network: Outbound access to AWS S3 (ca-central-1) and CloudWatch Logs
  • Credentials: AWS access key (provided by BEEM) or EC2 instance profile

Installation

Deploy the Executable

  1. Place the beem-gateway.exe file in a dedicated directory (e.g., C:\beem-gateway\)
  2. Place your config.json in the same directory
  3. The gateway is a single self-contained executable — no runtime dependencies are required

Set Environment Variables

Set the following system-level environment variables (or configure them in config.json as a fallback):

Environment VariableDescription
BEEM_GATEWAY_INSTANCEUnique identifier for this gateway instance (used for S3 folder and CloudWatch log group)
BEEM_GATEWAY_ACCESS_KEY_IDAWS access key ID (provided by BEEM)
BEEM_GATEWAY_ACCESS_KEY_SECRETAWS secret access key (provided by BEEM)
BEEM_GATEWAY_S3_BUCKETAWS S3 bucket name (provided by BEEM)
BEEM_GATEWAY_CONFIG_PATH(Optional) Directory from which the gateway executes
📘

If the gateway runs on an EC2 instance, you can use an instance profile instead of access keys.

Schedule Execution

Create a Windows Scheduled Task to run the gateway on a recurring schedule (e.g., nightly at 23:00):

schtasks /create /tn "BEEM-Gateway" /tr "C:\beem-gateway\beem-gateway.exe" /sc daily /st 23:00 /F /rl highest /ru SYSTEM

The task runs as SYSTEM and does not require a user to be logged in.

Verify Operation

  1. Run beem-gateway.exe manually to confirm it connects and transfers data
  2. Check the local log file generated in the gateway directory
  3. Confirm data appears in the BEEM Datalake (for sources) or in your target database (for destinations)

Configuration File

The gateway reads its source and destination configuration from a config.json file located in the same directory as the executable.

Sources

Sources define where the gateway extracts data from. Extracted data is uploaded to S3 and ingested into the BEEM warehouse.

Database Source (MSSQL)

{
  "Sources": [
    {
      "Type": "Mssql",
      "Name": "erp-database",
      "Server": "sql-server.local",
      "Port": 1433,
      "Database": "MyDatabase",
      "User": "beem_reader",
      "Password": "••••••••",
      "Tables": ["dbo.Customers", "dbo.Orders"]
    }
  ]
}
ParameterDescription
TypeMssql or Pervasive
NameFriendly name for this source
ServerSQL Server hostname or named instance
Port(Optional) SQL Server port — omit to use SQL Browser for named instances
DatabaseDatabase name
UserSQL user — omit for Windows Authentication
PasswordSQL password — omit for Windows Authentication
TablesArray of tables to extract. Supports custom queries: "alias:SELECT ..."

File Source (Local or SFTP)

{
  "Sources": [
    {
      "Type": "File",
      "Name": "local-exports",
      "Path": "/data/exports",
      "Regex": ".*\\.csv$"
    },
    {
      "Type": "Sftp",
      "Name": "vendor-sftp",
      "Server": "sftp.example.com",
      "Port": 22,
      "Username": "user",
      "Password": "••••••••",
      "Path": "/data/exports",
      "Regex": ".*\\.csv$"
    }
  ]
}
ParameterDescription
TypeFile (local) or Sftp (remote)
NameFriendly name for this source
PathDirectory containing files to extract
Server / Port(SFTP only) Server hostname and port
Username / Password(SFTP only) SFTP credentials
Regex(Optional) Filter file names by regular expression
PostExtractionExtension(Optional) Rename source files after extraction (e.g., bkcsv)

Destinations

Destinations define where the gateway pushes data to. Data is read from your BEEM Redshift warehouse and written to an on-premises target database.

MSSQL Destination

{
  "Destinations": [
    {
      "Type": "Mssql",
      "Name": "analytics-push",
      "Redshift": {
        "Host": "cluster.abc123.ca-central-1.redshift.amazonaws.com",
        "Port": 5439,
        "Database": "analytics",
        "User": "readonly_user",
        "Password": "••••••••"
      },
      "Mssql": {
        "Server": "sql-server.local",
        "Port": 1433,
        "Database": "TargetDB",
        "User": "beem_writer",
        "Password": "••••••••"
      },
      "Tables": [
        "public.dim_customer",
        "revenue_summary:SELECT customer_id, SUM(amount) as total FROM public.orders GROUP BY customer_id"
      ],
      "CreateIfNotExists": true,
      "Truncate": true
    }
  ]
}
ParameterDescription
TypeMssql
NameFriendly name for this destination
Redshift.HostRedshift cluster endpoint (provided by BEEM)
Redshift.PortRedshift port (default: 5439)
Redshift.DatabaseRedshift database name
Redshift.User / PasswordRedshift credentials (provided by BEEM)
Mssql.ServerTarget SQL Server hostname
Mssql.Port(Optional) Target SQL Server port
Mssql.DatabaseTarget database name
Mssql.User / PasswordTarget SQL credentials — omit for Windows Authentication
TablesArray of Redshift tables or custom queries (alias:SELECT ...)
CreateIfNotExists(Optional) Auto-create target tables from Redshift schema
Truncate(Optional) Truncate target tables before each load

How Destination Transfers Work

Each destination transfer uses a staging-table approach for reliability:

  1. Schema is read from Redshift (column names, types, nullability)
  2. If CreateIfNotExists is enabled, the target table is created in MSSQL
  3. A temporary staging table is created in SQL Server
  4. Data is streamed row-by-row from Redshift into the staging table (constant memory usage)
  5. In a single transaction: the target is optionally truncated, then all rows are inserted from staging
  6. On failure, the transaction rolls back — the target table remains unchanged

Type Mapping (Redshift to MSSQL)

Redshift TypeMSSQL Type
smallintSMALLINT
integerINT
bigintBIGINT
realREAL
double precisionFLOAT
numeric / decimalDECIMAL(p, s)
booleanBIT
varcharNVARCHAR(n) or NVARCHAR(MAX) if > 4000
charNCHAR(n)
textNVARCHAR(MAX)
dateDATE
timestampDATETIME2
timestamptzDATETIMEOFFSET
timeTIME
uuidUNIQUEIDENTIFIER
byteaVARBINARY(MAX)

Monitoring

  • A log file is generated locally and uploaded to S3 after each run
  • Logs are also sent to AWS CloudWatch under the log group matching your instance name
  • When DataObjectIds are configured, EventBridge lifecycle events (START / SUCCESS / FAIL) are emitted and appear in BEEM's Monitor section

IAM Requirements

The BEEM team provides pre-configured AWS credentials. The gateway user requires:

  • S3: PutObject, GetObject, ListBucket on the designated gateway bucket
  • CloudWatch Logs: CreateLogGroup, CreateLogStream, PutLogEvents, and related read permissions