Post on 01-Jun-2015
Cross-Tier Application & Data Partitioning of Web Applications
for Hybrid Cloud Deployment
Nima Kaviani Eric Wohlstadter
Rodger Lea
1
Motivation – Cloud Computing
• Virtualization• Multi-tenancy• Scalability• Cheaper Deployments
However …Loss of controlRegulations (HIPAA, PCI)AuditingOutages…
2
Motivation – Cloud Computing
• Virtualization• Multi-tenancy• Scalability• Cheaper Deployments
However …Loss of controlRegulations (HIPAA, PCI)AuditingOutages…
3
Motivation – Hybrid Cloud• Combine Private cloud and Public IaaS• Split Architecture
4
Motivation – Hybrid Cloud• Combine Private cloud and Public IaaS• Split Architecture• Software = Code + Data
5
Motivation – Hybrid Cloud• Combine Private cloud and Public IaaS• Split Architecture• Data Placement Constraints
6
Motivation – Hybrid Cloud• Combine Private cloud and Public IaaS• Split Architecture• Code Placement Constraints
7
Motivation – Hybrid Cloud• Combine Private cloud and Public IaaS• Split Architecture• Inter code/data placement constraints
8
Motivation – Hybrid Cloud• Combine Private cloud and Public IaaS• Split Architecture• Trade-off cross-cuts the system
Trade-off between Cost and Control
CHALLENGE…
9
Motivation – Hybrid Cloud• Combine Private cloud and Public IaaS• Split Architecture• OLTP-style Web Applications
Trade-off between Cost and Control
CHALLENGE…
10
Motivation – Hybrid Cloud• Combine Private cloud and Public IaaS• Split Architecture• OLTP-style Web Applications
Trade-off between Cost and Control
CHALLENGE…
11
Code = Software FunctionsData= Database Tables
Related Work
12
19
Partitioning Problem
Integer ProgrammingLibrary
Premise
Monolithic Profiling
Cloud
Application Partitioning
CodeProfiling Application-
Tier BIP
BIP Solver
Code PlacementMANTICORE
Nima Kaviani, Eric Wohlstadter, Rodger Lea. MANTICORE: a Framework for Partitioning Software Services for Hybrid Cloud. In Proceedings of the 4th IEEE International Conference on Cloud Computing Technologies and Science, December 2012, Taipei, Taiwan, pages 333-340.
20
Cross-tier Partitioning
CodeProfiling Application-
Tier BIP
BIP Solver
Code PlacementMANTICORE
21
Cross-tier Partitioning
CodeProfiling Application-
Tier BIP
EXPLAINPLAN
CreateObjectiveFunction
CreateConstraints
Join Orders
Combined Partitioning
Solver
Code Placement
Table Placement
22
Data-tier Partitioning
23
Engineers know: Database knows:
• Code and data dependencies• Data placement constraints
• Inter-data dependencies• Query cost models
Model the combined knowledge & Solve it!
Example Cross-tier Request FlowPull up user information and Stock holdings for a given user id
24
AppTierAppTier
DataTierDataTier
Request
Query
Example Cross-tier Request FlowPull up user information and Stock holdings for a given user id
doGetUserStock
getUserInfo
executeQuery
renderHTML
ha
p userprofile (p)
holdings (h)account (a)
25
AppTierAppTier
DataTierDataTier
Request
Query
Example Cross-tier Request FlowPull up user information and Stock holdings for a given user id(USER DATA ON PREMISE)
doGetUserStock
getUserInfo
executeQuery
renderHTML
ha
p userprofile (p)
holdings (h)account (a)
USER DATA: Constrained to be on premise
26
Intra-Query Dependencies
ha
p
pa
h
Local Execution
Pull up user information and Stock holdings for every user
27
doGetUserStock
getUserInfo
executeQuery
renderHTMLTwo choices
1.How bad would it be if we move or not move holding table to the cloud
2.How bad would it be if we join accounte and userporfile tables first
Intra-Query Dependencies
ha
p
pa
h
Pull up user information and Stock holdings for every user
Two cuts /two round-trips
Approach 1: Keep sensitive data on private premise
28
doGetUserStock
getUserInfo
executeQuery
renderHTML
Intra-Query Dependencies
ha
p
pa
h
Pull up user information and Stock holdings for every user
More premiseresource usage
Approach 2: Push everything to private premise
29
doGetUserStock
getUserInfo
executeQuery
renderHTML
Intra-Query Dependencies
ha
p
pa
h
Alternative Execution
Approach 3: Findalternative plans
1. One cut / less round-trip2. Less premise resource usage
30
doGetUserStock
getUserInfo
executeQuery
renderHTML
Data Dependency Analysis
1. Analyze Alternative Plans2. Collect Data on Every Plan3. Create Mathematical Model
1. Define BIP Constraints2. Define BIP Objective
4. Combine with Code Partitioning
31
1. Analyze Alternative Plans
Problem: Find performance for various plans
Solution:-Improve complexity
- Encode 2M alternative plans
- M is the number of tables in a plan
- M < 10
- M stable with the application size
- O (Q x 2M) vs. O (2N)
Straw man 1:-Try all 2N placements for tables
-N >> 10 and grows with the application size
Straw man 2:-Have all the analysis on one machine
-Inapplicable data
32
2. Use EXPLAIN PLAN for Profiling
EXPLAIN PLAN FOR SELECT p.*, h.* FROM
holding h, accountprofile p,
account a WHERE
h.accountid = a.accountid AND
a.userid = p.userid AND h.quote_symbol = ? AND
a.accountid = ?
34
Creating the Mathematical Model
• Encode join alternatives• Encode placement of tables in a join• Encode the objective–Minimizing cost –Minimizing performance
38
4. Combine with Code Partitioning
39
doGetUserStock
getUserInfo
executeQuery
renderHTML
pa
h userprofile (p)
holdings (h)account (a)
Combining objectives and constraints:
Generate the Results
Code on premiseCode in the cloud
Data on premiseData in the cloud
40
Evaluation• Apache Day Trader – Open Source Trading Web App
• RUBiS – Open Source Auctioning Web App
• 2 Premise Machines
– Database Machine (2.5GHz dual core, 4GB RAM)
– Application Server (3.5GHz dual core, 4GB RAM)
• Cloud Instance– Amazon West Region (Oregon)
2 EC2 Large Compute Units
• User sensitive tables are pinned to the premise– Account & AccountProfile tables for Apache Day Trader
– Users table for RUBiS
• 15ms latency
41
Evaluation - Deployments
doGetUserStock
getUserInfo
executeQuery
renderHTML
pa
h userprofile (p)
holdings (h)account (a)
Private Premise42
Evaluation - Deployments
doGetUserStock
getUserInfo
executeQuery
renderHTML
pa
h userprofile (p)
holdings (h)account (a)
doGetUserStock
getUserInfo
executeQuery
renderHTML
pa
h userprofile (p)
holdings (h)account (a)
Private Premise Naïve Hybrid43
Evaluation - Deployments
doGetUserStock
getUserInfo
executeQuery
renderHTML
pa
h userprofile (p)
holdings (h)account (a)
Code Split44
Evaluation - Deployments
doGetUserStock
getUserInfo
executeQuery
renderHTML
ha
p userprofile (p)
holdings (h)account (a)
doGetUserStock
getUserInfo
executeQuery
renderHTML
pa
h userprofile (p)
holdings (h)account (a)
Code Split Cross-tier45
Evaluation - PerformanceHow is the performance affected with different models of deployment?
46
Cross-Tier deployment exhibits:28 - 56% improvement compared to Naïve-
Hybrid15 - 45% improvement compared to Split-Code
Evaluation – Deployment CostsHow is the cost affected with different models of deployment?
47
Cross-Tier deployment exhibits:20 - 54% cheaper than Naïve-Hybrid11 - 29% cheaper than Split-Code
Evaluation – ScalabilityHow is the scalability affected with different models of deployment?
48
Cross-Tier deployment exhibits:best scalability compared to all deploymentsNo performance degradation
Challenges
49
Contributions
•Cross-tier partitioning provides options between cost, performance, and privacy
•We solved the combined partitioning problem
•Our evaluations show effectiveness of cross-tier partitioning
50