Skip to content

Commit

Permalink
DRA LiveLab Doc (#905)
Browse files Browse the repository at this point in the history
* DRA LiveLab Doc

* rename root to hands-on-lab
  • Loading branch information
ddrechse authored Jul 19, 2024
1 parent bd599af commit ffce6af
Show file tree
Hide file tree
Showing 36 changed files with 1,246 additions and 0 deletions.
54 changes: 54 additions & 0 deletions data-refactoring-advisor/dra-backend/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
## Data Refactoring Advisor Back End

A Spring Boot Service that provides Property Graph and Community Detection support. It connects to an Oracle Autonomous Database instance.


## Build

```
mvn compile
```

## Configure
Update resources/application.properties.

```
# Oracle settings
spring.datasource.hostname=adb.us-ashburn-1.oraclecloud.com
spring.datasource.port=1521
spring.datasource.service.name=clouddbinstance_dbname_dbservicelevel.adb.oraclecloud.com
spring.datasource.url=jdbc:oracle:thin:@dbname_dbservicelevel?tns_admin=/Users/myuser/remotedb-wallet
spring.datasource.username=ADMIN
spring.datasource.password=Welcome12345
spring.datasource.driver-class=oracle.jdbc.driver.OracleDriver
dra.load.sts.sql.file.path=/Users/loacalpath/datarefactoringadvisor/dra-backend/src/main/resources/workload-simulate-queries.sql
```


This information can be found on the Database Connection window in the OCI Console.

hostname and service.name come directly from the connection string.

datasource.url is a substring of the service name and tns_admin is the location of the wallet.

Modify local wallet! Edit sqlnet.ora and update DIRECTORY to the wallet
```
WALLET_LOCATION = (SOURCE = (METHOD = file) (METHOD_DATA = (DIRECTORY =/Users/myuser/remotedb-wallet ")))SSL_SERVER_DN_MATCH=yes
```

dra.load.sts.sql.file.path is the local path to a workload simulator SQL file called workload-simulate-queries.sql

## Run
```
./mvnw spring-boot:run
```

## Success
```
2024-06-06 16:15:19 INFO o.s.b.d.a.OptionalLiveReloadServer - LiveReload server is running on port 35729
2024-06-06 16:15:19 INFO o.s.b.w.e.tomcat.TomcatWebServer - Tomcat started on port(s): 8080 (http) with context path ''
2024-06-06 16:15:19 INFO com.example.dra.DraApplication - Started DraApplication in 5.855 seconds (process running for 6.326)
```
77 changes: 77 additions & 0 deletions data-refactoring-advisor/dra-frontend/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# Getting Started with Create React App

This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).

## Available Scripts

In the project directory, you can run:

### `Install Packages and Build`

npm install

npx create-react-app dra-frontend


### `npm start`

Runs the app in the development mode.\
Open [http://localhost:3000](http://localhost:3000) to view it in your browser.

The page will reload when you make changes.\
You may also see any lint errors in the console.

### `npm test`

Launches the test runner in the interactive watch mode.\
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.

### `npm run build`

Builds the app for production to the `build` folder.\
It correctly bundles React in production mode and optimizes the build for the best performance.

The build is minified and the filenames include the hashes.\
Your app is ready to be deployed!

See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.

### `npm run eject`

**Note: this is a one-way operation. Once you `eject`, you can't go back!**

If you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.

Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.

You don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.

## Learn More

You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).

To learn React, check out the [React documentation](https://reactjs.org/).

### Code Splitting

This section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)

### Analyzing the Bundle Size

This section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)

### Making a Progressive Web App

This section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)

### Advanced Configuration

This section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)

### Deployment

This section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)

### `npm run build` fails to minify

This section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)
51 changes: 51 additions & 0 deletions data-refactoring-advisor/hands-on-lab/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Discovering Bounded Contexts from your SQL Schema using Community Detection

Data Refactoring Advisor is an innovative methodology designed to assist existing Oracle Database users in refactoring their schemas and identifying communities based on join activity. Here’s how it works:

Process Overview:

1. Data Collection: Gathers SQL tuning sets data to create an affinity matrix.
2. Graph Modeling: Translates the affinity matrix into a graph for community detection.
3. Community Detection: Identifies communities within the graph, representing potential bounded contexts.

Data Refactoring Advisor simplifies the complex task of transforming monolithic applications into agile microservices. By focusing on join activity and leveraging advanced community detection techniques, it helps users optimize their database schemas, improve performance, and enhance the scalability of their applications. This methodology is particularly valuable for existing Oracle Database users seeking to modernize their infrastructure and adopt a microservices architecture.

It works by helping users refactor the data access layer, transitioning from a monolithic architecture to a microservices architecture.

![monoMicro](./images/monoMicro.png)


## 1. User Permissions

Have ADMIN apply the [following grants](./user-perms/README.md) to the user capturing workload in a SQL Tuning Set

## 2. Collect Database Workload

To begin optimizing an existing application, the initial task involves gathering the workload based upon the SQL statements being run against the database instance. For applications utilizing an Oracle database and accessing tables through SQL queries, a recommended approach is to analyze how the application interacts with these tables. SQL Tuning Sets serve as a valuable tool for capturing and providing detailed access pattern data, once they are correctly configured by following the steps outlined below.


[Collect Database Workload with a SQL Tuning Set](./collect-database-workload/README.md)

## 3. Create Graph Tables

To facilitate community detection analysis, we need to set up two key metadata tables.

• The NODES table will catalog all tables in our dataset, detailing their access frequency and participation in joins with other tables. This provides a clear view of how each table is utilized and interacts within the dataset.

• The EDGES table, on the other hand, will record the relationships (affinities) between pairs of tables, forming the edges in our dataset’s graph representation.

These tables are essential for applying community detection algorithms like Infomap, as they establish the foundation for identifying clusters or communities of interconnected tables based on their usage and relationships.

[Create Graph Tables](./create-graph-tables/README.md)

## 4. Create Graph with Graph Studio

Oracle’s Graph Studio is a powerful tool designed to create, query, and analyze graphs from tables within your Autonomous Database, simplifying graph analytics.

[Create Graph with Graph Studio](./create-graph/README.md)

## 5. Run Community Detection with a Notebook

We create a notebook in Graph Studio for running Community Detection. A notebook is used to run queries against a graph.

[Run Community Detection with a Notebook](./community-detection/README.md)
Loading

0 comments on commit ffce6af

Please sign in to comment.