SAPs Client Server Architecture
SAPs Client Server Architecture
Donald Kossmann
Outline
1. SAP's Client-server Architecture
2. Overview of the SAP Schema
3. Transaction Processing
4. Benchmarks and Results
...
presentation servers: control GUI
LAN or WAN
application servers: carry out ABAP
appl. appl. programs and DynPros
server ... server
LAN RDBMS: stores all the data (including
ABAP programs, DynPros, data dic-
RDBMS tionary, etc.)
3
Advantages of Three-Tier Architectures
1. Scalability. Add machines in middle tier to support more users
2. Portability. It is possible to use dierent platforms at all levels.
3. Interoperability and openness. Middleware serves as
platform to integrate and interact with third-party products.
4. Nice GUIs. Presentation servers can interact with Microsoft
Word, Excel, etc.
4
Integrating WWW Services
Transaction
Server
Internet
Server
server
Web
appl.
Internet
RDBMS
LAN
LAN
server. . .
Internet
local clients
clients
appl.
5
SAP R/3 Congurations
tiny: 1 user
all three layers on one machine
one of the SAP founder's golf club is run by R/3 on a laptop
small: about 10 users
PCs for presentation
application and database server on one (mid-range) machine
Ethernet
7
8
Supported Platforms
Presentation Layer
Windows 3.1, Windows 95, Windows NT
Java
OSF/Motif
OS/2
Macintosh
in the long run, only Windows and Java
sensors) are also very common
SOLARIS
usually, installations have separate machines for tests
Windows NT
OS/100 (for IBM AS/400)
ISDN, DATEX-P, and special links to technical subsystems (e.g.,
9
DB2 Common Server, DB2 for AS/400,
Communication Protocols
Database Systems
UNIX platforms
Informix Online
MS SQL Server
installations)
IBM AS/400
IBM S/390
TCP/IP
Hardware
Oracle
10
Overview of the SAP Schema
R/3 has more than 10,000 pre-dened tables (Version 3.x)
{ tables for data such as customers, orders, etc.
{ tables for statistics (monitoring the system)
{ tables for authorization
{ ...
{ comprehensive, generic schema for any kind of conceivable
business rather than greatest common denominator
fully normalized, (almost) no redundancy
{ good for OLTP
{ bad for OLAP (as we will see)
users can also dene their own tables
11
three dierent kinds of SAP tables
transparent: mapped 1:1 to RDBMS tables
12
Examples
1. All comments and descriptions need to be stored in separate
tables in order to keep information in dierent languages:
part(id, . . . )
part(id, . . . , comment) ) comment(partid, language, comment)
N.B.: Actually, SAP tables come with names such as KONV, STXL,
VBAP, VBEP, etc. Keys span several attributes (including business
unit, etc.)
13
2. Generic way of dealing with pricing terms (customizable):
lineitem(id, . . . , pricing term id )
lineitem(id, . . . , tax, discount) ) pricing terms(id, condition, amount)
tax and discount are stored in two dierent tuples
(additional pricing terms stored in additional tuples)
to allow quick access, pricing term tuples that belong to the
same lineitem are clustered together (i.e., pricing terms is a
cluster table)
14
Schema: Observations
SAP databases tend to be very large (due to genericity)
Schema is the heart of SAP, but still under constant revision
{ a couple of thousand new tables with every new major release
{ a great deal of reorganization work with every upgrade
15
SAP's Transaction Concept
SAP uses the term Logical Unit of Work (LUW) for transaction.
Basically, an SAP LUW has the same ACID properties as SQL
and any (SQL) database system:
{ an SAP LUW can span several dialog steps
{ an SAP LUW is either executed completely or not at all (i.e.,
atomicity)
{ ...
{ nested transactions are also possible
16
Overview of Implementation
SAP LUWs are NOT mapped 1:1 to database transactions
SAP implemented its own locking
(centralized enqueue service )
basically, SAP also implemented its own TP monitor
(message handler and queues in every application server)
online transactions and batch (overnight) queries possible
(for comparison: PeopleSoft uses third-party TP monitors such
as Tuxedo)
17
Processing Dialog Steps
1. when a user logs in, a message handler
Application Server nds the application server with the
smallest load (load balancing)
2. this application server handles all of the
requests of that user session
Dispatcher
3. a user session consists of several
Queue transactions, and every transaction consists
of several dialog steps
Work ... Work 4. every application server has one dispatcher
Process Process process and several work processes
5. the dispatcher queues requests until a work
private
buffers
private
buffers
process is available
6. a work process carries out a dialog step;
Shared Memory Buffers
rolls in relevant data and interprets
DynPro and ABAP programs
7. so, every user session is handled by a single
application server, but every dialog step is
handled by dierent work processes
8. exception: transactions that involve large
objects have exclusive work processes to
19 18 avoid cost of rolling data in and out
lock requests lock release
P1 P2 P3 P4
posting steps
D1 D2 D3
dialog steps
log records for updates are generated as part of every dialog step
log records are propagated to RDBMS in posting phase
locks are requested during online phase and released after the
posting phase is complete (2-phase locking)
like dialog steps, posting steps are handled by dierent work
processes (potentially in parallel)
20
21
Overview
SAP's application servers cache ABAP programs, constraints,
and operational data in order to reduce the load of the RDBMS.
more than 90% cache hits are not unusual for SAP applications
ABAP programs and constraints are always cached.
Administrator decides which data to cache and in which way to
cache it:
{ data that is frequently updated should not be cached at all
{ huge data that is likely to
ood the cache should not be
cached either
{ default settings for pre-dened tables help
22
Caching Examples
REGION table is a classic candidate for caching
LINEITEM table is a classic candidate for NOT caching
23
Application servers can cache data three dierent granularities
(set by default or system administrator for every table):
1. complete caching of a table
cache can be used for any query on that table
need much cache space, high cost to propagate updates
2. tuple-wise caching
cache only used for select single statements
ne-grained: i.e., good cache utilization, low cost in the
presence of updates
3. generic caching (a compromise)
cache all tuples of a table with the same value of a prex of
the primary key
e.g., cache all tuples that belong to the same business unit
24
25
again, SAP implements its own authorization model and does
not use the standard (SQL) model supported by the RDBMS
users must log in with their user-id and password (identication)
ne-grained and
exible authorization concept
{ individual elds of tables
{ specic transactions and/or reports
{ views
bundling of authorizations
{ authorization object (set of related authorizations)
{ authorization prole (set of authorization objects; roles)
{ group prole (set of authorization proles)
users belong to groups and inherit group authorizations
26
Security
activity logs
encryption of all messages exchanged between RDBMS and
application servers
Kerberos and SecuDE for secure clients at the presentation layer
secure transport system for batch input and migration of
databases
only the administrator has direct access to the database and le
system; everybody else must use the interfaces of the presentation
layer or other external services in order to work with the system
27
SAP monitors the following parameters
{ queue lengths in dispatcher
{ cache hit ratio
{ database operations (scans, sorts, joins)
{ ABAP operations (sorts, etc.)
{ number of commits and rollbacks
{ CPU, disk, memory, network utilization
{ response time of dialog steps, work processes, database calls
alerters inform administrators if problems occur
performance statistics are stored in the database
EarlyWatch service | (Big Brother is Watching You)
28
29
The SD Benchmark
(Sales and Distribution)
30
SD Benchmark Script
1. create an order with ve line items
2. create a delivery for this order
3. display the customer order
4. change the delivery and post goods issue
5. list forty orders
6. create an invoice
15 dialog steps; 4 posting steps; 150 secs think time
31
SUN Beaverton, CA, USA on March 11, 1997:
Number of benchmark users: 1,410 SD
Average dialog response time: 1.85 seconds
Throughput: 7,133 SAPS (428,000 dialog steps/h)
Equivalent to: 143,000 processed order line items per hour
Average DB request time: 0.397 secs (dialog), 0.397 secs (update)
CPU utilization: 94%
Operating System: Solaris 2.5.1
RDBMS: Informix Online Server 7.21 UC1
R/3 Release: 3.0E (with 3.0F kernel)
Total disk space: 350 GB
1 Central Server: 64-way UltraSparc II CPU's 250 MHz, 14 GB main
memory, 1 MB level 2 cache; 15 dialog/update instances, 1
message/enqueue instance
Certication Number: 1997007
32
500000
Transactions per hour
400000
300000
200000
100000
0
1993 1994 1995 1996 1997 1998
Year
33
R. Buck-Emden and J. Galimow: SAP R/3 System { A
Client/Server Technology. Addison-Wesley, 1996.
J. Doppelhammer, T. Hoppler, A. Kemper, and D. Kossmann:
Database Performance in the Real World { TPC-D and SAP
R/3. ACM SIGMOD, 1997.
B. Lober and U. Marquard: R/3 System Standard Application
Benchmarks.
http://www.sap-ag.de/products/techno/index.htm
Outline
Query interfaces of SAP R/3
Decision Support Queries on SAP R/3
SAP Data Warehouse Products
35
all business data is entered via OLTP-applications into SAP R/3
SAP has its own predened schema
SAP R/3 is used to ask queries, e.g.:
{ for nding particular information as part of OLTP processing:
what happened to a particular order issued by customer
'Smith' in March 1998
{ for generating business reports for decision support:
how did our new line of products sell in dierent regions over
the last six months
SAP R/3 has many predened business reports that can be
invoked \by the click of the mouse"
SAP R/3 also allows to \program" customized queries/reports
36
data - database
dictionary interface
local buers
6
? ?
relational database system
(back-end server)
37
Open SQL
SQL-92 style syntax (some limitations!)
built-in operators, such as SORT
materialize temporary results
caching of query results
cursor caching to optimize repeated database access
in recent versions SAP has signicantly improved the database
interface
before Version 3.0 it was not possible to \push" a join to the
database server; it had to be implemented as nested SFW's
within the ABAP-processor (i.e., within the application server).
38
SF*200k SF*800k SF*6000k SF*1500k
PARTKEY PARTKEY ORDERKEY ORDERKEY
41
8 tables in the TPC-D schema versus 17 tables in SAP R/3
SAP Table Description Orig. TPC-D Tab.
T005 Country: general info NATION
T005T Country: Names NATION
T005U Regions REGION
MARA Parts: general info PART
MAKT Parts: description PART
A004 Parts: terms PART
KONP Terms: positions PART
LFA1 Supplier: general info SUPPLIER
EINA Part-Supplier: general info PARTSUPP
EINE Part-Supplier: terms PARTSUPP
AUSP properties PART, SUPP, P.-S.
KNA1 Customer: general info CUSTOMER
VBAK Order: general info ORDER
VBAP Lineitem: position LINEITEM
VBEP Lineitem: terms LINEITEM
KONV Pricing Terms LINEITEM
STXL Text of comments all
42
46
48
49
limitations in query processing
{ only 8 of the 17 TPC-D queries could be expressed in SAP
EIS
the performance of these eight queries improved by a factor of
two as compared to the Open SQL reports
high loading time: about 50 hrs to load the TPC-D database
with SF=0.2 from R/3 into EIS
{ even though, EIS was part of the same R/3 system
merely extracting the TPC-D database from SAP R/3 into
ASCII les takes 6 hours
50
Web
52
BAPI
BIW Server
OLAP Processor
BAPI
54
InfoCubes
Update Rules
Communication Structure
Statistics
GUI-based
sophisticated scheduler
56
Product Customer
Sales
Outlet Time
one normalized fact table
several dimension tables
{ possibly non-normalized to model hierarchical characteristics
{ e.g., customers' city! county! country! region
57
(Handy) Sales by Brand/Year/Country
Brand
00
195
0
all 450
2300
0
300
Nokia 600
0
350 Country
Bosch 500 0
850
0
Motorola 400 270 all
0
240 CH
Siemens 800 1200 1400 3400 34 0 0 Aus
D
Year
1995 1996 1997 all
58
59
slice and dice
drill down/roll up
Region
er
stom
Cu
Region
Product Group
er
stom
Cu
Product Group
Region
er
st om
60 Cu
Product Group
61
Performance
no benchmark results yet
dedicated server
{ separate from OLTP server
{ can be congured as a three-tier client server conguration
(like SAP R/3)
InfoCube summary levels: precomputed aggregations
persistent report cache
batch reports
62
Literature
Jochen Doppelhammer, Thomas Hoppler, Alfons Kemper,
Donald Kossmann: Database Performance in the Real World -
TPC-D and SAP R/3 (Experience Paper). SIGMOD Conference
1997: 123-134
http://www.db.fmi.uni-passau.de/projects/SAP/
63