Implement an efficient algorithm to detect patterns in a large stream of JSON data for DataVisor's fraud detection use cases.