SlideShare une entreprise Scribd logo
1  sur  79
Télécharger pour lire hors ligne
HÖNNUN OG SMÍÐI HUGBÚNAÐAR 2015
L20 Scalability
Agenda
▪ Evolution - where are we today?
▪ Requirements of 21st century web applications
▪ Session State
▪ Distribution Strategies
▪ Scale Cube
▪ Eventual Consistency
– CAP Theorm
▪ Real World Example
Evolution
60s 70s 80s 90s 00s
IBM
Mainframes
Limited
layering or

abstraction
IBM, DEC
Mini-

computers
Unix, VAX
“Dumb”
terminals
Screens/Files
PC, Intel,
DOS, Mac, 

Unix, 

Windows

Client/Server
RMDB
Windows
Internet
HTTP
Web 

Browsers
Web

Applications
RMDB
Windows,

Linux
MacOS
Browsers,
Services
Domain

Applications
RMDB
Evolution
60s 70s 80s 90s 00s
IBM
nframes
mited
ering or

traction
IBM, DEC
Mini-

computers
Unix, VAX
“Dumb”
terminals
Screens/Files
PC, Intel,
DOS, Mac, 

Unix, 

Windows

Client/Server
RMDB
Windows
Internet
HTTP
Web 

Browsers
Web

Applications
RMDB
Windows,

Linux
MacOS
Browsers,
Services
Domain

Applications
RMDB
iOS
Android
HTML5
Browsers
Apps
API
Cloud
NoSQL
10s
Motivation
▪ Requirements of 21st century web systems
– High availability
– Millions of simultaneous users
– Peak load of 1000s tx/sec
▪ Example
– What if we need to handle load of 20.000 tx/sec?
– That’s 1.2 million tx per minute
Session State
Business Transactions
▪ Transactions that expand more than one request
– User is working with data before they are committed to the database
• Example: User logs in, puts products in a shopping cart, buys, and
logs out
– Where do we keep the state between transactions?
Login
Catalog
search
List of
results
Select
products
put into
cart
Buy
cart
State
▪ Server with state vs. stateless server
– Stateful server must keep the state between requests
▪ Problem with stateful servers
– Need more resources, limit scalability
Client 1
Client 2
Client 3
Stateful Server Stateless Server
Client 1
Client 2
Client 3
Data 1
Data 2
Data 2
Stateless Servers
▪ Stateless servers scale much better
▪ Use fewer resources
▪ Example:
– View book information
– Each request is separate
▪ REST was designed to be stateless
Stateful Servers
▪ Stateful servers are the norm
▪ Not easy to get rid of them
▪ Problem: they take resources and cause server affinity
▪ Example:
– 100 users make request every 10 second, each request takes 1
second
– One stateful object per user
– Object are Idle 90% of the time
Session State
▪ State that is relevant to a session
– State used in business transactions and belong to a specific client
– Data structure belonging to a client
– May not be consistent until they are persisted
▪ Session is distinct from record data
– Record data is a long-term persistent data in a database
– Session state might en up as record data
Question:
	 Where	do	you	store	the	session?
EXCERISE
Ways to Store Session State
▪ We have three players
– The client using a web browser or app
– The Server running the web application and domain
– The database storing all the data
Client Server Database
Ways to Store Session State
▪ Three basic choices
– Client Session State
– Server Session State
– Database Session State
Client Server Database
Client Session State
Store session state on the client
▪ How It Works
– Desktop applications can store the state in memory
– Web solutions can store state in cookies, hide it in the web page, or
use the URL
– Data Transfer Object can be used
– Session ID is the minimum client state
– Works well with REST - Representational State Transfer
Client Session State
▪ When to Use It
– Works well if server is stateless
– Maximal clustering and failover resiliency
▪ Drawbacks
– Does not work well for large amount of data
– Data gets lost if client crashes
– Security issues
Server Session State
Store session state on a server in a 

serialised form
▪ How It Works
– Session Objects – data structures on the server keyed to session Id
▪ Format of data
– Can be binary, objects or XML
▪ Where to store session
– Memory, application server, file or local or in-memory database
Server Session State
▪ Specific Implementations
– HttpSession
– Stateful Session Beans – EJB
▪ When to Use It
– Simplicity, it is easy to store and receive data
▪ Drawbacks
– Data can get lost if server goes down
– Clustering and session migration becomes difficult
– Space complexity (memory of server)
– Inactive sessions need to be cleaned up
Database Session State
Store session data as committed data in the database
▪ How It Works
– Session State stored in the database
– Can be stored as temporary data to distinguish from committed
record data
▪ Pending session data
– Pending session data might violate integrity rules
– Use of pending field or pending tables
• When pending session data becomes record data it is save in the
real tables
Database Session State
▪ When to Use It
– Improved scalability – easy to add servers
– Works well in clusters
– Data is persisted, even if data centre goes down
▪ Drawbacks
– Database becomes a bottleneck
– Need of clean up procedure of pending data that did not become
record data – user just left
What about dead sessions?
▪ Client session
– Not our problem
▪ Server session
– Web servers will send inactive message upon timeout
▪ Database session
– Need to be clean up
– Retention routines
Caching
▪ Caching is temporary data that is kept in memory between requests
for performance reasons
– Not session data
– Can be thrown away and retrieved any time
▪ Saves the round-trip to the database
▪ Can become stale or old and out-dated
– Distributed caching (message driven cache) is one way to solve that
Practical Example
▪ Client session
– For preferences, 

user selections
▪ Server session
– Used for browsing and

caching
– Logged in customer
▪ Database
– “Legal” session
– Stored, trackable, need to survive between sessions
We	are	building	an	application	for	processing	development	
grants.	The	application	is	complicated	and	users	can	login	any	
time	and	continue	work	on	their	application.	What	design	pattern	
would	we	use	for	storing	the	session?
A) Client	Session	State
B) Server	Session	State
C) Database	Session	State
D) No	state	required
QUIZ
Distribution Strategies
Distributed Architecture
▪ Distribute processing by placing objects on different nodes
Invoice
Order
Customer
Delivery
Distributed Architecture
▪ Distribute processing by placing objects on different nodes
▪ Benefits
– Load is distributed between different nodes giving overall better
performance
– It is easy to add new nodes
– Middleware products make calls between nodes transparent
But is this true?
Distributed Architecture
▪ Distribute processing by placing objects different nodes
“This design sucks like an inverted hurricane” – Fowler
Fowler’s First Law of Distributed Object Design: Don't Distribute your
objects!
Remote and Local Interfaces
▪ Local calls
– Calls between components on the same node are local
▪ Remote calls
– Calls between components on different machines are remote
▪ Objects Oriented programming
– Promotes fine-grained objects
Remote and Local Interfaces
▪ Local call within a process is very, very fast
▪ Remote call between two processes is order-of-magnitude s l o w e r
– Marshalling and un-marshalling of objects
– Data transfer over the network
▪ With fine-grained object oriented design, remote components can kill
performance
▪ Example
– Address object has get and set method for each member, city,
street, and so on
– Will result in many remote calls
Remote and Local Interfaces
▪ With distributed architectures, interfaces must be course-grained
– Minimising remote function calls
▪ Service Architecture has to have course-grained APIs and combine
several objects
– Avoid fine-grained interfaces
▪ Example
– Instead of having getters and setters for each field, bulk assessors
are used
Distributed Architecture
▪ Better distribution model (X scaling)
– Load Balancing or Clustering the application involves putting
several copies of the same application on different nodes
Order
Application
Order
Application
Order
Application
Order
Application
Where You Have to Distribute
▪ As architect, try to eliminate as many remote call as possible
– If this cannot be archived choose carefully where the distribution
boundaries lay
▪ Distribution Boundaries
– Client/Server
– Server/Database
– Web Server/Application Server
– Separation due to vendor differences
– There might be some genuine reason
Optimizing Remote Calls
▪ We know remote calls are expensive
▪ How can we minimize the cost of remote calls?
▪ The overhead is
– Marshaling or serializing data
– Network transfer
▪ Put as enough data into the call
– Course grained call
– Use binary protocols – avoid XML
How to Model Services
Term microservices is sometimes used, but is misleading
Has nothing to do with lines of code
How big is a service?
Example definition:
Balance between integration points and size
Time: Can be rewritten in one iteration (2 weeks)
Features: All things that belong together
Loose Coupling
When services are loosely coupled, a change in one
service should not require a change in another
A loosely coupled service knows as little about the
services with which it collaborates
Source: Building Microservices
High Cohesion
We want related behaviour to sit together, and unrelated
to sit elsewhere
Group together stuff the belongs together, as in SRP
If you want to change something, it should change in one
place, as in DRY
Source: Building Microservices
Bounded Context
Concept that comes from Domain-driven Design (DDD)
Any given domain contains multiple bounded contexts,
and within each are “models” or “things” (or “objects”)
that do not need to be communicated outside
that are shared with other bounded contexts
The shared objects are define the explicit interface to the
bounded context
Source: Building Microservices
Bounded Context
Source: Martin Fowler, BoundedContext
http://martinfowler.com/bliki/BoundedContext.html
The Right Balance
▪ In Service Architecture, we want to split by functionality (Y Scaling)
– Boundaries must be well designed – objects that work together are
grouped together
– APIs must be sufficiently course grained
The Scale Cube
Scaling the application
▪ Today’s web sites must handle multiple simulations users
▪ Examples:
– All web based apps must handle several users
– mbl.is handles >200.000 users/day
– Betware must handle up to 100.000 simultaneous users and 1,2
million tx/min for terminal system peak load
The World we Live in
▪ Average number of tweets per day 500 million
▪ Total number of minutes spent on Facebook each month
700 billion
▪ SnapChat has 100 million daily active users who send 1
billion snaps each day
▪ Instagram has over 200 million users on the platform
who send 60 million photos per day
▪ Number of messages sent by WhatsApp: 30 billion
Scalability
▪ Scalability is the ability of a system, network, or process to handle a
growing amount of work in a capable manner or its ability to be
enlarged to accommodate that growth
▪ With more load, how does the load of the system vary?
Scalability
▪ Scalability is the measure of how adding resource (usually hardware)
affects the performance
– Vertical scalability (up) – increase server power
– Horizontal scalability (out) – increase the servers
▪ Session migration
– Move the session for one server to another
▪ Server affinity
– Keep the session on one server and make the client always use the
same server
Scalability
▪ How is the system growth pattern – what is the formula?
Scaling Applications
In the Internet world you want to build web
sites that gets lots of users and massive
hit per second
But how can you cope with such load?
Browser
HTTP
Server
Application Database
The Scaling Problem
▪ We need to handle number of request to our system
▪ There are two ways to scale:
– Vertically or scale up:Add more capacity to your hardware, more memory
for example
– Horizontal or scale out:Add more machines
Scaling Up
▪ This is the traditional approach for many monolithic systems
▪ Use a big powerful system
▪ Pros:
– Easy to do, easy to understand
– One memory space and one database
▪ Cons:
– Has very hard limits
– Does not work for the 21st century requirements
Scaling Out (X scaling)
▪ This can work for monolithic systems if the database requirements is
not high
▪ Use a many machines and distribute the load
– Have one big powerful database
▪ Pros:
– Scales well – handles much more load
– Shared database
▪ Cons:
– Session management is a challenge
– Database is a bottleneck
Scale Cube
X scaling: duplicate the system
Z
scaling:Partition
the
data
Yscaling:PartitiontheApplication
Load Distribution
▪ Use number of machines to handle requests
▪ Load Balancer directs all

request to particular server
– All requests in one session go

to the same server
– Server affinity
▪ Benefits
– Load can be increased
– Easy to add new pairs
– Uptime is increased
▪ Drawbacks
– Database is a bootleneck
Clustering
▪ With clustering, servers

are connected together

as they were a single

computer
– Request can be handled

by any server
– Sessions are stored on

multiple servers
– Servers can be added and

removed any time
▪ Problem is with state
– State in application servers reduces scalability
– Clients become dependant on particular nodes
Clustering State
▪ Application functionality
– Handle it yourself, but this is complicated, not worth the effort
▪ Shared resources
– Well-known pattern (Database Session State)
– Problem with bottlenecks limits scalablity
▪ Clustering Middleware
– Several solutions, for example JBoss, Terracotta
▪ Clustering JVM or network
– Low levels, transparent to applications
Scalability Example
Scalability Example
Amdahl’s Law
Amdahl’s Law
▪ This law is used to find the maximum expected improvement to an
overall system when only part of the system is improved
▪ In parallel computing, it states that a small portion of the program
which cannot be parallelized will limit the overall speed-up available
from parallelization
Amdahl’s Law
▪ Amdahl’s law for overall speedup
1
Overall speedup =
F
(1 – F) +
S
F = The fraction enhanced
S = The speedup of the enhanced fraction
If we make 20% of the program be 10x faster
F=0.2
S=10
1
overall speedup =
0.2
(1 – 0.2) +
10
Gives 1.22 in overall speedup
IF S = 1000, overall speedup is 1.25
Amdahl’s Corollary
▪ Make the common case fast
– Common case being defined as “most time consuming”
40% 10x faster => 1.5625
20% 100x faster => 1.2468
The Optimization Process
▪ There is only one way to test scalability: Measure
– Find the bottleneck (the common case)
– Hypothesize about improvement
– Make optimization – change only one thing a time
– Measure again and repeat
Eventual Consistency
Transactions
▪ Transaction is a bounded sequence of work
– Both start and finish is well defined
– Transaction must complete on an all-or-nothing basis
▪ All resources are in consistent state before and after the transaction
▪ Example: Database transaction
– Withdraw data from account
– Buy the product
– Update stock information
▪ Transactions must have ACID properties
ACID properties
▪ Atomicity
– All steps are completed successfully – or rolled back
▪ Consistency
– Data is consistent at the start and the end of the transaction
▪ Isolation
– Transaction is not visible to any other until that transaction commits
successfully
▪ Durability
– Any results of a committed transaction must be made permanent
Transactional Resources
▪ Anything that is transactional
– Use transaction to control concurrency
– Databases, printers, message queues
▪ Transaction must be as short as possible
– Provides greatest throughput
– Should not span multiple requests
– Long transactions span multiple request
Transaction Isolations and Liveness
▪ Transactions lock tables (or resources)
– Need to provide isolation to guarantee correctness
– Liveness suffers
– We need to control isolation
▪ Serializable Transactions
– Full isolation
– Transactions are executed serially, one after the other
– Benefits: Guarantees correctness
– Drawbacks: Can seriously damage liveness and performance
Isolation Level
▪ Problems can be controlled by setting the isolation level
– We don’t want to lock table since it reduces performance
– Solution is to use as low isolation as possible while keeping
correctness
Problem
▪ Serialization crates scalability bottlenecks
▪ Applications that support fully secure serialization of using RMDB
have hard time with scale
▪ Can we scarify something?
– Can we relax these requirements?
CAP Theorem
▪ States that it is impossible for a distributed computer system to
simultaneously provide all three of the following guarantees:
– Consistency: all nodes see the same data at the same time
– Availability: a guarantee that every request receives a response
about whether it was successful or failed
– Partition tolerance: the system continues to operate despite
arbitrary message loss or failure of part of the system
ACID vs. BASE
▪ BASE: Basically Available, Soft state, Eventual consistency
▪ Basically Available: Guarantees availability of the database
▪ Soft state: The state of the system can change over time - even without
input.
▪ Eventual consistency: The system will eventually become consistent
over time given no new input
ACID vs. BASE
▪ The difference has more to do with synchronous and asynchronous
messaging
▪ For large scale systems asynchronous caters for the fastest and least
restricted workflow
Asynchronous
▪ Eventual Consistency example
Web	Layer	
Requests
Approve
RMDB
MsgQ
Process
Measuring Scalability
▪ The only meaningful way to know about system’s performance is to
measure it
▪ Performance Tools can help this process
– Give indication of scalability
– Identify bottlenecks
Example tool: LoadRunner
Example tool: JMeter
Summary
▪ Requirements of 21st century web applications
– Availability, Eventual consistency
▪ Session State
– Client, Server, Database
▪ Distribution Strategies
– Don’t distribute fine grained object – identify bouneries
▪ The Scale Cube
▪ Eventual Consistency
– CAP Theorm
▪ Real World Example

Contenu connexe

Tendances

Design principles of scalable, distributed systems
Design principles of scalable, distributed systemsDesign principles of scalable, distributed systems
Design principles of scalable, distributed systemsTinniam V Ganesh (TV)
 
NoSQL - Not Only SQL
NoSQL - Not Only SQLNoSQL - Not Only SQL
NoSQL - Not Only SQLEasyData
 
Handling Massive Writes
Handling Massive WritesHandling Massive Writes
Handling Massive WritesLiran Zelkha
 
Scalability, Availability & Stability Patterns
Scalability, Availability & Stability PatternsScalability, Availability & Stability Patterns
Scalability, Availability & Stability PatternsJonas Bonér
 
1049: Best and Worst Practices for Deploying IBM Connections - IBM Connect 2016
1049: Best and Worst Practices for Deploying IBM Connections - IBM Connect 20161049: Best and Worst Practices for Deploying IBM Connections - IBM Connect 2016
1049: Best and Worst Practices for Deploying IBM Connections - IBM Connect 2016panagenda
 
1693: 21 Ways to Make Your Data Work for You - IBM Connect 2016
1693: 21 Ways to Make Your Data Work for You - IBM Connect 20161693: 21 Ways to Make Your Data Work for You - IBM Connect 2016
1693: 21 Ways to Make Your Data Work for You - IBM Connect 2016panagenda
 
Managing storage on Prem and in Cloud
Managing storage on Prem and in CloudManaging storage on Prem and in Cloud
Managing storage on Prem and in CloudHoward Marks
 
HBase Operations and Best Practices
HBase Operations and Best PracticesHBase Operations and Best Practices
HBase Operations and Best PracticesVenu Anuganti
 
YOUR machine and MY database - a performing relationship!?
YOUR machine and MY database - a performing relationship!?YOUR machine and MY database - a performing relationship!?
YOUR machine and MY database - a performing relationship!?Martin Klier
 
Hadoop training institute in bangalore
Hadoop training institute in bangaloreHadoop training institute in bangalore
Hadoop training institute in bangaloreKelly Technologies
 
Nyc hadoop meetup introduction to h base
Nyc hadoop meetup   introduction to h baseNyc hadoop meetup   introduction to h base
Nyc hadoop meetup introduction to h base智杰 付
 
Database as a Service on the Oracle Database Appliance Platform
Database as a Service on the Oracle Database Appliance PlatformDatabase as a Service on the Oracle Database Appliance Platform
Database as a Service on the Oracle Database Appliance PlatformMaris Elsins
 
Building a Scalable Architecture for web apps
Building a Scalable Architecture for web appsBuilding a Scalable Architecture for web apps
Building a Scalable Architecture for web appsDirecti Group
 
Geek Sync | Successfully Migrating Existing Databases to Azure SQL Database
Geek Sync | Successfully Migrating Existing Databases to Azure SQL DatabaseGeek Sync | Successfully Migrating Existing Databases to Azure SQL Database
Geek Sync | Successfully Migrating Existing Databases to Azure SQL DatabaseIDERA Software
 
London VMUG Presentation 19th July 2012
London VMUG Presentation 19th July 2012London VMUG Presentation 19th July 2012
London VMUG Presentation 19th July 2012Chris Evans
 
Docker 101 for Oracle DBAs - Oracle OpenWorld 2017
Docker 101 for Oracle DBAs - Oracle OpenWorld 2017Docker 101 for Oracle DBAs - Oracle OpenWorld 2017
Docker 101 for Oracle DBAs - Oracle OpenWorld 2017Adeesh Fulay
 

Tendances (18)

Design principles of scalable, distributed systems
Design principles of scalable, distributed systemsDesign principles of scalable, distributed systems
Design principles of scalable, distributed systems
 
NoSQL - Not Only SQL
NoSQL - Not Only SQLNoSQL - Not Only SQL
NoSQL - Not Only SQL
 
Handling Massive Writes
Handling Massive WritesHandling Massive Writes
Handling Massive Writes
 
Scalability, Availability & Stability Patterns
Scalability, Availability & Stability PatternsScalability, Availability & Stability Patterns
Scalability, Availability & Stability Patterns
 
1049: Best and Worst Practices for Deploying IBM Connections - IBM Connect 2016
1049: Best and Worst Practices for Deploying IBM Connections - IBM Connect 20161049: Best and Worst Practices for Deploying IBM Connections - IBM Connect 2016
1049: Best and Worst Practices for Deploying IBM Connections - IBM Connect 2016
 
1693: 21 Ways to Make Your Data Work for You - IBM Connect 2016
1693: 21 Ways to Make Your Data Work for You - IBM Connect 20161693: 21 Ways to Make Your Data Work for You - IBM Connect 2016
1693: 21 Ways to Make Your Data Work for You - IBM Connect 2016
 
Managing storage on Prem and in Cloud
Managing storage on Prem and in CloudManaging storage on Prem and in Cloud
Managing storage on Prem and in Cloud
 
Apache performance
Apache performanceApache performance
Apache performance
 
HBase Operations and Best Practices
HBase Operations and Best PracticesHBase Operations and Best Practices
HBase Operations and Best Practices
 
YOUR machine and MY database - a performing relationship!?
YOUR machine and MY database - a performing relationship!?YOUR machine and MY database - a performing relationship!?
YOUR machine and MY database - a performing relationship!?
 
Scalability Design Principles - Internal Session
Scalability Design Principles - Internal SessionScalability Design Principles - Internal Session
Scalability Design Principles - Internal Session
 
Hadoop training institute in bangalore
Hadoop training institute in bangaloreHadoop training institute in bangalore
Hadoop training institute in bangalore
 
Nyc hadoop meetup introduction to h base
Nyc hadoop meetup   introduction to h baseNyc hadoop meetup   introduction to h base
Nyc hadoop meetup introduction to h base
 
Database as a Service on the Oracle Database Appliance Platform
Database as a Service on the Oracle Database Appliance PlatformDatabase as a Service on the Oracle Database Appliance Platform
Database as a Service on the Oracle Database Appliance Platform
 
Building a Scalable Architecture for web apps
Building a Scalable Architecture for web appsBuilding a Scalable Architecture for web apps
Building a Scalable Architecture for web apps
 
Geek Sync | Successfully Migrating Existing Databases to Azure SQL Database
Geek Sync | Successfully Migrating Existing Databases to Azure SQL DatabaseGeek Sync | Successfully Migrating Existing Databases to Azure SQL Database
Geek Sync | Successfully Migrating Existing Databases to Azure SQL Database
 
London VMUG Presentation 19th July 2012
London VMUG Presentation 19th July 2012London VMUG Presentation 19th July 2012
London VMUG Presentation 19th July 2012
 
Docker 101 for Oracle DBAs - Oracle OpenWorld 2017
Docker 101 for Oracle DBAs - Oracle OpenWorld 2017Docker 101 for Oracle DBAs - Oracle OpenWorld 2017
Docker 101 for Oracle DBAs - Oracle OpenWorld 2017
 

En vedette

Swedish Match Tobacco Export Portfolio
Swedish Match Tobacco Export PortfolioSwedish Match Tobacco Export Portfolio
Swedish Match Tobacco Export PortfolioEmiliano Rocha
 
Pamplet ikbn
Pamplet ikbnPamplet ikbn
Pamplet ikbnRoy Zah
 
Engage Workshop Berlin09 Part2
Engage Workshop Berlin09 Part2Engage Workshop Berlin09 Part2
Engage Workshop Berlin09 Part2Paul Pivec
 
01 introduction E-Commerce
01 introduction E-Commerce01 introduction E-Commerce
01 introduction E-CommerceNirbhay Singh
 
Simple c-programs
Simple c-programsSimple c-programs
Simple c-programsrashmi322
 
Creating an Evolving Social Technology Strategy
Creating an Evolving Social Technology StrategyCreating an Evolving Social Technology Strategy
Creating an Evolving Social Technology StrategyPerficient, Inc.
 
ELT Pedagogy (Teaching Producyive Skills)
ELT Pedagogy (Teaching Producyive Skills)ELT Pedagogy (Teaching Producyive Skills)
ELT Pedagogy (Teaching Producyive Skills)Rismi Rismi
 

En vedette (16)

Swedish Match Tobacco Export Portfolio
Swedish Match Tobacco Export PortfolioSwedish Match Tobacco Export Portfolio
Swedish Match Tobacco Export Portfolio
 
Pamplet ikbn
Pamplet ikbnPamplet ikbn
Pamplet ikbn
 
Uuuu 2014-1 efr-corp_pres(final v.2)
Uuuu 2014-1 efr-corp_pres(final v.2)Uuuu 2014-1 efr-corp_pres(final v.2)
Uuuu 2014-1 efr-corp_pres(final v.2)
 
Cmmi1.3
Cmmi1.3Cmmi1.3
Cmmi1.3
 
Engage Workshop Berlin09 Part2
Engage Workshop Berlin09 Part2Engage Workshop Berlin09 Part2
Engage Workshop Berlin09 Part2
 
01 introduction E-Commerce
01 introduction E-Commerce01 introduction E-Commerce
01 introduction E-Commerce
 
Coordenadas089 wifi
Coordenadas089 wifiCoordenadas089 wifi
Coordenadas089 wifi
 
Simple c-programs
Simple c-programsSimple c-programs
Simple c-programs
 
Creating an Evolving Social Technology Strategy
Creating an Evolving Social Technology StrategyCreating an Evolving Social Technology Strategy
Creating an Evolving Social Technology Strategy
 
Abc learning-annual-report-2006
Abc learning-annual-report-2006Abc learning-annual-report-2006
Abc learning-annual-report-2006
 
Boards part 4_review
Boards part 4_reviewBoards part 4_review
Boards part 4_review
 
Ghgfhgfh
GhgfhgfhGhgfhgfh
Ghgfhgfh
 
F28 bota5
F28 bota5F28 bota5
F28 bota5
 
ELT Pedagogy (Teaching Producyive Skills)
ELT Pedagogy (Teaching Producyive Skills)ELT Pedagogy (Teaching Producyive Skills)
ELT Pedagogy (Teaching Producyive Skills)
 
Rxpay-sepa-germany-01
Rxpay-sepa-germany-01Rxpay-sepa-germany-01
Rxpay-sepa-germany-01
 
beckys new cv xxxx
beckys new cv xxxxbeckys new cv xxxx
beckys new cv xxxx
 

Similaire à L20 Scalability

Riverbed Granite
Riverbed GraniteRiverbed Granite
Riverbed GraniteCTI Group
 
Cambridge Breakfast Seminar
Cambridge Breakfast SeminarCambridge Breakfast Seminar
Cambridge Breakfast SeminarNuoDB
 
Why a Data Services Marketplace is Critical for a Successful Data-Driven Ente...
Why a Data Services Marketplace is Critical for a Successful Data-Driven Ente...Why a Data Services Marketplace is Critical for a Successful Data-Driven Ente...
Why a Data Services Marketplace is Critical for a Successful Data-Driven Ente...Denodo
 
Infrastructure for DBAs
Infrastructure for DBAsInfrastructure for DBAs
Infrastructure for DBAsPeterShore4
 
Understanding System Design and Architecture Blueprints of Efficiency
Understanding System Design and Architecture Blueprints of EfficiencyUnderstanding System Design and Architecture Blueprints of Efficiency
Understanding System Design and Architecture Blueprints of EfficiencyKnoldus Inc.
 
Kb 40 kevin_klineukug_reading20070717[1]
Kb 40 kevin_klineukug_reading20070717[1]Kb 40 kevin_klineukug_reading20070717[1]
Kb 40 kevin_klineukug_reading20070717[1]shuwutong
 
Introduction and Basics to web technology .pptx
Introduction and Basics to web technology .pptxIntroduction and Basics to web technology .pptx
Introduction and Basics to web technology .pptxLEENASAHU42
 
Software Architecture for Cloud Infrastructure
Software Architecture for Cloud InfrastructureSoftware Architecture for Cloud Infrastructure
Software Architecture for Cloud InfrastructureTapio Rautonen
 
Caching for Microservices Architectures: Session I
Caching for Microservices Architectures: Session ICaching for Microservices Architectures: Session I
Caching for Microservices Architectures: Session IVMware Tanzu
 
Cloud Architecture Tutorial - Running in the Cloud (3of3)
Cloud Architecture Tutorial - Running in the Cloud (3of3)Cloud Architecture Tutorial - Running in the Cloud (3of3)
Cloud Architecture Tutorial - Running in the Cloud (3of3)Adrian Cockcroft
 
Beginning Of DBMS (data base)
Beginning Of DBMS (data base)Beginning Of DBMS (data base)
Beginning Of DBMS (data base)Surya Swaroop
 
HDFS_architecture.ppt
HDFS_architecture.pptHDFS_architecture.ppt
HDFS_architecture.pptvijayapraba1
 
Fast Online Access to Massive Offline Data - SECR 2016
Fast Online Access to Massive Offline Data - SECR 2016Fast Online Access to Massive Offline Data - SECR 2016
Fast Online Access to Massive Offline Data - SECR 2016Felix GV
 
C/S archtecture including basic networking
C/S archtecture including basic networkingC/S archtecture including basic networking
C/S archtecture including basic networkingabhinav2727
 
Big Data Analytics on the Cloud Oracle Applications AWS Redshift & Tableau
Big Data Analytics on the Cloud Oracle Applications AWS Redshift & TableauBig Data Analytics on the Cloud Oracle Applications AWS Redshift & Tableau
Big Data Analytics on the Cloud Oracle Applications AWS Redshift & TableauSam Palani
 
Make your first CloudStack Cloud successful
Make your first CloudStack Cloud successfulMake your first CloudStack Cloud successful
Make your first CloudStack Cloud successfulTim Mackey
 

Similaire à L20 Scalability (20)

Riverbed Granite
Riverbed GraniteRiverbed Granite
Riverbed Granite
 
L15 Organising Domain Layer
L15 Organising Domain LayerL15 Organising Domain Layer
L15 Organising Domain Layer
 
Cambridge Breakfast Seminar
Cambridge Breakfast SeminarCambridge Breakfast Seminar
Cambridge Breakfast Seminar
 
Micro service architecture
Micro service architecture  Micro service architecture
Micro service architecture
 
Why a Data Services Marketplace is Critical for a Successful Data-Driven Ente...
Why a Data Services Marketplace is Critical for a Successful Data-Driven Ente...Why a Data Services Marketplace is Critical for a Successful Data-Driven Ente...
Why a Data Services Marketplace is Critical for a Successful Data-Driven Ente...
 
Database Management System - 2a
Database Management System - 2aDatabase Management System - 2a
Database Management System - 2a
 
Infrastructure for DBAs
Infrastructure for DBAsInfrastructure for DBAs
Infrastructure for DBAs
 
Understanding System Design and Architecture Blueprints of Efficiency
Understanding System Design and Architecture Blueprints of EfficiencyUnderstanding System Design and Architecture Blueprints of Efficiency
Understanding System Design and Architecture Blueprints of Efficiency
 
Kb 40 kevin_klineukug_reading20070717[1]
Kb 40 kevin_klineukug_reading20070717[1]Kb 40 kevin_klineukug_reading20070717[1]
Kb 40 kevin_klineukug_reading20070717[1]
 
Introduction and Basics to web technology .pptx
Introduction and Basics to web technology .pptxIntroduction and Basics to web technology .pptx
Introduction and Basics to web technology .pptx
 
Software Architecture for Cloud Infrastructure
Software Architecture for Cloud InfrastructureSoftware Architecture for Cloud Infrastructure
Software Architecture for Cloud Infrastructure
 
Caching for Microservices Architectures: Session I
Caching for Microservices Architectures: Session ICaching for Microservices Architectures: Session I
Caching for Microservices Architectures: Session I
 
Cloud Architecture Tutorial - Running in the Cloud (3of3)
Cloud Architecture Tutorial - Running in the Cloud (3of3)Cloud Architecture Tutorial - Running in the Cloud (3of3)
Cloud Architecture Tutorial - Running in the Cloud (3of3)
 
Beginning Of DBMS (data base)
Beginning Of DBMS (data base)Beginning Of DBMS (data base)
Beginning Of DBMS (data base)
 
HDFS_architecture.ppt
HDFS_architecture.pptHDFS_architecture.ppt
HDFS_architecture.ppt
 
Fast Online Access to Massive Offline Data - SECR 2016
Fast Online Access to Massive Offline Data - SECR 2016Fast Online Access to Massive Offline Data - SECR 2016
Fast Online Access to Massive Offline Data - SECR 2016
 
L17 Data Source Layer
L17 Data Source LayerL17 Data Source Layer
L17 Data Source Layer
 
C/S archtecture including basic networking
C/S archtecture including basic networkingC/S archtecture including basic networking
C/S archtecture including basic networking
 
Big Data Analytics on the Cloud Oracle Applications AWS Redshift & Tableau
Big Data Analytics on the Cloud Oracle Applications AWS Redshift & TableauBig Data Analytics on the Cloud Oracle Applications AWS Redshift & Tableau
Big Data Analytics on the Cloud Oracle Applications AWS Redshift & Tableau
 
Make your first CloudStack Cloud successful
Make your first CloudStack Cloud successfulMake your first CloudStack Cloud successful
Make your first CloudStack Cloud successful
 

Plus de Ólafur Andri Ragnarsson

New Technology Summer 2020 Course Introduction
New Technology Summer 2020 Course IntroductionNew Technology Summer 2020 Course Introduction
New Technology Summer 2020 Course IntroductionÓlafur Andri Ragnarsson
 
New Technology 2019 L13 Rise of the Machine
New Technology 2019 L13 Rise of the Machine New Technology 2019 L13 Rise of the Machine
New Technology 2019 L13 Rise of the Machine Ólafur Andri Ragnarsson
 

Plus de Ólafur Andri Ragnarsson (20)

Nýsköpun - Leiðin til framfara
Nýsköpun - Leiðin til framfaraNýsköpun - Leiðin til framfara
Nýsköpun - Leiðin til framfara
 
Nýjast tækni og framtíðin
Nýjast tækni og framtíðinNýjast tækni og framtíðin
Nýjast tækni og framtíðin
 
New Technology Summer 2020 Course Introduction
New Technology Summer 2020 Course IntroductionNew Technology Summer 2020 Course Introduction
New Technology Summer 2020 Course Introduction
 
L01 Introduction
L01 IntroductionL01 Introduction
L01 Introduction
 
L23 Robotics and Drones
L23 Robotics and Drones L23 Robotics and Drones
L23 Robotics and Drones
 
L22 Augmented and Virtual Reality
L22 Augmented and Virtual RealityL22 Augmented and Virtual Reality
L22 Augmented and Virtual Reality
 
L20 Personalised World
L20 Personalised WorldL20 Personalised World
L20 Personalised World
 
L19 Network Platforms
L19 Network PlatformsL19 Network Platforms
L19 Network Platforms
 
L18 Big Data and Analytics
L18 Big Data and AnalyticsL18 Big Data and Analytics
L18 Big Data and Analytics
 
L17 Algorithms and AI
L17 Algorithms and AIL17 Algorithms and AI
L17 Algorithms and AI
 
L16 Internet of Things
L16 Internet of ThingsL16 Internet of Things
L16 Internet of Things
 
L14 From the Internet to Blockchain
L14 From the Internet to BlockchainL14 From the Internet to Blockchain
L14 From the Internet to Blockchain
 
L14 The Mobile Revolution
L14 The Mobile RevolutionL14 The Mobile Revolution
L14 The Mobile Revolution
 
New Technology 2019 L13 Rise of the Machine
New Technology 2019 L13 Rise of the Machine New Technology 2019 L13 Rise of the Machine
New Technology 2019 L13 Rise of the Machine
 
L12 digital transformation
L12 digital transformationL12 digital transformation
L12 digital transformation
 
L10 The Innovator's Dilemma
L10 The Innovator's DilemmaL10 The Innovator's Dilemma
L10 The Innovator's Dilemma
 
L09 Disruptive Technology
L09 Disruptive TechnologyL09 Disruptive Technology
L09 Disruptive Technology
 
L09 Technological Revolutions
L09 Technological RevolutionsL09 Technological Revolutions
L09 Technological Revolutions
 
L07 Becoming Invisible
L07 Becoming InvisibleL07 Becoming Invisible
L07 Becoming Invisible
 
L06 Diffusion of Innovation
L06 Diffusion of InnovationL06 Diffusion of Innovation
L06 Diffusion of Innovation
 

Dernier

presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...apidays
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024The Digital Insurer
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024The Digital Insurer
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 

Dernier (20)

presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 

L20 Scalability

  • 1. HÖNNUN OG SMÍÐI HUGBÚNAÐAR 2015 L20 Scalability
  • 2. Agenda ▪ Evolution - where are we today? ▪ Requirements of 21st century web applications ▪ Session State ▪ Distribution Strategies ▪ Scale Cube ▪ Eventual Consistency – CAP Theorm ▪ Real World Example
  • 3. Evolution 60s 70s 80s 90s 00s IBM Mainframes Limited layering or
 abstraction IBM, DEC Mini-
 computers Unix, VAX “Dumb” terminals Screens/Files PC, Intel, DOS, Mac, 
 Unix, 
 Windows
 Client/Server RMDB Windows Internet HTTP Web 
 Browsers Web
 Applications RMDB Windows,
 Linux MacOS Browsers, Services Domain
 Applications RMDB
  • 4. Evolution 60s 70s 80s 90s 00s IBM nframes mited ering or
 traction IBM, DEC Mini-
 computers Unix, VAX “Dumb” terminals Screens/Files PC, Intel, DOS, Mac, 
 Unix, 
 Windows
 Client/Server RMDB Windows Internet HTTP Web 
 Browsers Web
 Applications RMDB Windows,
 Linux MacOS Browsers, Services Domain
 Applications RMDB iOS Android HTML5 Browsers Apps API Cloud NoSQL 10s
  • 5. Motivation ▪ Requirements of 21st century web systems – High availability – Millions of simultaneous users – Peak load of 1000s tx/sec ▪ Example – What if we need to handle load of 20.000 tx/sec? – That’s 1.2 million tx per minute
  • 7. Business Transactions ▪ Transactions that expand more than one request – User is working with data before they are committed to the database • Example: User logs in, puts products in a shopping cart, buys, and logs out – Where do we keep the state between transactions? Login Catalog search List of results Select products put into cart Buy cart
  • 8. State ▪ Server with state vs. stateless server – Stateful server must keep the state between requests ▪ Problem with stateful servers – Need more resources, limit scalability Client 1 Client 2 Client 3 Stateful Server Stateless Server Client 1 Client 2 Client 3 Data 1 Data 2 Data 2
  • 9. Stateless Servers ▪ Stateless servers scale much better ▪ Use fewer resources ▪ Example: – View book information – Each request is separate ▪ REST was designed to be stateless
  • 10. Stateful Servers ▪ Stateful servers are the norm ▪ Not easy to get rid of them ▪ Problem: they take resources and cause server affinity ▪ Example: – 100 users make request every 10 second, each request takes 1 second – One stateful object per user – Object are Idle 90% of the time
  • 11. Session State ▪ State that is relevant to a session – State used in business transactions and belong to a specific client – Data structure belonging to a client – May not be consistent until they are persisted ▪ Session is distinct from record data – Record data is a long-term persistent data in a database – Session state might en up as record data
  • 13. Ways to Store Session State ▪ We have three players – The client using a web browser or app – The Server running the web application and domain – The database storing all the data Client Server Database
  • 14. Ways to Store Session State ▪ Three basic choices – Client Session State – Server Session State – Database Session State Client Server Database
  • 15. Client Session State Store session state on the client ▪ How It Works – Desktop applications can store the state in memory – Web solutions can store state in cookies, hide it in the web page, or use the URL – Data Transfer Object can be used – Session ID is the minimum client state – Works well with REST - Representational State Transfer
  • 16. Client Session State ▪ When to Use It – Works well if server is stateless – Maximal clustering and failover resiliency ▪ Drawbacks – Does not work well for large amount of data – Data gets lost if client crashes – Security issues
  • 17. Server Session State Store session state on a server in a 
 serialised form ▪ How It Works – Session Objects – data structures on the server keyed to session Id ▪ Format of data – Can be binary, objects or XML ▪ Where to store session – Memory, application server, file or local or in-memory database
  • 18. Server Session State ▪ Specific Implementations – HttpSession – Stateful Session Beans – EJB ▪ When to Use It – Simplicity, it is easy to store and receive data ▪ Drawbacks – Data can get lost if server goes down – Clustering and session migration becomes difficult – Space complexity (memory of server) – Inactive sessions need to be cleaned up
  • 19. Database Session State Store session data as committed data in the database ▪ How It Works – Session State stored in the database – Can be stored as temporary data to distinguish from committed record data ▪ Pending session data – Pending session data might violate integrity rules – Use of pending field or pending tables • When pending session data becomes record data it is save in the real tables
  • 20. Database Session State ▪ When to Use It – Improved scalability – easy to add servers – Works well in clusters – Data is persisted, even if data centre goes down ▪ Drawbacks – Database becomes a bottleneck – Need of clean up procedure of pending data that did not become record data – user just left
  • 21. What about dead sessions? ▪ Client session – Not our problem ▪ Server session – Web servers will send inactive message upon timeout ▪ Database session – Need to be clean up – Retention routines
  • 22. Caching ▪ Caching is temporary data that is kept in memory between requests for performance reasons – Not session data – Can be thrown away and retrieved any time ▪ Saves the round-trip to the database ▪ Can become stale or old and out-dated – Distributed caching (message driven cache) is one way to solve that
  • 23. Practical Example ▪ Client session – For preferences, 
 user selections ▪ Server session – Used for browsing and
 caching – Logged in customer ▪ Database – “Legal” session – Stored, trackable, need to survive between sessions
  • 26. Distributed Architecture ▪ Distribute processing by placing objects on different nodes Invoice Order Customer Delivery
  • 27. Distributed Architecture ▪ Distribute processing by placing objects on different nodes ▪ Benefits – Load is distributed between different nodes giving overall better performance – It is easy to add new nodes – Middleware products make calls between nodes transparent But is this true?
  • 28. Distributed Architecture ▪ Distribute processing by placing objects different nodes “This design sucks like an inverted hurricane” – Fowler Fowler’s First Law of Distributed Object Design: Don't Distribute your objects!
  • 29. Remote and Local Interfaces ▪ Local calls – Calls between components on the same node are local ▪ Remote calls – Calls between components on different machines are remote ▪ Objects Oriented programming – Promotes fine-grained objects
  • 30. Remote and Local Interfaces ▪ Local call within a process is very, very fast ▪ Remote call between two processes is order-of-magnitude s l o w e r – Marshalling and un-marshalling of objects – Data transfer over the network ▪ With fine-grained object oriented design, remote components can kill performance ▪ Example – Address object has get and set method for each member, city, street, and so on – Will result in many remote calls
  • 31. Remote and Local Interfaces ▪ With distributed architectures, interfaces must be course-grained – Minimising remote function calls ▪ Service Architecture has to have course-grained APIs and combine several objects – Avoid fine-grained interfaces ▪ Example – Instead of having getters and setters for each field, bulk assessors are used
  • 32. Distributed Architecture ▪ Better distribution model (X scaling) – Load Balancing or Clustering the application involves putting several copies of the same application on different nodes Order Application Order Application Order Application Order Application
  • 33. Where You Have to Distribute ▪ As architect, try to eliminate as many remote call as possible – If this cannot be archived choose carefully where the distribution boundaries lay ▪ Distribution Boundaries – Client/Server – Server/Database – Web Server/Application Server – Separation due to vendor differences – There might be some genuine reason
  • 34. Optimizing Remote Calls ▪ We know remote calls are expensive ▪ How can we minimize the cost of remote calls? ▪ The overhead is – Marshaling or serializing data – Network transfer ▪ Put as enough data into the call – Course grained call – Use binary protocols – avoid XML
  • 35. How to Model Services
  • 36. Term microservices is sometimes used, but is misleading Has nothing to do with lines of code How big is a service? Example definition: Balance between integration points and size Time: Can be rewritten in one iteration (2 weeks) Features: All things that belong together
  • 37. Loose Coupling When services are loosely coupled, a change in one service should not require a change in another A loosely coupled service knows as little about the services with which it collaborates Source: Building Microservices
  • 38. High Cohesion We want related behaviour to sit together, and unrelated to sit elsewhere Group together stuff the belongs together, as in SRP If you want to change something, it should change in one place, as in DRY Source: Building Microservices
  • 39. Bounded Context Concept that comes from Domain-driven Design (DDD) Any given domain contains multiple bounded contexts, and within each are “models” or “things” (or “objects”) that do not need to be communicated outside that are shared with other bounded contexts The shared objects are define the explicit interface to the bounded context Source: Building Microservices
  • 40. Bounded Context Source: Martin Fowler, BoundedContext http://martinfowler.com/bliki/BoundedContext.html
  • 41. The Right Balance ▪ In Service Architecture, we want to split by functionality (Y Scaling) – Boundaries must be well designed – objects that work together are grouped together – APIs must be sufficiently course grained
  • 43. Scaling the application ▪ Today’s web sites must handle multiple simulations users ▪ Examples: – All web based apps must handle several users – mbl.is handles >200.000 users/day – Betware must handle up to 100.000 simultaneous users and 1,2 million tx/min for terminal system peak load
  • 44.
  • 45. The World we Live in ▪ Average number of tweets per day 500 million ▪ Total number of minutes spent on Facebook each month 700 billion ▪ SnapChat has 100 million daily active users who send 1 billion snaps each day ▪ Instagram has over 200 million users on the platform who send 60 million photos per day ▪ Number of messages sent by WhatsApp: 30 billion
  • 46. Scalability ▪ Scalability is the ability of a system, network, or process to handle a growing amount of work in a capable manner or its ability to be enlarged to accommodate that growth ▪ With more load, how does the load of the system vary?
  • 47. Scalability ▪ Scalability is the measure of how adding resource (usually hardware) affects the performance – Vertical scalability (up) – increase server power – Horizontal scalability (out) – increase the servers ▪ Session migration – Move the session for one server to another ▪ Server affinity – Keep the session on one server and make the client always use the same server
  • 48. Scalability ▪ How is the system growth pattern – what is the formula?
  • 49. Scaling Applications In the Internet world you want to build web sites that gets lots of users and massive hit per second But how can you cope with such load? Browser HTTP Server Application Database
  • 50. The Scaling Problem ▪ We need to handle number of request to our system ▪ There are two ways to scale: – Vertically or scale up:Add more capacity to your hardware, more memory for example – Horizontal or scale out:Add more machines
  • 51. Scaling Up ▪ This is the traditional approach for many monolithic systems ▪ Use a big powerful system ▪ Pros: – Easy to do, easy to understand – One memory space and one database ▪ Cons: – Has very hard limits – Does not work for the 21st century requirements
  • 52. Scaling Out (X scaling) ▪ This can work for monolithic systems if the database requirements is not high ▪ Use a many machines and distribute the load – Have one big powerful database ▪ Pros: – Scales well – handles much more load – Shared database ▪ Cons: – Session management is a challenge – Database is a bottleneck
  • 53. Scale Cube X scaling: duplicate the system Z scaling:Partition the data Yscaling:PartitiontheApplication
  • 54. Load Distribution ▪ Use number of machines to handle requests ▪ Load Balancer directs all
 request to particular server – All requests in one session go
 to the same server – Server affinity ▪ Benefits – Load can be increased – Easy to add new pairs – Uptime is increased ▪ Drawbacks – Database is a bootleneck
  • 55. Clustering ▪ With clustering, servers
 are connected together
 as they were a single
 computer – Request can be handled
 by any server – Sessions are stored on
 multiple servers – Servers can be added and
 removed any time ▪ Problem is with state – State in application servers reduces scalability – Clients become dependant on particular nodes
  • 56. Clustering State ▪ Application functionality – Handle it yourself, but this is complicated, not worth the effort ▪ Shared resources – Well-known pattern (Database Session State) – Problem with bottlenecks limits scalablity ▪ Clustering Middleware – Several solutions, for example JBoss, Terracotta ▪ Clustering JVM or network – Low levels, transparent to applications
  • 60. Amdahl’s Law ▪ This law is used to find the maximum expected improvement to an overall system when only part of the system is improved ▪ In parallel computing, it states that a small portion of the program which cannot be parallelized will limit the overall speed-up available from parallelization
  • 61. Amdahl’s Law ▪ Amdahl’s law for overall speedup 1 Overall speedup = F (1 – F) + S F = The fraction enhanced S = The speedup of the enhanced fraction If we make 20% of the program be 10x faster F=0.2 S=10 1 overall speedup = 0.2 (1 – 0.2) + 10 Gives 1.22 in overall speedup IF S = 1000, overall speedup is 1.25
  • 62. Amdahl’s Corollary ▪ Make the common case fast – Common case being defined as “most time consuming” 40% 10x faster => 1.5625 20% 100x faster => 1.2468
  • 63. The Optimization Process ▪ There is only one way to test scalability: Measure – Find the bottleneck (the common case) – Hypothesize about improvement – Make optimization – change only one thing a time – Measure again and repeat
  • 65. Transactions ▪ Transaction is a bounded sequence of work – Both start and finish is well defined – Transaction must complete on an all-or-nothing basis ▪ All resources are in consistent state before and after the transaction ▪ Example: Database transaction – Withdraw data from account – Buy the product – Update stock information ▪ Transactions must have ACID properties
  • 66. ACID properties ▪ Atomicity – All steps are completed successfully – or rolled back ▪ Consistency – Data is consistent at the start and the end of the transaction ▪ Isolation – Transaction is not visible to any other until that transaction commits successfully ▪ Durability – Any results of a committed transaction must be made permanent
  • 67. Transactional Resources ▪ Anything that is transactional – Use transaction to control concurrency – Databases, printers, message queues ▪ Transaction must be as short as possible – Provides greatest throughput – Should not span multiple requests – Long transactions span multiple request
  • 68. Transaction Isolations and Liveness ▪ Transactions lock tables (or resources) – Need to provide isolation to guarantee correctness – Liveness suffers – We need to control isolation ▪ Serializable Transactions – Full isolation – Transactions are executed serially, one after the other – Benefits: Guarantees correctness – Drawbacks: Can seriously damage liveness and performance
  • 69. Isolation Level ▪ Problems can be controlled by setting the isolation level – We don’t want to lock table since it reduces performance – Solution is to use as low isolation as possible while keeping correctness
  • 70. Problem ▪ Serialization crates scalability bottlenecks ▪ Applications that support fully secure serialization of using RMDB have hard time with scale ▪ Can we scarify something? – Can we relax these requirements?
  • 71. CAP Theorem ▪ States that it is impossible for a distributed computer system to simultaneously provide all three of the following guarantees: – Consistency: all nodes see the same data at the same time – Availability: a guarantee that every request receives a response about whether it was successful or failed – Partition tolerance: the system continues to operate despite arbitrary message loss or failure of part of the system
  • 72.
  • 73. ACID vs. BASE ▪ BASE: Basically Available, Soft state, Eventual consistency ▪ Basically Available: Guarantees availability of the database ▪ Soft state: The state of the system can change over time - even without input. ▪ Eventual consistency: The system will eventually become consistent over time given no new input
  • 74. ACID vs. BASE ▪ The difference has more to do with synchronous and asynchronous messaging ▪ For large scale systems asynchronous caters for the fastest and least restricted workflow
  • 75. Asynchronous ▪ Eventual Consistency example Web Layer Requests Approve RMDB MsgQ Process
  • 76. Measuring Scalability ▪ The only meaningful way to know about system’s performance is to measure it ▪ Performance Tools can help this process – Give indication of scalability – Identify bottlenecks
  • 79. Summary ▪ Requirements of 21st century web applications – Availability, Eventual consistency ▪ Session State – Client, Server, Database ▪ Distribution Strategies – Don’t distribute fine grained object – identify bouneries ▪ The Scale Cube ▪ Eventual Consistency – CAP Theorm ▪ Real World Example