Skip to main content
Process large datasets with GoRules on AWS Glue’s serverless Spark infrastructure.

Setup

1. Create requirements file

Create requirements.txt and upload to S3:

2. Configure Glue job parameters

Or for requirements file:

3. IAM permissions

Ensure your Glue job role has access to:
  • S3 buckets containing rules and data
  • Any other AWS services your rules might reference

Singleton evaluator

Use a singleton pattern with precompiled ZenDecisionContent for optimal performance:

Basic job

Processing structured columns

Process data from separate columns rather than JSON:

Error handling

Return structured results with success/error information:

Reading from Glue Data Catalog

Job bookmarks

Enable job bookmarks to process only new data incrementally:

Multiple rule files

Process with multiple decision files using a single loaders dict. All decisions are extracted from decisions.zip:

Parameterized jobs

Pass rule location as job parameter:
Run with:

Performance tuning

Worker configuration

Repartitioning

Coalesce for output

Best practices

Precompile on initialize. The ZenEvaluator converts dict[str, str] to dict[str, ZenDecisionContent] once, then the loader returns precompiled content for maximum performance. Broadcast loaders dict. Broadcast dict[str, str] (picklable) to all workers. Each worker precompiles once on first use. Use engine.evaluate directly. No need to call create_decision - the engine’s loader handles everything. Repartition appropriately. Match partition count to worker count (typically 2-4x the number of DPUs). Enable job bookmarks. For incremental processing, use transformation_ctx on both reads and writes. Store rules in S3. Keep decision files in S3 for easy updates without redeploying the job.
The ZenEvaluator precompiles JSON strings to ZenDecisionContent on first initialization per worker. The engine’s loader then returns precompiled content, avoiding repeated JSON parsing. This provides optimal performance for high-throughput processing.