TPlite is Back! - Microsoft Research

Download Report

Transcript TPlite is Back! - Microsoft Research

TPlite is Back!
Jim Gray
Microsoft Research
http://research.microsoft.com/~gray/talks/
High Performance Transaction Processing Workshop,
Asilomar, CA., 27 September 2005,
1
Summary Statement
• Database system’s have changed
– Is a web service
(listens to port 80, does wsdl+soap,…)
– Hosts a programming environment
(J2EE VM or .NET CLR or… )
• So, Client-Server (a.k.a. tplite)
– is possible
– Has always been easier than 3-tier.
2
Outline
• History: Everyone Went to 3-tier (and why)
• New news (DB + Languages + WS-*):
– Extensible DBs have arrived.
– Full blown programming environment inside
– Fewer technologies:
• DB integrated with language.
• Web service integrated with class/method.
• Fears
– DMZ and attack surface.
3
Work Distribution Spectrum
Thin
• Presentation
and plug-ins
• Workflow manages
session & invokes
objects
• Application
Objects
• Database
Fat
Presentation
workflows
App Objects
Database
Fat
4
Thin
Transaction Processing Evolution to 3 Tier
• Mainframe Batch processing
(centralized)
• Dumb terminals &
Remote Job Entry
cards
green
screen
3270
• Intelligent terminals
database backends
• Workflow Systems
Object Request Brokers
Application Generators
Mainframe
Server
TP Monitor
ORB
Active
5
PC Evolution to Three Tier
• Stand-alone PC
(centralized)
• PC + File & print server
message per I/O
• PC + Database server
message per SQL statement
• PC + App server
message per transaction
• ActiveX Client, ORB
ActiveX server, Xscript
IO request
reply
disk I/O
SQL
Statement
Transaction
6
Web Evolution to Three Tier
• Character-mode clients, smart servers
WAIS
Web
Server
archie
ghopher
green screen
• GUI Browsers - Web file servers
Mosaic
• GUI Plugins - Web dispatchers - CGI
DHTML
• Smart clients - Web dispatcher (ORB)
pools of app servers (ISAPI, Viper)
workflow scripts at client & server
AJAX
7
The Pattern:
Three Tier Computing
• Clients do presentation, gather input
Presentation
• Clients do some workflow (Xscript)
• Clients send high-level requests to ORB
workflow
• ORB dispatches workflows
• Server-side workflow scripts orchestrate
distributed App objects
App
Objects
• State stored in DB
Database
8
Why Did Everyone
Go To Three-Tier?
• Manageability
Presentatio
– App rules must be with data
– Middleware operations tools
• Performance (scalability)
– Server resources are precious
– ORB dispatches requests to server pools
– DBMS was DREADFUL at connections
• Connection pools
workflow
App
Objects
• Technology & Physics
– Put UI processing near user
– Put shared data processing near shared data
Database
9
Multiplexing
• DB client connection:
ORB
DB
– Mega-instruction set up
– Mega-byte state
• TP mon or Web Server or ORB
– Lightweight connection setup
– Multiplex many clients to few DB connections
(connection pool)
– Act as ORB (manage & dispatch server pools).
– Act as object container.
10
Complexity: Dark Side of 3-Tier
•
•
•
•
•
3 programming environments
Lots of configuration choices
Lots of interface problems
SQL, PL/SQL, T-SQL, … in DB
It isn’t simple!!
11
Outline
• History: Everyone Went to 3-tier (and why)
• New news (DB + Languages + WS-*):
– Extensible DBs have arrived.
– Full blown programming environment inside
– Fewer technologies:
• DB integrated with language.
• Web service integrated with class/method.
• Fears
– DMZ and attack surface.
12
DB Systems Get VMs
• Fewer languages
& Tools to learn
• See SQLJ or LINQ or… EJB
Network
Receiver
Queue
Connections
Context
Configuration
– programming
– debugging
A Server
Management
• DB has language VM
execution environment
• Language guys are
“embracing” DB
• Class is a web service:
Generate WSDL
• VERY simple
Security
Thread Pool
Service logic
Shared Data
13
The New World – Programs + Data
• It finally happened
– Languages have sets (lists, dictionaries, …)
– Table inherits from iEnumerable
• List <employee> E = new Employee();
• for each e in E {}
– Rows are objects
– Query answers are collections
– Supports transactions
– Push a button and you have a web service.
14
Old Data Access in API’s
SqlConnection c = new SqlConnection(…);
c.Open();
SqlCommand cmd = new SqlCommand(
@“SELECT c.Name, c.Phone
FROM Customers c
WHERE c.City = @p0”
);
cmd.Parameters[“@po”] = “London”;
DataReader dr = c.Execute(cmd);
while (dr.Read()) {
string name = r.GetString(0);
string phone = r.GetString(1);
DateTime date = r.GetDateTime(2);
}
r.Close();
Compiler cannot help
catch mistakes
Queries in quotes
Arguments
loosely bound
Results loosely
typed
15
Integrated Data Access
Classes describe data
public class Customer {
public int Id;
public string Name;
public string Phone;
…
}
Tables are real
objects
Table<Customer> customers = …;
Query is natural part
of the language
foreach(c in customers.Where(City == “London”)) {
Console.WriteLine(“Name: {0} Phone: {1}”, c.Name, c.Phone);
}
Results are strongly
typed
16
Web Services
• Now trivial to publish your data.
• Just say:
“Make this method a web service.”
• Everything else is automatic
• Performance is easy to understand
– Simplest configuration
– Simplest management
• Minimal data movement
• Fewest round trips.
17
DBs are Federating
So Now Do Connection Management
Other Data Sources
• So, it is a client for
Client
DB
multiplexing &
connection pooling
• So, now they get it,
(they finally had to write an app)
and they are doing it.
• So, DB now does multiplexing
us
– talk to peers
scaleout
– Talk to foreigners
data integration
Foreigners
• DB needs to
18
Outline
• History: Everyone Went to 3-tier (and why)
• New news (DB + Languages + WS-*):
– Extensible DBs have arrived.
– Full blown programming environment inside
– Fewer technologies:
• DB integrated with language.
• Web service integrated with class/method.
• Fears
– DMZ and attack surface.
19
Fears
• DB has large attack surface
• Web servers act as DMZ to Internet.
• Premise:
– We can lock-down the DBMS interfaces
– Only show “public” web services to outside.
20
Summary Statement
• Database system’s have changed
– Is a web service
(listens to port 80, does wsdl+soap,…)
– Hosts a programming environment
(J2EE VM or .NET CLR or… )
• So, Client-Server (a.k.a. TPlite)
– is possible
– Has always been easier than 3-tier.
– Integration of DB and Language makes it
VERY natural
21
Distributed Execution
Threads and Messages
• Thread is Execution unit
threads
(software analog of cpu+memory)
• Threads execute at a node
• Threads communicate via
– Shared memory (local)
– Messages (local and remote)
shared memory
messages
22