What is our primary use case?
We have used Apache Spark Streaming for ingestion from streaming sources such as Apache Kafka. Another use case is for building a Customer 360, specifically C360 in real-time. Additionally, we used it to build a real-time feature store to build features that will be used for machine learning models and AI models.
When building this customer profile with Apache Spark Streaming, we create a micro-batch of one minute for customer profiling. For example, we track email changes, contact changes, and address changes. This approach is near-real-time due to the micro-batch.
By using Apache Spark Streaming, the data freshness rate and latency have decreased significantly. Earlier we used to run 24-hour batches, and now it is less than one minute, allowing us to communicate any customer changes, such as address or email, to downstream systems such as Adobe Experience Platform for marketing within one minute, capturing all changes in near real-time.
We have integrated Apache Spark Streaming with Google's Cloud Storage (GCS) and Google BigQuery. Additionally, we have integrated with native HDFS and Hive as well.
What is most valuable?
The best feature of Apache Spark Streaming is that it's built upon the Spark SQL engine. This is easy for someone coming from a SQL background to work with real-time data, even if they are new to real-time processing. They can quickly get started using the Spark SQL engine.
Another valuable feature is that we can control many aspects such as the configuration of the engine, memory management, and have a checkpointing mechanism that allows us to manually start or restart jobs from a specific point. This is particularly useful for restoring messages of a Kafka topic from a specific date and time using the checkpointing mechanism.
The integration with Spark's ecosystems such as MLlib and GraphX has significant potential, although I have not worked on that part as we focus mainly on data engineering.
We can handle late-arriving data with Apache Spark Streaming. Sometimes aggregation results might be missed if data arrives out of order, but features such as windowing allow us to manage out-of-order data by specifying a watermark time. Recently released mechanisms to query the state make it easier to handle data programmatically.
What needs improvement?
One improvement I would expect is real-time processing instead of micro-batch or near real-time. Frameworks such as Apache Beam or Apache Flink process data in real-time, and integrating this capability into Apache Spark Streaming would be beneficial.
Another improvement could be in the job stopping process. In the DataProc environment, we have to place a file for the Apache Spark Streaming job to detect and stop gracefully. A feature to stop the job directly from the UI would be helpful.
For how long have I used the solution?
I have worked with Apache Spark Streaming for over one year. The last time I worked with it was eight months back.
What was my experience with deployment of the solution?
Setting up Apache Spark Streaming is not difficult because there is good documentation on their website. If we follow it step-by-step, challenges won't arise; it's pretty straightforward.
What do I think about the stability of the solution?
We have not experienced downtime with Apache Spark Streaming, but we have had crashes. Sometimes the state memory keeps piling up, necessitating tuning. We had crashes, but not very often and were able to resolve these issues by checking load times.
What do I think about the scalability of the solution?
Apache Spark Streaming is extremely scalable. We used it in production to process around 120 million events in a day. In seconds, we used to get 120-130 events. It's a very good framework for scalability.
How are customer service and support?
The community around Apache Spark Streaming is great. Compared to other frameworks, Apache Spark has the best community with major committers from Databricks. You have a very good community for Apache Spark Streaming.
How would you rate customer service and support?
Which solution did I use previously and why did I switch?
Before Apache Spark, I haven't worked on anything in real-time data processing. Apache Spark introduced me to real-time data processing. After Apache Spark, I worked with Apache Beam, which I'm currently working on.
When we initially thought of doing real-time processing, we considered Apache Spark Structured Streaming, Flink, and Apache Beam. We chose Apache Spark because it has many Python contributions, and our team consists mostly of Python engineers. Apache Spark was also more mature compared to Flink and Apache Beam at that point in time.
How was the initial setup?
Setting up Apache Spark Streaming is not difficult, as there is good documentation on their website on how to get started. Following it step-by-step, challenges won't arise; it's pretty straightforward.
What about the implementation team?
We hosted Apache Spark Streaming on GCP, using Cloud DataProc for running the Spark cluster. We deployed using GCloud commands or had our Python Airflow DAG for deployment, starting and stopping jobs.
What was our ROI?
By integrating Apache Spark Streaming, the data freshness rate, and latency have significantly improved from 24-hour batch processing to less than one minute. This improvement facilitated faster communication to downstream systems, aiding marketing campaigns.
What's my experience with pricing, setup cost, and licensing?
Apache Spark Streaming is completely open source, and you don't need any fees.
Running on the managed clusters using DataProc, we leverage Google's best practices for cluster management, scaling, and autoscaling. Cost depends on Google's feature set, although, on-premises, monitoring would be necessary for optimizing resource use.
Which other solutions did I evaluate?
For real-time processing, Apache Spark is a good start due to its strong open source community and contributions. However, for serverless processing, exploring other frameworks might be beneficial.
What other advice do I have?
I would suggest Apache Spark for streaming processing if they want to manage clusters on their own. For serverless options, exploring other use cases could be beneficial. Apache Spark is a good starting point, considering its strong open source community contributions.
We have not experienced downtime with Apache Spark Streaming, but we have had crashes. Sometimes the state memory keeps piling up, so we have to make tuning. We had crashes, but not very often. We were able to check specific load times and resolve those issues.
On a scale of 1-10, I rate Apache Spark Streaming an 8.
Which deployment model are you using for this solution?
Public Cloud
If public cloud, private cloud, or hybrid cloud, which cloud provider do you use?
Google