1. A method for selectively transferring code to a data producer in a networked system, wherein the data producer generates data and sends the data to a device, comprising: receiving the data from the data producer on the device, wherein code on the device performs a processing operation on the data; analyzing characteristics of the data to determine whether performing the processing operation on the data producer can reduce resource usage; and if so, transferring the code from the device to the data producer; and executing the code on the data producer; wherein executing the code on the data producer can optimize resource usage in the networked system.