Scala Data Engineering On JVM Runtimes
Overview
Use this skill when Scala is the implementation language for distributed or streaming data systems. It helps agents manage build compatibility, packaging, JVM dependency issues, typed data models, serialization behavior, and runtime assumptions that often cause production failures long after code compiles.
When to Use
- building or modifying
Scala Spark jobs
- implementing
Flink, Kafka Streams, or JVM-native data processors in Scala
- managing
sbt builds, shaded JARs, or runtime compatibility
- choosing typed datasets, encoders, or JVM serialization strategies
- debugging classpath, version, or packaging problems in distributed runtimes
Do not assume compile success means distributed runtime safety.
Workflow
Define the runtime and compatibility surface.
Include:
- engine and version
Scala version
- JVM level
- cluster or container runtime
- connector and library compatibility
Shape the data model intentionally.
Choose:
- typed case classes or schemas
- serialization strategy
- encoder behavior
- where UDFs are truly needed
- how nulls and optional fields are represented
Package for the real deployment target.
Decide:
sbt or other build surface
- fat-jar or shaded-jar approach
- dependency conflict handling
- resource and config loading behavior
- how the job is launched and parameterized
Design for distributed execution, not driver-local convenience.
Check:
- partition behavior
- skew
- state growth
- checkpoint or savepoint needs
- accidental driver-side collection or closure capture
Validate with runtime realism.
Require:
- representative local or test-cluster execution
- packaging verification
- schema and compatibility checks
- observability and failure handling expectations
Common Rationalizations
| Rationalization |
Reality |
| "It compiles, so the job is fine." |
Distributed classpath, serialization, and dependency issues often appear only at runtime. |
| "We can fix the JAR if deployment fails." |
Packaging problems discovered at deploy time slow delivery and often hide deeper compatibility issues. |
| "A quick UDF is simpler." |
Overusing UDFs can hide schema, optimizer, and performance problems in JVM data engines. |
Red Flags
Scala, engine, and connector versions are not pinned together intentionally
- driver-local collections or closures leak into distributed execution
- shading or dependency conflicts are discovered only after deployment
- type or null behavior is unclear across schemas and case classes
- runtime config is embedded in code instead of explicit launch parameters
Verification
1---2name: scala-data-engineering-on-jvm-runtimes3description: Guides agents through Scala-based data engineering on JVM runtimes. Use when building Spark, Flink, Kafka Streams, or other Scala data jobs that require explicit build, packaging, type, and runtime discipline.4---56# Scala Data Engineering On JVM Runtimes78## Overview910Use this skill when `Scala` is the implementation language for distributed or streaming data systems. It helps agents manage build compatibility, packaging, JVM dependency issues, typed data models, serialization behavior, and runtime assumptions that often cause production failures long after code compiles.1112## When to Use1314- building or modifying `Scala` `Spark` jobs15- implementing `Flink`, `Kafka Streams`, or JVM-native data processors in `Scala`16- managing `sbt` builds, shaded JARs, or runtime compatibility17- choosing typed datasets, encoders, or JVM serialization strategies18- debugging classpath, version, or packaging problems in distributed runtimes1920Do not assume compile success means distributed runtime safety.2122## Workflow23241. Define the runtime and compatibility surface.25 Include:26 - engine and version27 - `Scala` version28 - JVM level29 - cluster or container runtime30 - connector and library compatibility31322. Shape the data model intentionally.33 Choose:34 - typed case classes or schemas35 - serialization strategy36 - encoder behavior37 - where UDFs are truly needed38 - how nulls and optional fields are represented39403. Package for the real deployment target.41 Decide:42 - `sbt` or other build surface43 - fat-jar or shaded-jar approach44 - dependency conflict handling45 - resource and config loading behavior46 - how the job is launched and parameterized47484. Design for distributed execution, not driver-local convenience.49 Check:50 - partition behavior51 - skew52 - state growth53 - checkpoint or savepoint needs54 - accidental driver-side collection or closure capture55565. Validate with runtime realism.57 Require:58 - representative local or test-cluster execution59 - packaging verification60 - schema and compatibility checks61 - observability and failure handling expectations6263## Common Rationalizations6465| Rationalization | Reality |66| --- | --- |67| "It compiles, so the job is fine." | Distributed classpath, serialization, and dependency issues often appear only at runtime. |68| "We can fix the JAR if deployment fails." | Packaging problems discovered at deploy time slow delivery and often hide deeper compatibility issues. |69| "A quick UDF is simpler." | Overusing UDFs can hide schema, optimizer, and performance problems in JVM data engines. |7071## Red Flags7273- `Scala`, engine, and connector versions are not pinned together intentionally74- driver-local collections or closures leak into distributed execution75- shading or dependency conflicts are discovered only after deployment76- type or null behavior is unclear across schemas and case classes77- runtime config is embedded in code instead of explicit launch parameters7879## Verification8081- [ ] Runtime, `Scala`, and library compatibility is explicit82- [ ] Packaging strategy matches the target execution environment83- [ ] Data model and serialization behavior are intentional84- [ ] Distributed execution risks are reviewed beyond compile success