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

Developing Applications with MySQL and Java

Embed Size (px)

Citation preview

Page 1: Developing Applications with MySQL and Java

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

Page 2: Developing Applications with MySQL and Java

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

Insert Picture HereDeveloping Applications with MySQL and JavaMark MatthewsConsulting Member, Technical Staff - Oracle

Page 3: Developing Applications with MySQL and Java

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

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.

Page 4: Developing Applications with MySQL and Java

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

Graphic Section Divider

Page 5: Developing Applications with MySQL and Java

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

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

Page 6: Developing Applications with MySQL and Java

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

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”

Page 7: Developing Applications with MySQL and Java

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

Designing for Scalability

● Vertical Scalability● Algorithms

● Persistence tuning

● Horizontal Scalability

● Partitioning by workload

● Partitioning by service

Page 8: Developing Applications with MySQL and Java

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

Architecture – Birth of an Application

UI

Business Logic

MySQL

Persistence

Page 9: Developing Applications with MySQL and Java

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

Architecture – Growing the Application

UI

Business Logic

Write

Persistence

Client APIs

3rd Party

Read

Page 10: Developing Applications with MySQL and Java

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

Architecture – Growing the Application Again

UI

Business Logic

Write

Persistence

Client APIs

3rd Party

Read

Caching

Page 11: Developing Applications with MySQL and Java

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

Architecture – Growing the Application Again

UI

Business Logic

Write

Persistence

Client APIs

3rd Party

Read

Caching

Page 12: Developing Applications with MySQL and Java

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

Architecture – Growing the Application Again

by-data A by-data B by-data C

Page 13: Developing Applications with MySQL and Java

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

Architecture – Growing the Application Again

by-data A by-data B by-data C

by-data A by-data B by-data C

by-data A by-data B by-data C

Customers

Inventory/Rentals Comments/Rating

Page 14: Developing Applications with MySQL and Java

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

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

Page 15: Developing Applications with MySQL and Java

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

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)

Page 16: Developing Applications with MySQL and Java

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

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

Page 17: Developing Applications with MySQL and Java

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