Skip to content

mariadb-corporation/dev-example-modern-sql

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Modern SQL, MariaDB, and Apache Zeppelin!

⚠️ [UNMAINTAINED] This repository has been moved and is currently maintained here. ⚠️


MariaDB implements more of the standard SQL specification than any other open source database, adding support for common table expressions (CTEs), window functions, temporal data tables and many other features over the last few years.

The following will walk you through the steps for setting up Apache Zeppelin to integrate with MariaDB and work with several samples of modern SQL functionality.

Table of Contents

  1. Requirements
  2. Introduction to MariaDB
    1. MariaDB Platform
    2. MariaDB SkySQL
  3. Preparing the database
    1. Create the schema
    2. Load the data
  4. Using Apache Zeppelin
    1. Adding a MariaDB Interpreter
    2. Importing Zeppelin notes
  5. Raw Queries
  6. Support and Contribution
  7. License

Environment and Compatibility

This project assumes you have familiarity with building web applications using ReactJS and NodeJS technologies.

  • Download and install MariaDB.
  • Download and install Apache Zeppelin.
  • git (Optional) - this is required if you would prefer to pull the source code from GitHub repo.
    • Create a free github account if you don’t already have one
    • git can be downloaded from git-scm.org

Introduction to MariaDB

MariaDB Platform

MariaDB Platform integrates transactional and analytical products so developers can build modern applications by enriching transactions with real-time analytics and historical data, creating insightful experiences and compelling opportunities for customers – and for businesses, endless ways to monetize data.

To get started using MariaDB locally you can choose one of the following options:

MariaDB SkySQL

SkySQL is the first and only database-as-a-service (DBaaS) to bring the full power of MariaDB Platform to the cloud, including its support for transactional, analytical and hybrid workloads. Built on Kubernetes, and optimized for cloud infrastructure and services, SkySQL combines ease of use and self-service with enterprise reliability and world-class support – everything needed to safely run mission-critical databases in the cloud, and with enterprise governance.

Get started with SkySQL!

Preparing the database

Create the schema

Next execute the SQL within schema.sql either manually within a new database, or using the MariaDB client:

Locally (with root and empty password):

$ mariadb < sql/schema.sql

MariaDB SkySQL:

mariadb --host tx-1.mdb0001390.db.skysql.net --port 5002 --user DB00003108 -pPassword123! --ssl-ca ~/Downloads/skysql_chain.pem < sql/schema.sql>

Note: The previous commands assume you have the MariaDB client installed, the relative locations of schema.sql and the skysql_chain.pem file residing in a directory called Downloads. But all things are configurable :)

The script will create the following tables within a database called demo:

  • supers
  • teams
  • supersteams

Load the data

Once the database and tables have been created, execute the data.sql script to load data into the tables.

$ mariadb < sql/data.sql

Getting started with Apache Zeppelin

Adding a MariaDB interpreter <a name="add-interpreter>

For a more comprehensive step-by-step walk-through of how to setup and use Zeppelin with MariaDB check out this blog post!

After you've downloaded and installed Apache Zeppelin you will need to add a new interpreter for MariaDB using the following steps:

  1. Navigate to "Interpreter".

  1. Click the "Create" button.

  2. Enter a name for the interpreter and select an "Interpreter group" of jdbc.

  1. Assign value of org.mariadb.jdbc.Driver to default.driver.

  2. Assign value of jdbc:mariadb://<database_address>/ (where <database_address> is the location of your MariaDB database instance) to default.url.

  3. Assign value to default.user.

  4. Assign value to default.password.

  5. Add the location of the JDBC driver as an artifact.

Importing notes

In Zeppelin, a notebook is simply a collection of notes, which is a collection of “paragraphs”. Each paragraph then uses an interpreter (via MariaDB Connector/J) to connect to and communicate with a datasource (MariaDB).

This repo contains several notes that demonstrate a variety of modern SQL capabilities within MariaDB.

Notes can be imported into Zeppelin by clicking the "Import Note" button, and providing a valid json note file.

Raw Queires

If you'd prefer to execute the SQL queries contained within the Apache Zeppelin you can find them all within demos.sql.

Support and Contribution

Please feel free to submit PR's, issues or requests to this project project directly.

If you have any other questions, comments, or looking for more information on MariaDB please check out:

Or reach out to us diretly via:

License

License

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published