5.4 C
Tuesday, February 13, 2024

How Gupshup constructed their multi-tenant messaging analytics platform on Amazon Redshift

Gupshup is a number one conversational messaging platform, powering over 10 billion messages per thirty days. Throughout verticals, hundreds of enormous and small companies in rising markets use Gupshup to construct conversational experiences throughout advertising, gross sales, and assist. Gupshup’s carrier-grade platform supplies a single messaging API for 30+ channels, a wealthy conversational experience-building instrument package for any use case, and a community of rising market partnerships throughout messaging channels, system producers, ISVs, and operators.


Gupshup needed to construct a messaging analytics platform that supplied:

  • Construct a platform to get detailed insights, information, and stories about WhatsApp/SMS campaigns and monitor the success of each textual content message despatched by the top clients.
  • Simply achieve perception into traits, supply charges, and pace.
  • Save time and get rid of pointless processes.

About Redshift and a few related options for the use case

Amazon Redshift is a completely managed, petabyte-scale, massively parallel information warehouse that provides easy operations and excessive efficiency. It makes it quick, easy, and cost-effective to investigate all of your information utilizing commonplace SQL and your current enterprise intelligence (BI) instruments. Amazon Redshift extends past conventional information warehousing workloads, by integrating with the AWS cloud with options reminiscent of querying the information lake with Spectrum, semistructured information ingestion and querying with PartiQL, streaming ingestion from Amazon Kinesis and Amazon MSK, Redshift ML, federated queries to Amazon Aurora and Amazon RDS operational databases, and federated materialized views.

On this use case, Gupshup is closely counting on Amazon Redshift as their information warehouse to course of billions of streaming occasions each month, performing intricate data-pipeline-like operations on such information and incrementally sustaining a hierarchy of aggregations on prime of uncooked information. They’ve been having fun with the pliability and comfort that Amazon Redshift has dropped at their enterprise. By leveraging the Amazon Redshift materialized views, Gupshup has been in a position to dramatically enhance question efficiency on recurring and predictable workloads, reminiscent of dashboard queries from Enterprise Intelligence (BI) instruments. Moreover, extract, load, and rework (ELT) information processing is sped up and made simpler. To retailer generally used pre-computations and seamlessly make the most of them to cut back latency on ensuing analytical queries, Redshift materialized views function incremental refresh functionality which allows Gupshup to be extra agile whereas utilizing much less code. With out writing sophisticated code for incremental updates, they had been in a position to ship information latency of roughly quarter-hour for some use circumstances.

Total structure and implementation particulars with Redshift Materialized views

Gupshup makes use of a CDC mechanism to extract information from their supply methods and persist it in S3 to be able to meet these wants. A sequence of materialized view refreshes are used to calculate metrics, after which the incremental information from S3 is loaded into Redshift. This compiled information is then imported into Aurora PostgreSQL Serverless for operational reporting. The flexibility of Redshift to incrementally refresh materialized views, enabling it to course of large quantities of knowledge progressively, the capability for scaling, which makes use of concurrency and elastic resizing for vertical scaling, in addition to the RA3 structure, delivers the separation of storage and compute to scale one with out worrying concerning the different, led Gupshup to make this selection. Gupshup selected Aurora PostgreSQL because the operational reporting layer resulting from its anticipated enhance in concurrency and cost-effectiveness for queries that retrieve solely precalculated metrics.

Incremental analytics is the primary motive for Gupshup to make use of Redshift. The diagram reveals a simplified model of a typical information processing pipeline the place information comes by way of a number of streams. The streams have to be joined collectively, then enriched by becoming a member of with grasp information tables. That is adopted by sequence of joins and aggregations. All this must be carried out in incremental method, offering half-hour of latency.

Gupshup makes use of Redshift’s incremental materialized view function to perform this. All the be a part of, enrich, and aggregation statements are written utilizing sql statements. The stream-to-stream joins are carried out by ingesting each streams in a desk sorted by the important thing fields. Then an incremental MV aggregates information by the important thing fields. Redshift then mechanically takes care of protecting the MVs refreshed incrementally with incoming information. The incremental view upkeep function works even for hierarchical aggregations with MVs based mostly on different MVs. This permits Gupshup to construct a complete processing pipeline incrementally. It has really helped Gupshup scale back cycle time in the course of the POC and prototyping phases. Furthermore, no separate effort is required to course of historic information versus reside streaming information.

Other than incremental analytics, Redshift simplifies quite a lot of operational features. E.g., use the snapshot-restore function to rapidly create a inexperienced experimental cluster from an current blue serving cluster. In case the processing logic modifications (which occurs very often in prototyping phases), they should reprocess all historic information. Gupshup makes use of Redshift’s elastic scaling function to briefly scale the cluster up after which scale it down when accomplished. They additionally use Redshift to straight energy a few of their high-concurrency dashboards. For such circumstances, the concurrency scaling function of Redshift actually is useful. Other than this, they’ve quite a lot of in-house information analysts who must run advert hoc queries on reside manufacturing information. They use the workload administration options of Redshift to verify their analysts can run queries whereas guaranteeing that manufacturing queries don’t get affected.

Advantages realized with Amazon Redshift

  • On-Demand Scaling
  • Ease of use and upkeep with much less code
  • Efficiency advantages with an incremental MV refresh


Gupshup, an enterprise messaging firm, wanted a scalable information warehouse resolution to investigate billions of occasions generated every month. They selected Amazon Redshift to construct a cloud information warehouse that would deal with this scale of knowledge and allow quick analytics.

By combining Redshift’s scalability, snapshots, workload administration, and low-operational method, Gupshup supplies data-driven insights in lower than quarter-hour analytics refresh fee.

Total, Redshift’s scalability, efficiency, ease of administration, and value effectiveness have allowed Gupshup to achieve data-driven insights from billions of occasions in close to real-time. A scalable and strong information basis is enabling Gupshup to construct progressive messaging merchandise and a aggressive benefit.

The incremental refresh of materialized views function of Redshift allowed us to be extra agile with much less code:

  • For some use circumstances, we’re in a position to present information latency of about quarter-hour, with out having to put in writing complicated code for incremental updates.
  • The incremental refresh function is a major differentiating issue that provides Redshift an edge over a few of its opponents. I request that you simply maintain enhancing and enhancing it.

“The incremental refresh of materialized views function of Redshift allowed us to be extra agile with much less code”

Pankaj Bisen, Director of AI and Analytics at Gupshup.

In regards to the Authors

Shabi Abbas Sayed is a Senior Technical Account Supervisor at AWS. He’s keen about constructing scalable information warehouses and massive information options working carefully with the purchasers. He works with massive ISVs clients, in serving to them construct and function safe, resilient, scalable, and high-performance SaaS functions within the cloud.

Gaurav Singh is a Senior Options Architect at AWS, specializing in AI/ML and Generative AI. Primarily based in Pune, India, he focuses on serving to clients construct, deploy, and migrate ML manufacturing workloads to SageMaker at scale. In his spare time, Gaurav likes to discover nature, learn, and run.

Latest news
Related news


Please enter your comment!
Please enter your name here