Archives March 2024

Enrich your streaming data using Bigtable and Dataflow

Enrich your streaming data using Bigtable and Dataflow

Revised version for your consideration

Data engineers know that eventing is all about speed, scale, and efficiency. Event streams — high-volume data feeds coming off of things such as devices such as point-of-sale systems or websites logging stateless clickstream activity — process lightweight event payloads that often lack the information to make each event actionable on its own. It is up to the consumers of the event stream to transform and enrich the events, followed by further processing as required for their particular use case.

Key-value stores such as Bigtable are the preferred choice for such workloads, with their ability to process hundreds of thousands of events per second at very low latencies. However, key value lookups often require a lot of careful productionisation and scaling code to ensure the processing can happen with low latency and good operational performance. 

With the new Apache Beam Enrichment transform, this process is now just a few lines of code, allowing you to process events that are in messaging systems like Pub/Sub or Apache Kafka, and enrich them with data in Bigtable, before being sent along for further processing.

This is critical for streaming applications, as streaming joins enrich the data to give meaning to the streaming event. For example, knowing the contents of a user’s shopping cart, or whether they browsed similar items before, can bring valuable context to clickstream data that feeds into a recommendation model. Identifying a fraudulent in-store credit card transaction requires much more information than what’s in the current transaction, for example, the location of the prior purchase, count of recent transactions or whether a travel notice is in place. Similarly, enriching telemetry data from factory floor hardware with historical signals from the same device or overall fleet statistics can help a machine learning (ML) model predict failures before they happen.

The Apache Beam enrichment transform can take care of the client-side throttling to rate-limit the number of requests being sent to the Bigtable instance when necessary. It retries the requests with a configurable retry strategy, which by default is exponential backoff. If coupled with auto-scaling, this allows Bigtable and Dataflow to scale up and down in tandem and automatically reach an equilibrium. Beam supports exponential backoff, which can be disabled or replaced with a custom implementation.

Lets see this in action:

<ListValue: [StructValue([(‘code’, ‘with beam.Pipeline() as p:rn output = (prn | “Read from PubSub” >> | “Convert bytes to Row” >> beam.ParDo(DecodeBytes())rn | “Enrichment” >> Enrichment(bigtable_handler)rn | “Run Inference” >> RunInference(model_handler)rn )’), (‘language’, ”), (‘caption’, <wagtail.rich_text.RichText object at 0x3e72b60d01c0>)])]>

The above code runs a Dataflow job that reads from a Pub/Sub subscription and performs data enrichment by doing a key-value lookup with Bigtable cluster. The enriched data is then fed to the machine learning model for RunInference. 

The pictures below illustrate how Dataflow and Bigtable work in harmony to scale correctly based on the load. When the job starts, the Dataflow runner starts with one worker while the Bigtable cluster has three nodes and autoscaling enabled for Dataflow and Bigtable. We observe a spike in the input load for Dataflow at around 5:21 PM that leads it to scale to 40 workers.

This increases the number of reads to the Bigtable cluster. Bigtable automatically responds to the increased read traffic by scaling to 10 nodes to maintain the user-defined CPU utilization target.

The events can then be used for inference, with either embedded models in the Dataflow worker or with Vertex AI

This Apache Beam transform can also be useful for applications that serve mixed batch and real-time workloads from the same Bigtable database, for example multi-tenant SaaS products and interdepartmental line of business applications. These workloads often take advantage of built-in Bigtable mechanisms to minimize the impact of different workloads on one another. Latency-sensitive requests can be run at high priority on a cluster that is simultaneously serving large batch requests with low priority and throttling requests, while also automatically scaling the cluster up or down depending on demand. These capabilities come in handy when using Dataflow with Bigtable, whether it’s to bulk-ingest large amounts of data over many hours, or process streams in real-time.


With a few lines of code, we are able to build a production pipeline that translates to many thousands of lines of production code under the covers, allowing Pub/Sub, Dataflow, and Bigtable to seamlessly scale the system to meet your business needs! And as machine learning models evolve over time, it will be even more advantageous to use a NoSQL database like Bigtable which offers a flexible schema. With the upcoming Beam 2.55.0, the enrichment transform will also have caching support for Redis that you can configure for your specific cache. To get started, visit the documentation page.

Source : Data Analytics Read More

Combine data across BigQuery and Salesforce Data Cloud securely with zero ETL

Combine data across BigQuery and Salesforce Data Cloud securely with zero ETL

We are excited that bidirectional data sharing between BigQuery and Salesforce Data Cloud is now generally available. This will make it easy for customers to enrich their data use cases by combining data across different platforms securely, without the additional cost of building or managing data infrastructure and complex ETL (Extract, Transform, Load) pipelines.

Responding to customer needs quickly is more critical than ever, with a growing number of touchpoints and devices to deliver in-the-moment customer experiences. But it’s becoming increasingly challenging to do so, as the amount of data created and captured continues to grow, and is spread across multiple SaaS applications and analytics platforms. 

Last year, Google Cloud and Salesforce announced a partnership that makes it easy for customers to combine their data across BigQuery and Salesforce Data Cloud, and leverage the power of BigQuery and Vertex AI solutions to enrich and unlock new analytics and AI/ML scenarios. 

Today, we are launching general availability of these capabilities, enabling joint Google Cloud and Salesforce customers to securely access their data in the different platforms and different clouds. Customers will be able to access their Salesforce Data Cloud in BigQuery, without having to set up or manage infrastructure, as well as use their Google Cloud data to enrich Salesforce Customer 360 and other applications. 

With this announcements, Google Cloud and Salesforce customers benefit from: 

A single pane of glass and serverless data access across platforms with zero ETL

Governed and secure bi-directional access to their Salesforce Data Cloud data and BigQuery in near real time without needing to create data infrastructure and data pipelines.

Use their Google Cloud data to enrich Salesforce Customer 360 and Salesforce Data Cloud. Also, the ability to enrich customer data with other relevant datasets, public datasets with minimal data movement.

Leveraging differentiated Vertex AI and Cloud AI services for predictive analytics, churn modeling and flowing back to customer campaigns through Vertex AI and Einstein Copilot Studio’s integration.

Customers who want to look at their data holistically across Salesforce and Google platforms, spanning cloud boundaries, can do so by leveraging BigQuery Omni and Analytics Hub. This integration allows data and business users including data analysts, marketing analysts, and data scientists, to combine data across Salesforce and Google platforms to analyze, derive insights and run AI/ML pipelines, all in a self-service capacity, without the need to involve data engineering or infrastructure teams.

This integration is fully managed and governed, allowing customers to focus on analytics and insights and avoid several critical business challenges that are typical when integrating critical enterprise systems. These innovations enforce data access and governance policy set for the data by admins. Only datasets that are explicitly shared are available for access and only authorized users are able to share and explore the data. With data spanning multiple clouds and platforms, relevant data is pre-filtered with minimal copying from Salesforce Data Cloud to BigQuery, reducing both egress costs and data engineering overhead.

“Trying to get a handle on our customer data was a nightmare until we seamlessly connected Google Cloud and Salesforce Data Cloud. No more copying data between platforms, no more struggling with complex APIs. It’s revolutionized how we do segmentation, understand our customers, and drive better marketing and service actions.” Large insurance company in NorthAM

“We faced several challenges in making the most of our customer data. Enriching leads between our first-party BigQuery data and Salesforce was a slow, manual process. It also made creating timely, data-driven lifecycle marketing journeys difficult due to batch data transfers. By seamlessly integrating BigQuery and Salesforce, we’ve transformed these processes. The integration fuels our automated marketing campaigns with real-time data triggers, significantly enhancing customer engagement. Best of all, this solution eliminated the manual overhead of batch data transfers, saving us valuable time and resources. It’s a win-win for our marketing team and our bottom line.”Large retailer in NorthAM

Easy and secure access to Salesforce Data Cloud from Google Cloud

Customers want to access and combine their marketing, commerce and service data in Salesforce Data Cloud with loyalty and point-of-sale data in Google analytics platforms to derive actionable insights about their customer behavior such as propensity to buy, cross-sell/up-sell recommendations and run highly personalized promotional campaigns. They also want to leverage differentiated Google AI services to build machine learning models on top of combined Salesforce and Google Cloud data for training/predictions, enabling use cases such as churn modeling, customer funnel analysis, market-mix modeling, price elasticity, and A/B test experimentation.

With the launch, customers can get access to their Salesforce Data Cloud data seamlessly through differentiated BigQuery cross-cloud and data sharing capabilities. They can access all the relevant information needed to perform cross-platform analytics in a privacy safe manner with other Google assets, and power ad campaigns. Salesforce Data Cloud Admins can easily share data, directly with the relevant BigQuery users or groups. BigQuery users can easily subscribe to shared datasets through the Analytics Hub UI.

There are several different ways to share information with this platform integration: 

For smaller datasets and ad hoc access, for example to find the store that had the largest sales last year, you can leverage a single cross-cloud join of your Salesforce Data Cloud and Google Cloud datasets, with minimal movement or duplication of data.

For larger data sets that are powering your executive update, weekly business review or marketing campaign dashboards, you can access the data using cross-cloud materialized views that are automatically and incrementally updated and only bring the incremental data periodically.

Enrich Salesforce Customer 360 with data stored on Google Cloud

We also hear from customers — especially retailers — that they want to access and combine their data in Salesforce Data Cloud and behavioral data captured in Google Analytics from their websites and mobile apps to build a richer customer 360 profile, derive actionable insights, deliver personalized messaging with rich capabilities of Salesforce Data Cloud. We are making it easier than ever to break down data silos and give customers seamless real-time access to Google Analytics data within Salesforce Data Cloud and build richer customer profiles, and personalized experiences.

Salesforce Data Cloud customers can use simple point-and-click to connect to their Google Cloud account, select relevant BigQuery datasets and make them available as External Data Lake Objects, providing live access to data. Once they are Data Lake Objects, they behave like native Data Cloud objects to enrich customer 360 data models, derive insights to power real-time Customer 360 models for analytics and personalization. This integration eliminates the need to build and monitor ETL pipelines for data integration, eliminating operational overhead and latencies of the traditional ETL copy approach.

Breaking down walls between Salesforce and Google data

This Google Cloud and Salesforce Data Cloud platform integration empowers organizations to break down data silos, gain actionable insights, and deliver exceptional customer experiences. With seamless data sharing, unified access, and the power of Google AI, this partnership is transforming the way businesses leverage their data for success.

Through unique cross-cloud functionality of BigQuery Omni and data sharing capabilities of Analytics Hub, customers can directly access data stored in Salesforce Data Cloud and combine it with data in Google Cloud to enrich it further for business insights and activation. Customers are not only able to view their data across clouds but perform unparalleled cross-cloud analytics without the need to build custom ETL or move data. 

To learn more about the collaboration between Google and Salesforce, check out this partnership page, the introduction video and quick start guide.

Source : Data Analytics Read More

At least once Streaming: Save up to 70% for Streaming ETL workloads

At least once Streaming: Save up to 70% for Streaming ETL workloads

Historically, Dataflow Streaming Engine has offered exactly-once processing for streaming jobs. Recently, we launched at-least-once streaming mode as an alternative for lower latency and cost-of-streaming data ingestion. In this post, we will explain both streaming modes and provide guidance on how to choose the right mode for your streaming use case.

Exactly-once: what it is and why it matters

Applications that react to incoming events sometimes require that each event be reflected in the output exactly once — meaning the event is not lost, nor accepted more than a single time. But as the processing pipeline scales, load-balances, or encounters faults, that deduplication of events imposes a computational cost, affecting overall cost and latency of the system.

Dataflow Streaming provides an exactly-once guarantee, meaning that the effects of data processed in the pipeline are reflected at least and at most once. Let’s unpack that a little bit. For every arriving message, whether it’s from an external source or an upstream shuffle, Dataflow ensures that the message will be processed and not lost (at-least-once). Additionally, results of that processing that remain within the pipeline, like state updates and outputs to a subsequent shuffle to the next pipeline stage, are also reflected at-most once. This guarantee enables, among other things, performing exact aggregations, such as exact sums or counts.

Exactly-once inside the pipeline is usually only half the story. As pipeline authors and runners, we really want to get the results of processing out of Dataflow and into a downstream system. Here we run into a common roadblock: no general at-most-once guarantee is made about side-effects of the pipeline. Without further effort, any side-effect, such as output to an external store, may generate duplicates. Careful work must be done to orchestrate the writes in a way that avoids duplicates. The key challenge is that in the general case, it is not possible to implement exactly-once operation in a distributed system without a consensus protocol that involves all the actors. For internal state changes, such as state updates and shuffle, exactly-once is achieved by a careful protocol.With sufficient support from data sinks, we can thus have exactly-once all the way through the pipeline and to its output. An example is the storage write version of the BigQueryIO.Write implementation, which ensures exactly-once data extraction to BigQuery. 

But even without exactly-once semantics at the sink, exactly-once semantics within the pipeline can be useful. Duplicates on the output may be acceptable, as long as they are duplicates of correct results — with exactly-once having been required to achieve this correctness.

At-least once: what it is and why it matters

There are other use cases where duplicates may be acceptable, for example ETL or Map-Only pipelines that are not performing any aggregation but rather only per-message operations. In these cases, duplicates are simple replays of data through the pipeline.

But why wouldn’t you choose to use exactly-once semantics? Aren’t stronger guarantees always better? The reason is that achieving exactly-once adds to pipeline latency and cost. This happens for several reasons, some obvious, and some quite subtle. Let’s take a deeper look.

In order to achieve exactly-once, we must store and read exactly-once metadata. In practice, the storage and read costs incurred to do this turn out to be quite expensive, especially in pipelines that otherwise perform very little I/O. Less intuitively, having to perform this metadata-based deduplication dictates how we implement the backend.

For example, in order to deduplicate messages across the shuffle we must ensure that all replays are idempotent — which means we must checkpoint the results of processing before they are sent to shuffle — which again increases cost and latency. 

Another example: to de-duplicate the input from Pub/Sub, we must first re-shuffle incoming messages on keys that are deterministically derived from a given message because the deduplication metadata is stored in the per-key state. Performing this shuffle using deterministic keys exposes us to additional cost and latency. In the next section we lay out the reasons for this in more detail.

We cannot assume that at-least-once semantics are acceptable for the user, so we default to the strictest, semantics, i.e., exactly-once. If we know beforehand that at-least-once processing is acceptable, and we can relax our constraints, then we can make more cost- and latency-beneficial implementation decisions. 

Exactly-once vs. at-least-once when reading from Pub/Sub

Pub/Sub reads’ latency and cost in particular benefit from at-least-once mode. To understand why, let’s look closer at how exactly-once deduplication is implemented. 

Pub/Sub reads are implemented in the Dataflow backend workers. To acquire new messages, each Dataflow backend worker makes remote procedure calls (RPCs) internally to the Pub/Sub service. Since RPCs can fail, workers may crash, or other sources of failure are possible, and messages will be replayed until successful processing is acknowledged by the backend worker. Pub/Sub and backend workers are dynamic systems, without static partitioning, meaning that replays of messages from Pub/Sub are not guaranteed to arrive at the same backend worker. This poses a challenge when deduplicating these messages. 

In order to perform deduplication, the backend worker puts these messages through a shuffle, attaching a key internally to each message. The key is chosen deterministically based on the message, or a message id attribute if configured1, so that a replay of a duplicate message is deterministically shuffled to the same key. Doing so allows deduplicating replays from Pub/Sub in the same manner that shuffle replays are deduplicated between stages in the Dataflow pipeline (see this detailed discussion), as illustrated in the sequence diagram below:

This design contributes to cost and latency in two significant ways. First, as with all deduplication in the Dataflow backend, a read against the persistent store may be required. While heavily optimized with caches and bloom filters, it cannot be completely eliminated. Second, and often even more significant, is the need to shuffle the data on a deterministic key. If a particular key or worker is slow or becomes a bottleneck, this creates head-of-line blocking that prevents other traffic from flowing — an artificial constraint since the messages in the queue are not semantically tied to this key. 

When at-least-once processing is acceptable, we can both eliminate the cost associated with reads from the persistent store and the shuffling of messages on a deterministic key. In fact, we can do better — we still shuffle the messages, but the key we pick instead is the current “least-loaded” key, meaning the key that is currently experiencing the least queueing. In this way, we evenly distribute the incoming traffic to maximize throughput, even when some keys or workers are experiencing slowness. 

We can see this in action in a benchmark where we simulate stragglers, e.g., slow writes to an external sink, by artificially delaying arbitrary messages at low probability for multi-minute intervals.

Compare the throughput of the exactly-once pipeline on the left to the throughput of the at-least-once pipeline on the right. The at-least-once pipeline can sustain much more consistent throughput in the presence of such stragglers, dramatically decreasing average latency. In other words, even though both cases still have high tail latency, the latency outliers no longer affect the bulk of the distribution in the at-least-once configuration.

Benchmarks: at-least-once vs. exactly-once

Here are three representative benchmark streaming jobs to evaluate the impact of streaming-mode choice on costs. To maximize the cost benefit, we enabled resource-based billing and aligned I/O to the streaming mode. Here is what we observed:

Note that cost depends on multiple factors such as data-load characteristics, the specific pipeline composition, configuration and the I/O used. Therefore, our benchmarking results may differ from what you observe in your test and production pipelines.

Spotify’s own testing supported the Dataflow team’s findings:

“By incorporating at-least-once mode in our platform that is built on Dataflow, Pub/Sub, and Bigtable, we have seen a portion of our Dataflow jobs cut costs by 50%. Since this is used by several consumers, 7 downstream systems are now cheaper overall with this simple change. Because of the way this system works, there has been 0 effects of duplicates! We plan on turning this feature on in more jobs that are compatible to cut down our Dataflow costs even more.” Sahith Nallapareddy, Software Engineer, Spotify

Choose the right streaming mode for your job

When creating streaming pipelines, choosing the right mode is essential. The critical factor is to determine whether the pipeline can tolerate duplicate records in the output or any intermediate processing stages.

At-least-once mode can help optimize cost and performance in the following cases:

Map-only pipelines performing idempotent per-message operations, e.g. ETL jobs

When deduplication happens in  the destination, e.g., in BigQuery or Bigtable

Pipelines that already use an at-least-once I/O sink, e.g., Storage API At Least Once or PubSub I/O

Exactly-once mode is preferable in the following cases:

Use cases that cannot tolerate duplicates within Dataflow

Pipelines that perform exact aggregations as part of stream processing

Map-only jobs that perform non-idempotent per-message operations

At-least-once streaming mode is now generally available for Dataflow streaming customers. You can enable at-least-once mode by setting the at-least-once Dataflow service option when starting a new streaming job using the API or gcloud. To get started, we also offer a selection of commonly used Dataflow streaming templates that support the streaming modes.

Source : Data Analytics Read More

Introducing new BigQuery features to simplify time-series data analysis

Introducing new BigQuery features to simplify time-series data analysis

We are excited to invite customers to join a preview of new SQL features that simplify time series analysis in BigQuery. These new features simplify writing queries that perform two of the most common time series operations: windowing and gap filling. We are also introducing the RANGE data type and supporting functions. The RANGE type represents a continuous window of time and is useful for recording time-based state of a value. Combined, these features make it easier to write time series queries over your data in BigQuery.

Time-series analytics and data warehouses

Time-series data is an important, and growing class of data for many enterprises. Operational data like debug logs, metrics, and event logs are inherently time-oriented and full of valuable information. Additionally, connected devices common in manufacturing, scientific research, and other domains continually produce important metrics that need to be analyzed. All of this data follows the same pattern: the data is reported as values at a specific time, and deriving meaning from that data requires understanding how it changes over time.

Users with time-series analytics problems have traditionally relied on domain-specific solutions that result in harder to access data silos. Additionally, they often have their own query languages, which require additional expertise to use. Organizations looking to analyze their time-series data alongside the rest of their data must invest in pipelines that first clean and normalize the data in one store before exporting it to their data warehouse. This slows down time-to-insights and potentially hides data from the users who could build value from the data. Adding more time-series analytics features to BigQuery SQL democratizes access to this valuable data. Organizations can now leverage BigQuery’s scalable serverless architecture to store and analyze their time-series data alongside the rest of their business data without having to build and maintain expensive pipelines first.

Introducing time-series windowing and gap filling functions

The first step in most time-series queries is to map individual data points to output windows of a specific time duration and alignment. For example, you want to know the average of a sampled value every ten minutes over the past twelve hours. The underlying data is often sampled at arbitrary times so the user’s query must include logic to map the input times to the output time windows. BigQuery’s new time bucketing functions provide a full-featured method for performing this mapping.

Let’s look at an example using a time series data set showing the air quality index (AQI) and temperature recorded over part of the day. Each row in the table represents a single sample of time-series data. In this case, we have a single time series for the zip code 60606, but the table can easily hold data for multiple time series, all represented by their zip code.

<ListValue: [StructValue([(‘code’, “CREATE OR REPLACE TABLE mydataset.environmental_data_hourly ASrnSELECT * FROM UNNEST(rn ARRAY<STRUCT<zip_code INT64, time TIMESTAMP, aqi INT64, temperature INT64>>[rn STRUCT(60606, TIMESTAMP ‘2020-09-08 00:30:51’, 22, 66),rn STRUCT(60606, TIMESTAMP ‘2020-09-08 01:32:10’, 23, 63),rn STRUCT(60606, TIMESTAMP ‘2020-09-08 02:30:35’, 22, 60),rn STRUCT(60606, TIMESTAMP ‘2020-09-08 03:29:39’, 21, 58),rn STRUCT(60606, TIMESTAMP ‘2020-09-08 06:31:14’, 22, 56),rn STRUCT(60606, TIMESTAMP ‘2020-09-08 07:31:06’, 28, 55)rn]);”), (‘language’, ”), (‘caption’, <wagtail.rich_text.RichText object at 0x3e2b0ac92e50>)])]>

Before doing additional processing we’d like to assign each row to a specific time bucket that is two-hours wide. We’ll also aggregate within those windows to compute the average AQI and maximum temperature.

<ListValue: [StructValue([(‘code’, ‘SELECTrn TIMESTAMP_BUCKET(time, INTERVAL 2 HOUR) AS time,rn zip_code,rn CAST(AVG(aqi) AS INT64) AS aqi,rn MAX(temperature) AS max_temperaturernFROM mydataset.environmental_data_hourlyrnGROUP BY zip_code, timernORDER BY zip_code, time;rnrn+———————+———-+—–+—————–+rn| time | zip_code | aqi | max_temperature |rn+———————+———-+—–+—————–+rn| 2020-09-08 00:00:00 | 60606 | 23 | 66 |rn| 2020-09-08 02:00:00 | 60606 | 22 | 60 |rn| 2020-09-08 06:00:00 | 60606 | 25 | 56 |rn+———————+———-+—–+—————–+’), (‘language’, ”), (‘caption’, <wagtail.rich_text.RichText object at 0x3e2b0ac92460>)])]>

Note that we can use any valid INTERVAL to define the width of the output window. We can also define an arbitrary origin for aligning the windows if we want to start the windows at something other than 00:00:00.

Gap filling is another common step in time-series analysis that addresses gaps in time of the underlying data. A server producing metrics may reset, stopping the flow of data in the progress. A lack of user traffic may mean gaps in event data. Or, data may be inherently sparse. Users want to control how these gaps are filled in before joining with other data or preparing it for graphing. The newly released GAP_FILL table valued function does just that.

In our previous example, we have a gap between 02:00 and 06:00 in the output data because there is no raw data between 04:00:00 and 05:59:59. We would like to fill in that gap before joining this data with other time-series data. Below, we demonstrate two modes of backfill supported by the GAP_FILL TVF: “last observation carried forward” (locf) and linear interpolation. The TVF also supports inserting nulls.

<ListValue: [StructValue([(‘code’, “WITH aggregated_2_hr AS (rn SELECTrn TIMESTAMP_BUCKET(time, INTERVAL 2 HOUR) AS time,rn zip_code,rn CAST(AVG(aqi) AS INT64) AS aqi,rn MAX(temperature) AS max_temperaturern FROM mydataset.environmental_data_hourlyrn GROUP BY zip_code, timern ORDER BY zip_code, time)rnrnSELECT *rnFROM GAP_FILL(rn TABLE aggregated_2_hr,rn ts_column => ‘time’,rn bucket_width => INTERVAL 2 HOUR,rn partitioning_columns => [‘zip_code’],rn value_columns => [rn (‘aqi’, ‘locf’),rn (‘max_temperature’, ‘linear’)rn ]rn)rnORDER BY zip_code, time;rnrnrn+———————+———-+—–+—————–+rn| time | zip_code | aqi | max_temperature |rn+———————+———-+—–+—————–+rn| 2020-09-08 00:00:00 | 60606 | 23 | 66 |rn| 2020-09-08 02:00:00 | 60606 | 22 | 60 |rn| 2020-09-08 04:00:00 | 60606 | 22 | 58 |rn| 2020-09-08 06:00:00 | 60606 | 25 | 56 |rn+———————+———-+—–+—————–+”), (‘language’, ”), (‘caption’, <wagtail.rich_text.RichText object at 0x3e2b0ac92d60>)])]>

GAP_FILL can also be used to produce aligned output data without having to bucket the input data first.

Combined, these new bucketing and gap-filling operations provide key building blocks of time-series analytics. Users can now leverage BigQuery’s serverless architecture, high-throughput streaming ingestion, massive parallelism, and built-in AI to derive valuable insights from their time-series data alongside the rest of their business data, all without relying on a separate data silo.

Importantly, these new functions align with the standard SQL syntax and semantics analytics that experts are familiar with. There is no need to learn a new language or a new computation model. Simply add these functions into your existing workflows and start delivering insights.

Introducing the RANGE data type

The RANGE type and functions make it easier to work with contiguous windows of data. For example, RANGE<DATE> “[2024-01-01, 2024-02-01)” represents all DATE values starting from 2024-01-01 up to and excluding 2024-02-01. RANGE can also be unbounded on either end, representing the beginning and end of time respectively. RANGE is useful for representing a state that is true, or valid, over a contiguous period of time. Quota assigned to a user, the exchange rate of a currency over different times, the value of a system setting, or the version number of an algorithm are all great examples.

We are also introducing features that allow you to combine or expand RANGEs at query time. RANGE_SESSIONIZE is a TVF that allows you to combine overlapping or adjacent RANGEs into a single row. The table below shows how users can use this feature to create a smaller table with the same information:

<ListValue: [StructValue([(‘code’, ‘CREATE OR REPLACE TABLE mydataset.sensor_metrics ASrnSELECT * FROM UNNEST(rn ARRAY<STRUCT<sensor_id INT64, duration RANGE<DATETIME>, flow INT64, spins INT64>>[rn (1, RANGE<DATETIME> “[2020-01-01 12:00:01, 2020-01-01 12:05:23)”, 10, 1),rn (1, RANGE<DATETIME> “[2020-01-01 12:05:12, 2020-01-01 12:10:46)”, 10, 20), rn (1, RANGE<DATETIME> “[2020-01-01 12:10:27, 2020-01-01 12:15:56)”, 11, 4),rn (2, RANGE<DATETIME> “[2020-01-01 12:05:08, 2020-01-01 12:10:30)”, 21, 2),rn (2, RANGE<DATETIME> “[2020-01-01 12:10:22, 2020-01-01 12:15:42)”, 21, 10)rn]);’), (‘language’, ”), (‘caption’, <wagtail.rich_text.RichText object at 0x3e2b0ac92eb0>)])]>

RANGE_SESSIONIZE finds all overlapping ranges and outputs the session range, which is a union of all the ranges that overlap within the (sensor_id, flow) partition. We finally group by the session ranges to output a table that combines the overlapping ranges:

<ListValue: [StructValue([(‘code’, ‘SELECT sensor_id, session_range, flowrnFROM RANGE_SESSIONIZE(rn (SELECT sensor_id, duration, flow FROM mydataset.sensor_metrics),rn “duration”,rn [“sensor_id”, “flow”],rn “OVERLAPS”)rnORDER BY sensor_id, session_range;rnrn+———–+——————————————–+——+rn| sensor_id | session_range | flow | rn+———–+——————————————–+——+rn| 1 | [2020-01-01 12:00:01, 2020-01-01 12:10:46) | 10 |rn| 1 | [2020-01-01 12:00:01, 2020-01-01 12:10:46) | 10 |rn| 1 | [2020-01-01 12:10:27, 2020-01-01 12:15:56) | 11 |rn| 2 | [2020-01-01 12:05:08, 2020-01-01 12:15:42) | 21 |rn| 2 | [2020-01-01 12:05:08, 2020-01-01 12:15:42) | 21 |rn+———–+——————————————–+——+rnrnSELECT sensor_id, session_range, flow, SUM(spins)rnFROM RANGE_SESSIONIZE(rn TABLE mydataset.sensor_metrics, rn “duration”,rn [“sensor_id”, “flow”],rn “OVERLAPS”)rnGROUP BY sensor_id, session_range, flowrnORDER BY sensor_id, session_rangernrn+———–+——————————————–+——+——-+rn| sensor_id | session_range | flow | spins |rn+———–+——————————————–+——+——-+rn| 1 | [2020-01-01 12:00:01, 2020-01-01 12:10:46) | 10 | 21 |rn| 1 | [2020-01-01 12:10:27, 2020-01-01 12:15:56) | 11 | 4 |rn| 2 | [2020-01-01 12:05:08, 2020-01-01 12:15:42) | 21 | 12 |rn+———–+——————————————–+——+——-+’), (‘language’, ”), (‘caption’, <wagtail.rich_text.RichText object at 0x3e2b0ac92130>)])]>

You can do much more with RANGE. For example, you can use RANGE to JOIN a timestamp table with a RANGE table or emulate the behavior of an AS OF JOIN. See more examples in the RANGE and time series documentation.

Getting started

To use the new time series analysis features, all you need is a regular table with some time series data in it. You can even try experimenting with one of the existing public datasets. Check out the documentation to learn more and get started. Give these new features a try and let us know if you have feedback.

Source : Data Analytics Read More

Built with BigQuery: How Pendo Data Sync maximizes ROI on your data

Built with BigQuery: How Pendo Data Sync maximizes ROI on your data

Editor’s note: The post is part of a series showcasing partner solutions that are Built with BigQuery.

Data is paramount when making critical business decisions. Whether it’s identifying new opportunities, streamlining operations, or delivering more value to customers, leadership wants to know that they have the facts on their side when making crucial choices about the future. That means having and evaluating the right data – the data that comes from their products.

Pendo provides companies with the most effective way to infuse product data into their greater business strategy. As a company on a mission to elevate the world’s experience with software, Pendo has created Data Sync, a product that makes it easier to connect valuable behavioral insights from applications to the broader business. With Data Sync, teams have visibility into data about customer engagement and health, regardless of where it sits in an organization.

Siloed product data is wasted product data

Without the ability to incorporate product-level behavioral insights into business reporting, companies can’t understand the holistic journey of their users. Given the current macroeconomic conditions, businesses are under extra pressure to retain and grow their existing customer base, and not understanding user behavior in its full context is a clear disadvantage. 

Too often an incomplete picture of product usage is the result of compiling data together piece by piece or via an API pull, which doesn’t provide the value businesses need. This approach can distract and pull resources away from building a scalable, supported data strategy model. Without a single source of truth into product data, each team is left making crucial business decisions with only part of the picture. This results in siloed data and wasted insights that could help answer crucial questions, such as:

Are users deriving value from key product areas that align with commercial models? 

Are customer cohorts as engaged and healthy as their point of renewal approaches?

When looking to maximize the lifetime value of customer accounts, what behavior trends can inform sales strategy? 

Do customer teams have the insights they need to proactively address risk and churn?

Rich insights to answer crucial questions

There’s an alternative to this fragmented approach. With Pendo Data Sync for Google Cloud, teams can quickly make Pendo data available whenever they need it in Cloud Storage and access it in BigQuery, or any other data lake or warehouse. By connecting behavioral data from product applications (i.e., user interactions with them) with other key business data sources, Pendo enables organizations to make important decisions with confidence. 

Pendo makes it easy to:

Easily access all historical behavioral and product utilization data. Structure and take action on the valuable data across your entire data ecosystem. In Google Cloud, data teams can maximize the value of BigQuery and Looker by integrating these additional datasets to help generate business insights that were previously unavailable.

Democratize data to drive informed decision making. Instantly join product data with the full breadth of all your key business data at the depth required to support a modern data-driven organization.

Drive better resource utilization. Remove the need to manually pull siloed data sets and give your data and engineering teams back time to spend on more valuable activities.

Get maximum ROI on your product insights. Enable every department — all the way up to the C-suite — to speak the same universal language of the business.

Make faster, more confident decisions. Put product data at the center of your decision-making processes.

Democratizing data to buttress the business

Pendo data acts as our customers’ primary source of truth for the applications they build, sell, and deploy. With Data Sync, these insights are no longer confined to the product teams using Pendo directly — they become available for all. With a straightforward extract, transform, and load (ETL) process, every department and cross-functional initiative can easily access Pendo data in a centralized location. 

To date, Data Sync customers have used Pendo data for a wide variety of use cases. These include measuring the impact of product improvements on sales and renewals, identifying friction in your end-to-end user journey, and calculating a comprehensive customer health score across all data sources to shape renewal strategy. Other teams have also leveraged Pendo data to create a churn-risk model based on a foundation of product usage and sentiment signals or  identify up-sell and cross-sell opportunities to drive data-informed account growth.

Pendo Data Sync is ‘Built with BigQuery’

Building Data Sync on top of Google Cloud made the development and initial rollout of the solution very straightforward. Pendo’s engineering team was able to leverage its existing knowledge of Google Cloud products and services to build the beta version of Data Sync. This version was then rolled out to design partners using Google Cloud, helping to standardize the methods and best practices for pulling bulk Pendo data from Cloud Storage into BigQuery. Additionally, Pendo’s data science team uses BigQuery as its data warehouse solution and Looker as its primary business intelligence tool. The data team became the first “alpha” customer for Data Sync, partnering with engineering to design the product’s data structure, ETL best practices, and help documentation. 

Looking ahead, Pendo is exploring even deeper integration into Google Cloud, including data sharing directly in Analytics Hub.

Below is a diagram of the architecture Data Sync uses for its data flow:

Utilize your product data to the fullest

By partnering with Pendo, you can take maximum advantage of your product utilization data. Combining quantitative and qualitative feedback with other related data sets can give you a holistic view into user engagement and health, empowering your teams to make strategic decisions about customer retention and growth — backed by data.

To learn more about Data Sync, check out Pendo in Google Cloud Marketplace or contact your Google or Pendo sales representative.

You can also request a custom demo with a Pendo team member to learn how your business can use Pendo to increase customer engagement and health.

The ‘Built with BigQuery’ advantage for ISVs and data providers

Built with BigQuery helps companies like Pendo build innovative applications with Google Data Cloud. Participating companies can: 

Accelerate product design and architecture through access to designated experts who can provide insight into key use cases, architectural patterns, and best practices. 

Amplify success with joint marketing programs to drive awareness, generate demand, and increase adoption. 

BigQuery gives ISVs the advantage of a powerful, highly scalable unified AI lakehouse that’s integrated with Google Cloud’s open, secure, sustainable platform. To find how to harness the full potential of your data to drive innovation, learn more about Built with BigQuery

Source : Data Analytics Read More