1Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Insert Information Protection Policy Classification from Slide 12
Developing Applications with
MySQL and Java
Mark Matthews
Consulting Member, Technical Staff - Oracle

2Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Insert Information Protection Policy Classification from Slide 12

Insert Picture Here
The following is intended to outline our general product direction. It is intended
for information purposes only, and may not be incorporated into any contract.
It is not a commitment to deliver any material, code, or functionality, and should
not be relied upon in making purchasing decisions. The development, release,
and timing of any features or functionality described for Oracle’s products
remains at the sole discretion of Oracle.

3Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Insert Information Protection Policy Classification from Slide 12
Graphic Section Divider

4Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Insert Information Protection Policy Classification from Slide 12
Please ask Questions!

● This is not a lecture – but an opportunity to learn from each other
● The only assumption I'm making is that you're not expecting to write PHP
● (if you haven't seen some of these frameworks, methods, etc. it's okay) e

5Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Insert Information Protection Policy Classification from Slide 12
Elements of Scalability

● Vertical Scalability – single component responding to load
●
Largely driven by efficient resource usage
● Horizontal Scalability – more components responding to load
●

Architecture that allows “divide and conquer”

6Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Insert Information Protection Policy Classification from Slide 12
Designing for Scalability

● Vertical Scalability
●
Algorithms
●

Persistence tuning

● Horizontal Scalability
●

Partitioning by workload

●

Partitioning by service

7Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Insert Information Protection Policy Classification from Slide 12
Architecture – Birth of an Application
UI
Business Logic
Persistence

MySQL

8Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Insert Information Protection Policy Classification from Slide 12
Architecture – Growing the Application
UI

3rd Party

Client APIs
Business Logic
Persistence

Write
9Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Read

Insert Information Protection Policy Classification from Slide 12
Architecture – Growing the Application Again
UI

3rd Party

Client APIs
Business Logic
Caching
Persistence

Write
10Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Read

Insert Information Protection Policy Classification from Slide 12
Architecture – Growing the Application Again
UI

3rd Party

Client APIs
Business Logic
Caching
Persistence

Write
11Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Read

Insert Information Protection Policy Classification from Slide 12
Architecture – Growing the Application Again
by-data A

12Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

by-data B

Insert Information Protection Policy Classification from Slide 12

by-data C
Architecture – Growing the Application Again
Customers
by-data A

by-data B

by-data C

Inventory/Rentals
by-data A

by-data B

by-data C

13Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Insert Information Protection Policy Classification from Slide 12

Comments/Rating
by-data A

by-data B

by-data C
Design for Growth from the Start

● Separation of concerns from the start
● Business Logic
●

Natural place for units of work, partitioning

●

Natural point to build APIs to deliver services

● Persistence Logic
●

Easier to tune/fix persistence performance issues – once -

●

Easy to cache if in one place

14Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Insert Information Protection Policy Classification from Slide 12
This Lab

● MySQL in a replication hierarchy
●
Managed by MySQL Sandbox
●

“Sakila” Schema

● Simple harness over a layered service architecture
●

Spring, Hibernate, EhCache

● Evolution
●

Performance, Partitioning by workload, (further into cells)

15Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Insert Information Protection Policy Classification from Slide 12
Take Aways

● Design for scale up front
● Demarcate units of work with transactions
●
Makes it possible to load balance
●

Natural cleave point for partitioning by service

● Compartmentalize persistence
●

Fix performance issues once

●

Add caching in one place

●

Testability

16Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Insert Information Protection Policy Classification from Slide 12
17Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Insert Information Protection Policy Classification from Slide 12

Developing Applications with MySQL and Java

  • 1.
    1Copyright © 2012,Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 12
  • 2.
    Developing Applications with MySQLand Java Mark Matthews Consulting Member, Technical Staff - Oracle 2Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 12 Insert Picture Here
  • 3.
    The following isintended to outline our general product direction. It is intended for information purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. The development, release, and timing of any features or functionality described for Oracle’s products remains at the sole discretion of Oracle. 3Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 12
  • 4.
    Graphic Section Divider 4Copyright© 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 12
  • 5.
    Please ask Questions! ●This is not a lecture – but an opportunity to learn from each other ● The only assumption I'm making is that you're not expecting to write PHP ● (if you haven't seen some of these frameworks, methods, etc. it's okay) e 5Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 12
  • 6.
    Elements of Scalability ●Vertical Scalability – single component responding to load ● Largely driven by efficient resource usage ● Horizontal Scalability – more components responding to load ● Architecture that allows “divide and conquer” 6Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 12
  • 7.
    Designing for Scalability ●Vertical Scalability ● Algorithms ● Persistence tuning ● Horizontal Scalability ● Partitioning by workload ● Partitioning by service 7Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 12
  • 8.
    Architecture – Birthof an Application UI Business Logic Persistence MySQL 8Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 12
  • 9.
    Architecture – Growingthe Application UI 3rd Party Client APIs Business Logic Persistence Write 9Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Read Insert Information Protection Policy Classification from Slide 12
  • 10.
    Architecture – Growingthe Application Again UI 3rd Party Client APIs Business Logic Caching Persistence Write 10Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Read Insert Information Protection Policy Classification from Slide 12
  • 11.
    Architecture – Growingthe Application Again UI 3rd Party Client APIs Business Logic Caching Persistence Write 11Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Read Insert Information Protection Policy Classification from Slide 12
  • 12.
    Architecture – Growingthe Application Again by-data A 12Copyright © 2012, Oracle and/or its affiliates. All rights reserved. by-data B Insert Information Protection Policy Classification from Slide 12 by-data C
  • 13.
    Architecture – Growingthe Application Again Customers by-data A by-data B by-data C Inventory/Rentals by-data A by-data B by-data C 13Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 12 Comments/Rating by-data A by-data B by-data C
  • 14.
    Design for Growthfrom the Start ● Separation of concerns from the start ● Business Logic ● Natural place for units of work, partitioning ● Natural point to build APIs to deliver services ● Persistence Logic ● Easier to tune/fix persistence performance issues – once - ● Easy to cache if in one place 14Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 12
  • 15.
    This Lab ● MySQLin a replication hierarchy ● Managed by MySQL Sandbox ● “Sakila” Schema ● Simple harness over a layered service architecture ● Spring, Hibernate, EhCache ● Evolution ● Performance, Partitioning by workload, (further into cells) 15Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 12
  • 16.
    Take Aways ● Designfor scale up front ● Demarcate units of work with transactions ● Makes it possible to load balance ● Natural cleave point for partitioning by service ● Compartmentalize persistence ● Fix performance issues once ● Add caching in one place ● Testability 16Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 12
  • 17.
    17Copyright © 2012,Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 12