Implement an algorithm to find the maximum subarray sum, and discuss how you would scale this to run on a distributed dataset.