This topic describes how to use MaxCompute to synchronize GitHub data in near real-time and perform integrated analysis of full and incremental data.
Solution overview
This solution uses the GitHub Archive public dataset. It collects data for more than 10 event types from GitHub, such as projects and user behaviors, and writes the data to MaxCompute in near real-time to perform full and incremental updates. The solution uses various real-time data writing methods, including DataWorks data integration, Flink Change Data Capture (CDC), and Flink. With the resource isolation capabilities of MaxCompute Query Acceleration (MCQA) 2.0, you can create a batch processing resource group (QuotaA) and an interactive resource group (QuotaB). This setup lets you write and update full and incremental data in MaxCompute while performing interactive query and analysis. Additionally, you can use TopConsole and DataWorks Notebook to conduct in-depth analysis of real-time GitHub data changes from multiple dimensions, such as developers, projects, and programming languages.
Solution architecture and advantages

The preceding figure shows a design for a typical data analytics scenario. It can handle near real-time data writing for the current day and also update and query historical offline data.
Provides unified management of full and incremental data, including data aggregation, deduplication, and anti-fraud measures. It periodically writes back full data to the data warehouse detail (DWD) layer and updates the incremental materialized views (MVs) in the data warehouse service (DWS) and application data service (ADS) layers accordingly. Using Flink CDC and DataWorks real-time data integration, data is written to the incremental data tables of a Delta Table to enable incremental queries and updates.
Enables interactive data queries at the DWS/ADS layer. It supports auto-refresh for incremental MVs in DWS and ADS to ensure data timeliness. It also integrates with TopConsole and DataWorks for data querying and visualization.
Uses the MCQA 2.0 query acceleration engine to configure different quota groups under a resource isolation architecture. This supports both incremental data computing and interactive query and analysis scenarios.
Near real-time data warehouse: Delta Table incremental table format
For scenarios that involve both minute-level or hour-level near real-time data processing and large-scale batch processing, MaxCompute provides an integrated solution for data storage and computing. This solution is based on the unified table format of Delta Lake and supports integrated processing of full and incremental data in near real-time. It offers capabilities such as minute-level real-time Upsert writes and TimeTravel data flashback. Its core features include the following:
Supports near real-time writes with checkpoint intervals of less than one minute.
Supports near real-time SQL queries (Incremental Query). You can run queries within minutes after a write operation is complete.
Provides automatic management of data files through StorageService, AutoCompaction, and AutoSorting features.
Near real-time data warehouse: Incremental computing and Incremental Materialized Views (MVs)
The incremental computing feature of MaxCompute combines CDC and stream incremental query capabilities. This lets you build your own incremental data processing pipelines using custom SQL. Incremental MVs are an effective way to build incremental computing models. You only need to use declarative SQL to define the expected data results. By configuring different refresh parameters, you can specify the refresh rate or data freshness. The backend engine automatically performs incremental refreshes and internal optimizations to create a near real-time data analytics pipeline. Its core features include the following:
Declarative SQL.
Integration of incremental and full data, with unified SQL, storage, and computing.
Support for intelligent pipeline orchestration for incremental MVs.
Support for periodic tasks and stream processing features for incremental CDC applications.
Ensures data freshness through real-time or custom incremental data refreshes. The formula is:
MV(T1) = delta(T0, T1) + MV(T0).
Near real-time data warehouse: MCQA 2.0 query acceleration
The MCQA 2.0 query acceleration engine for MaxCompute is designed for business requirements that demand high performance, isolation, and stability. It builds a resource isolation management engine similar to a Virtual Warehouse to significantly improve interactive query performance. It supports exclusive computing resources at the tenant level and uses multi-threaded pipeline execution to fully utilize precisely managed, dedicated computing resources. It also supports full-link caching capabilities, all types of SQL jobs, screen display jobs, and DDL and DML jobs.
Supports building multiple quota groups for resource isolation in a single-tenant environment. It also supports interactive queries on these quota groups.
Supports group management for time-sharing resources.
Accelerates interactive query performance, doubling the performance of the previous version.
Procedure video
Procedure
Step 1: Prepare a MaxCompute project
Step |
Procedure |
Expected result |
Step 0 Register for the invitational preview of new MaxCompute features |
|
The new MaxCompute features are enabled. |
Step 1 Initialize a new MaxCompute project |
|
|
Step 2 Purchase a new quota in Quota Management |
|
On the Quota Management page, confirm that the batch processing quota group and the interactive quota group are created. |
Step 3 Create a MaxCompute Delta Table |
On the SQL Analysis page, run the following sample commands to create two MaxCompute internal tables:
|
On the SQL Analysis page, select the project
|
Step 2: Write full and incremental data in near real-time
Obtain the real-time dataset from GitHub Archive using Flink CDC or DataWorks data integration.
Choose one of the following methods to write data as needed.
Flink CDC
Step |
Procedure |
Expected result |
Step 1 Connect to and verify the real-time MySQL data source |
The connection information for the MySQL data source is as follows.
Note
Make sure the MySQL data source can be accessed over the public network. If it cannot be accessed over the public network, you can configure an Internet NAT gateway. |
Confirm that the public GitHub data source is available. |
Step 2 Using Flink Writing data with CDC |
Write real-time GitHub Event data to a MaxCompute Delta Table using Flink CDC. For more information, see Write data to a Delta Table in near real-time using open source Flink CDC.
|
Check the data changes in the yunqi_github_events_odps_cdc table in MaxCompute. |
DataWorks data integration
Step |
Operations |
Expected result |
Step 1 Connect to and verify the real-time MySQL data source |
The connection information for the MySQL data source is as follows.
Note
Make sure the MySQL data source can be accessed over the public network. If it cannot be accessed over the public network, you can configure an Internet NAT gateway. |
Confirm that the public GitHub data source is available. |
Step 2 Configure a real-time data source in DataWorks |
Write real-time GitHub Event data to a MaxCompute Delta Table using DataWorks data integration (real-time data source).
|
Confirm that the source and destination data sources are connected. |
Step 3 DataWorks: Real-time task synchronization |
Write real-time GitHub Event data to a MaxCompute Delta Table using DataWorks data integration.
|
Check the data changes in the yunqi_github_events_odps_dw table in MaxCompute. |
Step 3: Perform near real-time query analysis and incremental computing
Near real-time data analysis: Use the interactive quota group mcqa2_demo_yunqi (64 CUs) for SQL data analysis in MaxCompute TopConsole.
Incremental MV - automated dynamic table: Use the batch processing quota group batch_demo_yunqi (128 CUs) for dynamic table incremental computing in MaxCompute TopConsole.
Incremental computing - CDC/Stream/periodic Tasks: Use the batch processing quota group batch_demo_yunqi for custom incremental computing in MaxCompute TopConsole.
Step |
Procedure |
Expected result |
Step 1 Use the interactive resource group for near real-time data analysis |
The specific SQL analysis steps are as follows:
|
Observe the SQL query results. |
Step 2 Use the batch processing resource group for incremental computing and aggregate queries with incremental MVs |
The specific SQL analysis steps are as follows:
|
Observe the SQL query results. |
Step 3 Use the batch processing resource group for incremental computing with Stream and Task applications |
The specific SQL analysis steps are as follows:
|
Observe the SQL query results. |
Step 4: Configure multiple quotas and accelerate interactive queries
After scaling out an interactive Quota group from 64 CU to 96 CU, you can run an interactive query in the MaxCompute TopConsole on the new Quota group to observe the improvement in query acceleration.
Step |
Procedure |
Expected result |
Step 1 Scale out the quota |
|
The target quota group is scaled out. |
Step 2 Compare and analyze query performance and optimization |
The specific SQL analysis steps are as follows:
|
Observe the SQL query results. |
Step 5 (Optional): Perform integrated interactive analysis of full and incremental data
Use the DataWorks IDE module to perform integrated, near real-time analysis of full and incremental data.
Step |
Procedure |
Expected result |
Step 1 Configure MaxCompute compute resources in the DataWorks IDE Data Development module |
|
None |
Step 2 Perform data analysis on the DataWorks IDE Data Development platform |
The specific SQL analysis steps are as follows:
|
Observe the SQL query results. |
Summary
This example demonstrates a practical solution built on the new features of the MaxCompute near real-time data warehouse. MaxCompute provides integrated processing of full and incremental data and near real-time query capabilities. It upgrades its near real-time computing capabilities through a three-layer architecture: the data storage layer (Delta Table unified table format), the computing layer (incremental computing: CDC/Task/incremental MV), and the acceleration layer (MCQA 2.0 query acceleration engine). By following this typical demo, you can gain a deep understanding of how to build complete near real-time and integrated full and incremental computing tasks on MaxCompute, which simplifies computing optimization throughout data lifecycle.
