A load job dies halfway through at 3 a.m., and someone reruns it. What, specifically, stops the rerun from double-counting every row that already landed? If the honest answer is "whoever reruns it knows to clean up first", the pipeline is safe by discipline, and discipline fails at the worst moments. This guide covers how to make reruns safe by default on Redshift and Spark, against three simple criteria: A rerun must not need a human to remember a cleanup step. It must not depend on the database to reject duplicates. The input set must be the same on the second attempt as on the first. Redshift will accept your duplicate The first trap is assuming a primary key protects you. In Redshift, uniqueness, primary key and foreign key constraints are informational . An insert can succeed even when it violates one, and the query planner still treats the constraint as true when building plans. If your data breaks that assumption, some query results can come back wrong. The be...
A Spark job is slow, so someone doubles the cluster. The job is still slow, and now it costs twice as much. If that sounds familiar, cluster size was probably never the constraint. This guide covers the checks worth running before approving more nodes, and it separates documented Spark behavior from judgment calls. The deciding question is simple: can the stage that is slow actually spread its work across more cores? If it cannot, extra nodes are a tax rather than a fix. A stage is as slow as its slowest task Spark runs one task per partition, and cores only help if there are enough similarly sized tasks to occupy them. The official tuning guide says a cluster will not be fully used unless parallelism is high enough for each operation, and it suggests two to three tasks per CPU core as a starting point. That guidance is a floor for utilization. It says nothing about how evenly the work is spread across tasks. A stage with 800 tasks can still be dominated by one task holding most ...