Can Spark be used for real-time interactive application?

Viewed 142

We have a system that contains a data pipeline that computes reports, as well as an UI layer that can take ad-hoc queries, with some specific computation applied to our data set after query. I am thinking about migrating the existing batch data processing layer to Spark, but I am not so sure about the UI application layer.

The tricky part is that the request from UI also requires certain functions to be applied to the data set. I haven't found any query engine, such as Elasticsearch, that can apply custom function from query results. So I am wondering if it's a good idea to have UI layer trigger Spark directly, assuming the source data is already cached in Spark session.

So my questions are:

  • Is Spark the right solution for real-time interactive applications? What are the alternatives?
  • I would like to have the UI application runs outside of Spark cluster. So is there any framework that I can use for external service to trigger Spark job? Or leverage some existing Spark session?

Any advice would be greatly appreciated.

1 Answers

Though this is opinion based question I would like to answer based on my observation.

Is Spark the right solution for real-time interactive applications? What are the alternatives?

it will be a bad idea to query directly from spark in-memory tables.. you may face issue like queuing of request in case of multiple concurrent users.. spark going down and UI is unavailable.. spark in-memory tables evicted from memory based on LRU etc...

Store data is persistent store that suits your need.. ES,hive,Cassandra,RDBMS, etc.. check PrestoSQL if SQL is needed on top of data store.

I would like to have the UI application runs outside of Spark cluster. So is there any framework that I can use for external service to trigger Spark job? Or leverage some existing Spark session?

we had external UI connecting to existing spark cluster using spark-job-server. you can explore the same or might be apache livy.

Related