Skip to main content
Version: 97.1

Configuration

Kafka resources​

Refer to Kpow's Kafka cluster configuration for documentation on how to configure Kafka resources for Factor House.

Supported Kafka resources include:

Kafka cluster configuration​

Factor House internal topics​

Factor House checks for the following internal topics in your primary cluster (the first bootstrap in your configuration) on startup and will attempt to automatically create them if required:

fh.metrics-fh_metric_store_pt1m-changelog
fh_metrics_pt1m
fh_metrics_pt1h
fh_metrics_p1d
fh_views
fh.snapshots-fh_snapshot_store-changelog
fh_snapshots
fh_audit_log

You can manually create these topics if you prefer, see Create internal topics. If your Kafka provider does not support segment configuration (e.g. Amazon MSK Serverless or Express brokers), you must create them manually.

Once started, Factor House creates two internal streaming compute applications:

fh.metrics
fh.snapshots

Time travel topics​

Time travel lets you view your resources as they were at a given point in time. Factor House stores this history in four internal topics.

Every minute, Factor House writes a snapshot of the state of each resource it observes to fh_views, and per-minute metrics to fh_metrics_pt1m. Both topics retain 7 days of data. Metrics are also rolled up into hourly (fh_metrics_pt1h) and daily (fh_metrics_p1d) aggregates, which are retained for 365 days. Broker configuration, topic configuration and schemas are not stored.

Minimum required ACLs​

At a minimum, Factor House must have ACL permission to describe clusters, topics, configuration, and groups.

A basic set of Kafka ACLs that allows Factor House to operate provides ALLOW on the following:

Kafka ResourceKafka ACLDetail
ClusterDescribe*
ClusterDescribeConfigs*
ClusterCreate* (if not manually creating Factor House topics)
TopicDescribe*
TopicDescribeConfigs*
TopicRead* (or Factor House topics only)
TopicWrite* (or Factor House topics only)
GroupDescribe*
GroupRead* (or Factor House groups only)

Factor House does not read from or write to topics other than internal ones as a part of normal operation.

Feature specific ACLS​

The following ACLS are optional and only required if you intend to permit the associated Factor House action.

Kafka ResourceKafka ACLRequired for user action
ClusterAlterACL_EDIT
ClusterAlterConfigsBROKER_EDIT
ClusterCreateTOPIC_CREATE
TopicAlterConfigsTOPIC_EDIT
TopicCreateTOPIC_CREATE
TopicDeleteTOPIC_DELETE, TRUNCATE_TOPIC
TopicReadTOPIC_INSPECT
TopicWriteTOPIC_PRODUCE
TopicReadTOPIC_CLONE_SOURCE
TopicWriteTOPIC_CLONE_SINK
GroupRead / DeleteGROUP_EDIT

Configuring Kafka ACLS​

info

Creating ACLs on a cluster with no existing ACL configuration can cause issues.

Consult your cluster provider documentation first.

For example the Amazon MSK ACL Guide describes extra ACLs required to allow inter-broker replication, and suggests not to set CLUSTER level ACLs.

Create a file containing client configuration for a user who has permissions to create ACLs.

security.protocol=SASL_PLAINTEXT
sasl.mechanism=PLAIN
sasl.jaas.config=org.apache.kafka.common.security.plain.PlainLoginModule required username="admin" password="admin-secret";

Basic ACL creation script​

Use the kafka-acls.sh script provided by Apache Kafka to create the basic set of ACLs described above. This allows Factor House to operate plus the ALTER CLUSTER ACL allowing Factor House to create and delete ACLs.

./kafka-acls.sh --bootstrap-server 127.0.0.1:9092 --command-config client.conf --add --allow-principal User:factorplatform --operation Describe --cluster '*'
./kafka-acls.sh --bootstrap-server 127.0.0.1:9092 --command-config client.conf --add --allow-principal User:factorplatform --operation DescribeConfigs --cluster '*'
./kafka-acls.sh --bootstrap-server 127.0.0.1:9092 --command-config client.conf --add --allow-principal User:factorplatform --operation Create --cluster '*'
./kafka-acls.sh --bootstrap-server 127.0.0.1:9092 --command-config client.conf --add --allow-principal User:factorplatform --operation Write --topic '*'
./kafka-acls.sh --bootstrap-server 127.0.0.1:9092 --command-config client.conf --add --allow-principal User:factorplatform --operation Read --topic '*'
./kafka-acls.sh --bootstrap-server 127.0.0.1:9092 --command-config client.conf --add --allow-principal User:factorplatform --operation Describe --topic '*'
./kafka-acls.sh --bootstrap-server 127.0.0.1:9092 --command-config client.conf --add --allow-principal User:factorplatform --operation DescribeConfigs --topic '*'
./kafka-acls.sh --bootstrap-server 127.0.0.1:9092 --command-config client.conf --add --allow-principal User:factorplatform --operation Describe --group '*'
./kafka-acls.sh --bootstrap-server 127.0.0.1:9092 --command-config client.conf --add --allow-principal User:factorplatform --operation Read --group '*'
./kafka-acls.sh --bootstrap-server 127.0.0.1:9092 --command-config client.conf --add --allow-principal User:factorplatform --operation Alter --cluster '*'

That set of ACLs can then be listed using kafka-acls.sh.

./kafka-acls.sh -bootstrap-server 127.0.0.1:9092 --command-config client.conf --list
Current ACLs for resource `ResourcePattern(resourceType=GROUP, name=*, patternType=LITERAL)`:
(principal=User:factorplatform, host=*, operation=READ, permissionType=ALLOW)
(principal=User:factorplatform, host=*, operation=DESCRIBE, permissionType=ALLOW)

Current ACLs for resource `ResourcePattern(resourceType=TOPIC, name=*, patternType=LITERAL)`:
(principal=User:factorplatform, host=*, operation=READ, permissionType=ALLOW)
(principal=User:factorplatform, host=*, operation=DESCRIBE, permissionType=ALLOW)
(principal=User:factorplatform, host=*, operation=WRITE, permissionType=ALLOW)
(principal=User:factorplatform, host=*, operation=DESCRIBE_CONFIGS, permissionType=ALLOW)

Current ACLs for resource `ResourcePattern(resourceType=CLUSTER, name=kafka-cluster, patternType=LITERAL)`:
(principal=User:factorplatform, host=*, operation=DESCRIBE_CONFIGS, permissionType=ALLOW)
(principal=User:factorplatform, host=*, operation=DESCRIBE, permissionType=ALLOW)
(principal=User:factorplatform, host=*, operation=CREATE, permissionType=ALLOW)
(principal=User:factorplatform, host=*, operation=ALTER, permissionType=ALLOW)

Create Factor House topics​

info

Note: this step is completely optional as Factor House will automatically create these topics on first launch. However, you can manually create them if required.

Using the same client configuration file as above, the following script correctly creates the required internal Factor House topics. You can run this script and create these topics on the primary cluster in which you expect Factor House to keep data.

Providers without segment configuration

Some managed Kafka services, such as Amazon MSK Serverless and Amazon MSK Express brokers, do not allow segment.bytes or segment.ms to be set on topics.

On these services, remove every segment.bytes and segment.ms line from the script below.

./kafka-topics.sh --create \
--bootstrap-server 127.0.0.1:9092 \
--command-config client.conf \
--topic fh_audit_log \
--replication-factor 3 \
--partitions 12 \
--config compression.type=gzip \
--config segment.bytes=104857600 \
--config retention.ms=-1
./kafka-topics.sh --create \
--bootstrap-server 127.0.0.1:9092 \
--command-config client.conf \
--topic fh_metrics_pt1m \
--replication-factor 3 \
--partitions 12 \
--config compression.type=gzip \
--config segment.bytes=104857600 \
--config segment.ms=86400000 \
--config retention.ms=604800000
./kafka-topics.sh --create \
--bootstrap-server 127.0.0.1:9092 \
--command-config client.conf \
--topic fh_metrics_pt1h \
--replication-factor 3 \
--partitions 12 \
--config compression.type=gzip \
--config segment.bytes=104857600 \
--config segment.ms=604800000 \
--config retention.ms=31536000000
./kafka-topics.sh --create \
--bootstrap-server 127.0.0.1:9092 \
--command-config client.conf \
--topic fh_metrics_p1d \
--replication-factor 3 \
--partitions 12 \
--config compression.type=gzip \
--config segment.bytes=104857600 \
--config segment.ms=604800000 \
--config retention.ms=31536000000
./kafka-topics.sh --create \
--bootstrap-server 127.0.0.1:9092 \
--command-config client.conf \
--topic fh_views \
--replication-factor 3 \
--partitions 12 \
--config compression.type=gzip \
--config segment.bytes=1073741824 \
--config segment.ms=86400000 \
--config retention.ms=604800000
./kafka-topics.sh --create \
--bootstrap-server 127.0.0.1:9092 \
--command-config client.conf \
--topic fh_snapshots \
--replication-factor 3 \
--partitions 12 \
--config compression.type=gzip \
--config segment.bytes=104857600 \
--config segment.ms=5400000 \
--config retention.ms=7200000 \
--config message.timestamp.type=LogAppendTime
./kafka-topics.sh --create \
--bootstrap-server 127.0.0.1:9092 \
--command-config client.conf \
--topic fh.metrics-fh_metric_store_pt1m-changelog \
--replication-factor 3 \
--partitions 12 \
--config compression.type=gzip \
--config cleanup.policy=compact,delete \
--config segment.bytes=52428800 \
--config segment.ms=1800000 \
--config retention.ms=5400000 \
--config message.timestamp.type=CreateTime
./kafka-topics.sh --create \
--bootstrap-server 127.0.0.1:9092 \
--command-config client.conf \
--topic fh.snapshots-fh_snapshot_store-changelog \
--replication-factor 3 \
--partitions 12 \
--config compression.type=gzip \
--config cleanup.policy=compact,delete \
--config segment.bytes=52428800 \
--config segment.ms=604800000 \
--config retention.ms=604800000 \
--config message.timestamp.type=CreateTime

Refer to Flex's Flink cluster configuration for documentation on how to configure Kafka resources for Factor House.

Supported deployments include:

Iceberg catalogs​

Factor House observes Apache Iceberg REST catalogs, configured with ICEBERG_CATALOG_* environment variables. See Iceberg configuration for the full reference, with examples for AWS Glue, Amazon S3 Tables, Confluent Tableflow and Unity Catalog.

Factor House configuration​

For now, you can refer to Kpow's environment variable reference for reference on how to configure Factor House's web server, as well as authentication, authorization and tenancy capabilities.

PostgreSQL configuration​

Factor House persists its configuration and state to a PostgreSQL database.

Prerequisites​

Factor House requires PostgreSQL >=14.

Factor House requires no extensions or manual schema setup. All database migrations run automatically on initialization of the product.

Database preparation​

Create a database and user for Factor House. If you're using a managed service (e.g. AWS RDS, Google Cloud SQL, Azure Database for PostgreSQL), follow your provider's instructions to create the database and user, then skip to PostgreSQL environment variables

For self-managed PostgreSQL you will need to create both a role and database for Factor House:

CREATE ROLE factor_platform WITH LOGIN PASSWORD 'secure-password-here';
CREATE DATABASE factor_platform WITH OWNER factor_platform TEMPLATE template0 ENCODING UTF8 LC_COLLATE 'en_US.UTF-8' LC_CTYPE 'en_US.UTF-8';

Ensure the user can connect from the Factor House host by configuring pg_hba.conf as appropriate for your network.

Factor House configuration​

Configure the PostgreSQL connection using the following environment variables:

VariableDescriptionRequiredDefault
POSTGRES_USERPostgreSQL usernameYes-
POSTGRES_PASSWORDPostgreSQL passwordYes-
POSTGRES_DB_NAMEDatabase name for Factor HouseNofactor_platform
POSTGRES_HOSTPostgreSQL server hostname or IPYes-
POSTGRES_PORTPostgreSQL server portNo5432
POSTGRES_SSLEnable SSL for PostgreSQL connectionNofalse
POSTGRES_SSLMODESSL mode (e.g. disable, prefer, require)Noprefer
POSTGRES_SSLROOTCERTPath to SSL root certificateNo-
POSTGRES_SSLCERTPath to SSL client certificateNo-
POSTGRES_SSLKEYPath to SSL client keyNo-
POSTGRES_AWS_WRAPPERWhether to enable the aws-advanced-jdbc-wrapper if using RDS with IAM authenticationNofalse

Connection notes​

Amazon RDS connection notes​

Factor House supports IAM database authentication for Amazon RDS and Aurora PostgreSQL instances.

Refer to the official AWS documentation to enable IAM authentication and create an IAM policy for Factor House.

Setting POSTGRES_AWS_WRAPPER=true configures Factor House to use the AWS Advanced JDBC Wrapper with the following defaults:

  • failover,efm2 wrapper plugins for cluster failover and host monitoring
  • A maximum connection pool lifetime of 10 minutes, ensuring connections are recycled before IAM auth tokens expire

Note: RDS requires SSL connections by default. Set POSTGRES_SSL=true when using the AWS wrapper.

Application name​

The connection is established with ApplicationName set to Factor House. This can be useful for identifying Factor House connections when debugging or monitoring active sessions in PostgreSQL (e.g. via pg_stat_activity).

Database connection over TLS​

For connections over a public network, enable TLS by setting the SSL environment variables above. Most managed database providers handle server-side certificate configuration automatically - you'll typically just need to set POSTGRES_SSL=true and POSTGRES_SSLMODE to your desired level (e.g. require or verify-full).

For self-managed PostgreSQL or mutual TLS (mTLS), provide the client certificate paths via POSTGRES_SSLROOTCERT, POSTGRES_SSLCERT, and POSTGRES_SSLKEY.