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
- Place the
beem-gateway.exefile in a dedicated directory (e.g.,C:\beem-gateway\) - Place your
config.jsonin the same directory - 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 Variable | Description |
|---|---|
BEEM_GATEWAY_INSTANCE | Unique identifier for this gateway instance (used for S3 folder and CloudWatch log group) |
BEEM_GATEWAY_ACCESS_KEY_ID | AWS access key ID (provided by BEEM) |
BEEM_GATEWAY_ACCESS_KEY_SECRET | AWS secret access key (provided by BEEM) |
BEEM_GATEWAY_S3_BUCKET | AWS 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 SYSTEMThe task runs as SYSTEM and does not require a user to be logged in.
Verify Operation
- Run
beem-gateway.exemanually to confirm it connects and transfers data - Check the local log file generated in the gateway directory
- 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"]
}
]
}| Parameter | Description |
|---|---|
| Type | Mssql or Pervasive |
| Name | Friendly name for this source |
| Server | SQL Server hostname or named instance |
| Port | (Optional) SQL Server port — omit to use SQL Browser for named instances |
| Database | Database name |
| User | SQL user — omit for Windows Authentication |
| Password | SQL password — omit for Windows Authentication |
| Tables | Array 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$"
}
]
}| Parameter | Description |
|---|---|
| Type | File (local) or Sftp (remote) |
| Name | Friendly name for this source |
| Path | Directory 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
}
]
}| Parameter | Description |
|---|---|
| Type | Mssql |
| Name | Friendly name for this destination |
| Redshift.Host | Redshift cluster endpoint (provided by BEEM) |
| Redshift.Port | Redshift port (default: 5439) |
| Redshift.Database | Redshift database name |
| Redshift.User / Password | Redshift credentials (provided by BEEM) |
| Mssql.Server | Target SQL Server hostname |
| Mssql.Port | (Optional) Target SQL Server port |
| Mssql.Database | Target database name |
| Mssql.User / Password | Target SQL credentials — omit for Windows Authentication |
| Tables | Array 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:
- Schema is read from Redshift (column names, types, nullability)
- If
CreateIfNotExistsis enabled, the target table is created in MSSQL - A temporary staging table is created in SQL Server
- Data is streamed row-by-row from Redshift into the staging table (constant memory usage)
- In a single transaction: the target is optionally truncated, then all rows are inserted from staging
- On failure, the transaction rolls back — the target table remains unchanged
Type Mapping (Redshift to MSSQL)
| Redshift Type | MSSQL Type |
|---|---|
smallint | SMALLINT |
integer | INT |
bigint | BIGINT |
real | REAL |
double precision | FLOAT |
numeric / decimal | DECIMAL(p, s) |
boolean | BIT |
varchar | NVARCHAR(n) or NVARCHAR(MAX) if > 4000 |
char | NCHAR(n) |
text | NVARCHAR(MAX) |
date | DATE |
timestamp | DATETIME2 |
timestamptz | DATETIMEOFFSET |
time | TIME |
uuid | UNIQUEIDENTIFIER |
bytea | VARBINARY(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
DataObjectIdsare 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,ListBucketon the designated gateway bucket - CloudWatch Logs:
CreateLogGroup,CreateLogStream,PutLogEvents, and related read permissions
Updated 21 days ago
