cancel
Showing results forย 
Search instead forย 
Did you mean:ย 
Administration & Architecture
cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Are there any best practices on using Redis with structured streaming (for data enrichment) ?

Anonymous
Not applicable
 
2 REPLIES 2

sajith_appukutt
Honored Contributor II

What would be the volume of data in Redis ?

Option 1: Read redis data into a dataframe and do a stream/static join

Option 2: Inside foreachBatch

  • Get redis connection
    • fetch lookup data by keys
    • perform the enrichment
    • close connection

Joe_Suarez
New Contributor III

Redis offers various data structures such as strings, lists, sets, and hashes. Depending on your use case, select the appropriate data structure for storing the crm enrich data. For example, if you need to store key-value pairs, Redis hashes (HSET, HGET) can be a good choice. Define a consistent schema for the data stored in Redis. This helps in ensuring that the data retrieved from Redis aligns with the expected structure during enrichment. Consistency in data schema simplifies downstream processing. When retrieving data from Redis during structured streaming, avoid making individual requests for each record. Instead, consider using pipeline operations to send multiple commands in a batch. This can significantly reduce network round-trips and improve performance.

Welcome to Databricks Community: Lets learn, network and celebrate together

Join our fast-growing data practitioner and expert community of 80K+ members, ready to discover, help and collaborate together while making meaningful connections. 

Click here to register and join today! 

Engage in exciting technical discussions, join a group with your peers and meet our Featured Members.