Redis: A tool to combat the onslaught of spam calls and texts.
The chaotic influx of spam calls and SMS notifications

Redis: A tool to combat the onslaught of spam calls and texts.

Did you know that spam calls and SMS in India have reached alarming levels? Multiple sources confirm the scale of the issue.

According to a 2024 survey, 95% of Indians receive unwanted calls daily, with 77% receiving at least three or more such calls every day.?

(source: Business Today)

Here are some shocking statistics:

  1. About 2,700 robocalls are placed every second around the world, and consumers receive an average of 28 robocalls and texts each month.
  2. Americans collectively fend off over?3 billion spam calls?per month, 100+ millions per day in India.?
  3. In 2023, there were 415,172,654 spam texts per day, 2,906,208,576 per week, and 665,100,057 on weekends.?In April 2024, Americans received 19.2 billion spam texts, which is nearly 63 spam texts per person.
  4. 33% of America’s population?fell victim to scams?at least once, Americans lose around?$39.5 billion in 2022?and $29.8 billion in 2021.?
  5. 39% of victims said the scammer knew their home address before it was given.?
  6. Daily spam calls: According to a survey by LocalCircles, 64% of Indians receive 3 or more spam phone calls on average each day.
  7. Common sources: Financial services and real estate sectors are India's main sources of spam calls.
  8. DND registration: Despite the DoT's "Do Not Disturb" (DND) registry, many Indians continue to receive spam calls and messages.
  9. Impact: Spam calls and SMS messages can be a significant annoyance and security risk, as scammers often use them to trick people into revealing personal information or financial data.

The above numbers might vary from research to research, but let’s accept the fact that the problem is growing.? The rise of spam has spawned a profitable market for apps like Truecaller and Robokiller that filter out unwanted calls. Both tech companies and governments are actively working to address this consumer issue,

but regulatory measures like the Do Not Disturb (DND) list have proven largely ineffective, as 96% of users registered on the list still receive these calls.


Let's have a look on few examples of of SPAMs incidents:

  1. OTP requests for KYC.
  2. Click on the link to complete the KYC.
  3. Asking for money from another person's phone as the victim’s phone is damaged
  4. Asking for Bank details because you got selected for the lucky draw
  5. Click on the link to track your parcel
  6. Deep Fake (the percentage is less as of above, but it's rising): voice or video calls to request money.
  7. Robocalls - Automated calls that deliver a recorded message, often promoting products or services.
  8. Harassment: Repeated unwanted calls that can be annoying or threatening.


The SPAMs-blocking Tech companies are building the following solutions:

  1. Artificial intelligence (AI)-enabled spam detection
  2. Identify verified scammers and permanently blocking from their network?
  3. Real-time “Suspected Spam" alert when getting a call from such numbers
  4. Real-time “Suspected Spam" alert on SMSs with malicious links or fraudulent content
  5. Ability to mark SPAM and block contact numbers.

Redis Enterprise can help build scalable and efficient systems to block such spam using features like in-memory data structures, Redis Vector search, Redis Streams, pub/sub messaging, and high-performance rate limiting. Here’s a technical approach:

1. Real-time Spam Detection and Blocking (rule based)

By leveraging Redis’ low-latency performance and scalable data structures (hashes, sets, sorted sets), spam detection can happen in real-time, ensuring prompt response to known spam patterns. Here’s how Redis Enterprise can fit into the spam-blocking architecture:

  • Real-Time Blacklist and Whitelist Lookup: Redis Sets can store lists of known spam numbers and trusted contacts, which allows quick lookups during call initiation or SMS receipt. Combining this with Redis Bloom Filters provides a memory-efficient way of storing large datasets, reducing the likelihood of false negatives.

SADD spam_numbers <number> 
SISMEMBER spam_numbers <incoming_number>        

  • Redis Bloom Filters can also be leveraged to track large datasets with low memory overhead while accepting a small false positive rate for detecting spam.?

BF.ADD spam_filter <number> 
BF.EXISTS spam_filter <incoming_number>        

2. Rate Limiting

Redis Enterprise’s in-memory performance and support for atomic operations are ideal for rate-limiting incoming requests or spam attempts. Redis Lua scripts or Redis' native commands can be used to enforce rate limiting based on time intervals, preventing users or bots from overwhelming the system with spam attempts.

For instance, each number could have a rate limit on the number of messages sent per minute, using Redis INCR and EXPIRE commands:

INCRBY number_sms_sent:<number> 1 
EXPIRE number_sms_sent:<number> 60        

If the value exceeds a threshold, actions can be taken to block further messages from the sender. (Here is the detailed webinar for how to implement Rate limiting in Redis https://www.youtube.com/watch?v=YcmU24x4KyA&t=1603s)

3. Storing Spam Patterns as Vectors

Redis can store spam patterns, behaviors, and metadata related to calls or SMS as vector embeddings. By transforming message content or call data (such as phone numbers, call frequency, and content characteristics) into numerical vector representations, these vectors can be indexed and queried in real-time using Redis' vector database capabilities.

Using Redis Vector Similarity Search (Redis VSS), you can store and search high-dimensional vectors. For instance, embedding spam messages or phone numbers into a vector space using machine learning models allows Redis to perform approximate nearest neighbor (ANN) searches efficiently. This enables real-time matching of incoming calls or SMS to known spam vectors.

# Example of creating an index for spam call vectors 
FT.CREATE spam_idx ON HASH PREFIX 1 spam_vectors: SCHEMA embedding VECTOR FLAT 6        

4. Real-time Similarity Searches

When an incoming call or SMS is received, its data (e.g., content, frequency, or originating number) can be vectorized and compared against existing vectors in Redis. This allows the system to identify similar spam patterns based on proximity in vector space, making it effective even against evolving spam strategies that may not exactly match known patterns.

Redis' vector database can handle millions of vectors, and with its in-memory structure, spam detection can occur with minimal latency. Redis can perform K-Nearest Neighbors (KNN) searches to identify whether an incoming communication is close to known spam profiles.

FT.SEARCH spam_idx '@embedding:[VECTOR_DISTANCE ... ]'        

5. Integration with Machine Learning Models

Redis Enterprise can integrate with machine learning models trained to detect spam. For example, you can use a machine learning pipeline to classify incoming calls and messages, vectorize the outputs, and store them in Redis for future comparisons. By feeding Redis with these vector embeddings from models such as BERT or TF-IDF, spam detection becomes more adaptive to changing patterns.

Redis can act as a high-performance real-time serving layer, where vectors from a machine learning model are searched for matching patterns before calls or messages are allowed through.

6. Scalable Architecture for High Volumes

Redis Enterprise supports horizontal scaling and Active-Active architecture, making it ideal for large-scale, distributed systems handling millions of calls and messages. The Active-Active architecture ensures that even if the spam detection infrastructure is deployed across multiple data centers, it will still operate seamlessly, handling high volumes of incoming communications with low latency.

Conclusion

By using Redis' vector search capabilities, high-dimensional data management, and integration with machine learning models, service providers can build scalable, real-time systems for blocking spam calls and SMS. Redis Enterprise provides the speed, scalability, and robustness needed for such a system to perform efficiently at scale.

For further exploration, you can look into Redis' vector database support and real-time search features in more detail through Redis documentation.

Note: Opinions expressed are solely my own and do not express the views or opinions of my employer.

Vinayak Bhosale

Principal Architect at Icertis

5 个月

Unless we find a way to do this on device, don’t have a lot of hopes form telcos or trai getting this out anytime soon. But do share you views on making this a use case for ondevice AI, Suyog Kale

要查看或添加评论,请登录

Suyog Kale的更多文章

社区洞察

其他会员也浏览了