Lot of interesting ideas to move computation close to where the data reside can be found in this paper: http://www.cs.ox.ac.uk/dan.olteanu/papers/soc-sigmod16.pdf this is an example of how linear regression can be implemented which is intimately related to the article.