Introduction to Spark

Updated at:

Database services, such as RDS and NoSQL, excel in online storage and query scenarios. The X-Pack Spark service uses external compute resources to provide complex analysis, stream processing, ingestion, and machine learning capabilities for storage services, including Redis, Cassandra, MongoDB, HBase, and RDS. This service helps you solve various data processing challenges.

The X-Pack Spark service has the following features:

  • Data workbench: Provides a one-stop development experience that covers testing, development, and publishing. It supports interactive mode, job management, workflows, Resource Management, and metadata management.
  • Spark multi-source connectors: You can connect to Cassandra, HBase, MongoDB, Redis, and RDS clusters with a single click. This feature eliminates the hassle of debugging and simplifies data analysis across different databases.
  • Maintainability: It supports minor version upgrades, monitoring, and alerts. This feature removes the need for you to maintain Spark clusters.
  • Offline data warehouse capabilities: You can archive data from online databases, such as RDS, PolarDB, MongoDB, Cassandra, and HBase, to Spark with a single click to build a unified data warehouse. You can use HiveMeta to manage the data in the warehouse.
  • Cost-effective: X-Pack Storage supports tiered storage to meet various capacity and cost needs. It supports Hadoop Distributed File System (HDFS) on cloud disks and D1 instances, and OSS. The compute nodes support elastic scaling to minimize costs.

Business architecture

ApsaraDB online databases excel in online query scenarios. X-Pack Spark provides users of these databases with hybrid workload capabilities, including the following:

  • Stream processing and ingestion: You can use Spark Streaming for stream extract, transform, and load (ETL) to ingest data into your database with latency as low as a few seconds.
  • Ecosystem integration: You can use Spark's multi-source capabilities for batch ingestion from external data sources and for federated analytics.
  • Complex computation and algorithms: It supports multiple languages, such as SQL, Python, Java, Scala, and R. It also supports complex data processing procedures that are similar to PL/SQL, and machine learning.
  • Offline data warehouse for complex analysis: You can archive data to Spark with a single click to add petabyte-scale offline data warehouse capabilities to your database. This supports complex analysis and the generation of daily or monthly reports.
  • Unstructured data processing: You can use Spark with HDFS or OSS storage to add capabilities for managing unstructured data to your database. This includes processing and storing data in formats such as CSV, XML, and Parquet.

Typical scenarios

1. Unified data ETL service

  • Scenario: As a business grows, it often stores different types of data in various databases. This can create data silos that hinder development. A unified ETL service connects this data, which allows the data to interact and generate more value.

  • Value and advantages:

    • Rich data sources: It supports nearly all Alibaba Cloud data sources, such as databases, message middleware, and OSS.
    • ETL capabilities: It supports unified batch and stream processing, multi-source federated ETL, and languages such as SQL, Python, and Scala.
    • Data management capabilities: It supports metadata management, workflow dependencies, timed job scheduling, and alerts.

2. Big data user persona and recommendation scenarios

  • Scenario: As a user base grows, a business may want to add a product recommendation feature. This requires real-time ETL analysis of behavioral logs, in addition to data storage and model computation.
  • Value and advantages:
    • Spark's multi-source processing capabilities can connect to nearly all data systems, such as RDS, Cassandra, MongoDB, HBase, Redis, Kafka, and Loghub.
    • Spark's unified capabilities for stream, batch, and machine learning processing provide a one-stop solution for all your computation needs.
    • Cassandra or HBase is ideal for storing user personas in a unified wide table.
    • You can use MongoDB to store product information and Redis to serve as an acceleration layer for recommendation results.

3. IoT log processing platform

  • Scenario: In industries such as the Internet of Vehicles (IoV), Internet of Things (IoT), and gaming, millions of terminals can continuously write hundreds of terabytes of data. This scenario requires online queries on billions of records and big data computation on cold data.
  • Value and advantages:
    • Hot and cold data separation to reduce costs: For example, you can store three months of hot data in a big data online data store such as Cloud Cassandra or HBase Phoenix, which use SSDs. You can store all cold data in the X-Pack Spark data warehouse (HiveMeta), which uses D1 instances with local disks and OSS.
    • Integrated storage and computation: Data written to online databases such as Cloud Cassandra, HBase Phoenix, and MySQL is archived in real time to the X-Pack Spark data warehouse (HiveMeta) using logs. This data can then be used for big data computation and analysis.

4. Big data risk control system

  • Scenario: Industries such as E-commerce, gaming, advertising, and finance must record user behavioral logs and order details for risk control. This process involves pre-event, in-event, and post-event measures, and requires a platform with storage, computation, and machine learning capabilities.
  • Value and advantages:
    • Integrated storage, computation, and machine learning: You can choose an online storage solution based on your data type, such as MongoDB, Cassandra, or HBase. For example, MongoDB is suited for JSON data, Cassandra is ideal for real-time SQL storage of wide tables, and HBase is good for online key-value storage. Spark is the industry's most mature unified big data platform and supports stream and batch computing, and machine learning.
    • Support for pre-event, in-event, and post-event risk control: You can use risk control results from online storage for pre-event control. You can use Spark Streaming for in-event control. You can use the data warehouse capabilities of X-Pack Spark to perform risk control on full data sets.
    • Integrated model training and simulation: You can use Spark MLlib and its computing power for model training. You can also use the offline data warehouse capabilities of X-Pack Spark to run simulations and evaluations on rules and models.

5. Building a data middle platform

  • Scenario: When a company's business is rapidly growing, data is often stored across different systems, such as Cassandra, MongoDB, HBase, RDS, PolarDB, Kafka, Loghub, Tablestore, and AnalyticDB (ADB). This eventually creates a need to build a unified data warehouse. The data warehouse storage and multi-source connector capabilities of X-Pack Spark are ideal for this purpose.
  • Value and advantages:
    • X-Pack Spark multi-source support: X-Pack Spark can connect to almost all message middleware, NoSQL, online transactional processing (OLTP), and online analytical processing (OLAP) data systems.
    • Disparate data source archiving: You can archive data from disparate data sources such as Cassandra, MongoDB, HBase, and RDS with a single click.
    • X-Pack Spark data warehouse capabilities: X-Pack Spark includes a built-in HiveMeta to manage many complex data warehouse tables.
    • X-Pack Spark Storage capabilities: It supports various storage media at different price points, including HDFS on high-efficiency disks, HDFS on local disks, and OSS.
    • X-Pack Spark Storage resource elasticity: It supports elastic scaling of compute resources based on the complexity of the computation.
    • X-Pack Spark developer capabilities: It supports analytical and computational development in languages such as SQL, Python, Scala, and Java.

For more information about use cases in other vertical industries, see the example documents.