No More Hops Towards A Linearly Scalable Application Infrastructure

24
No More Hops: Towards a linearly scalable application infrastructure. Owen Taylor Blog: http://www.jroller.com/ owentaylor

Transcript of No More Hops Towards A Linearly Scalable Application Infrastructure

Page 1: No More Hops Towards A Linearly Scalable Application Infrastructure

No More Hops:

Towards a linearly scalable application infrastructure.

Owen Taylor

Blog:

http://www.jroller.com/owentaylor

Page 2: No More Hops Towards A Linearly Scalable Application Infrastructure

About me. . .

• ORBs

• Containers

• Frustration

• “The Final Frontier”

Page 3: No More Hops Towards A Linearly Scalable Application Infrastructure

Technical Target: Linear Scalability

• Process increasing volume of information

– Scale out to get more processing power when volume increases

• Shorter time– Mostly through parallelizing of

transactions

• Lower cost– Pooling low commodity resources

Total TPS = X*N

X TPS

X TPS

X TPS

X TPS

Processing unit 1

Processing unit 2

Processing unit 3

Processing unit N

Incoming Transactions

Page 4: No More Hops Towards A Linearly Scalable Application Infrastructure

4

Database-Based Architectures: scaling bottlenecks

Data – I/O overhead, Contention

Messaging – Complex workflows increase latencies

Processing – CPU, ParallelizationSilo approach,

each tier has its own

clustering model, lots of moving parts

Page 5: No More Hops Towards A Linearly Scalable Application Infrastructure

6

Services can be Java, C++, .Net

Content-Based Routing

Typical SOA model based on ESB

Most ESB solutions do not address stateful services and

often use a centralized database to share state

between services

Page 6: No More Hops Towards A Linearly Scalable Application Infrastructure

Pinpoint ‘That method call...’ [what about the app?]

Presentation Logic

Business Logic

Integration Logic

Data Tier

Messaging Tier

Client Tier

If we just add a caching layer to the system...

Page 7: No More Hops Towards A Linearly Scalable Application Infrastructure

TPC: Transparent Partitioning & Colocation

• The next wave of applications will scale in this manner– Because Gartner says so

• Many already scale one or two tiers in this way– Partitioned Databases with Triggers

– Content-Based Routing though Messaging with coupled consumers

– All-in one web applications using caching (IMDG)

• Space-Based Architecture offers an implementation of TPC using Spaces– GigaSpaces enables this architecture for .NET, C++, and Java

Page 8: No More Hops Towards A Linearly Scalable Application Infrastructure

Space-Based Architecture is an Implementation of TPC

• Utilizing a single logical/virtual resource to share: – Data

– Logic

– Events

• Services: – Interact with each other through the space

– Can be co-located with data/events for faster results

– Are deployed and managed in an adaptive and fail-safe way

} Objects!

Data Provisioning

Event Propagation

Logic Processing

Page 9: No More Hops Towards A Linearly Scalable Application Infrastructure

Parallel Processing: Divide and Scale out

Request FeedProxy

Request

Request

Request

Proxy

Proxy

Proxy

Write

Write

Write

Service1

Service2

Service3

Partitioned Spaces

Request: Zoom-in

update stocks where …

Proxy

Virtual Table

Page 10: No More Hops Towards A Linearly Scalable Application Infrastructure

Colocation: Dramatically Reduce Latency

Request FeedProxy

Request

Requests

Request

Proxy

Write

Write

Write

Partitioned Spaces

Request: Zoom-in

Proxy

Virtual Table

update stocks where …

Page 11: No More Hops Towards A Linearly Scalable Application Infrastructure

Client Registration

Offer Driver

Execution Engine

Write

Notify

Register

Matching Engine

Update

Average Latency ~14 milliseconds

(+ ~2 milliseconds for backup)

Example: Algorithmic Trading

Page 12: No More Hops Towards A Linearly Scalable Application Infrastructure

Reduced Latency Due To Colocation

Offer Driver

Execution Engine

Write

Notify

Matching Engine

Average Latency ~600 microseconds

(+ ~2 milliseconds for backup)

Client Registration

Register

Update

Write [TradingStrategy]

Page 13: No More Hops Towards A Linearly Scalable Application Infrastructure

RTDtopic

GSC 1

Embedded Space

Processing Unit 1

StockConverter

Spring Bean

GSC 2

Embedded Space

Processing Unit 2

GSC 3

Embedded Space

Processing Unit 3

One Logical Space

(Partitioned)

GSC 4

SpaceProxy

Processing Unit 4

MarketFeed

Spring Bean

[Demo] Excel With a Grid Backbone:

StockConverter

Spring Bean

StockConverter

Spring Bean

Page 14: No More Hops Towards A Linearly Scalable Application Infrastructure

15

Nuts and Bolts: 4 Verbs

Write TakeRead Write Notify

Write + Read = IMDG

Write + Notify = Messaging

Write + Take = Parallel Processing

Take

Write

Read

Take

Notify

Page 15: No More Hops Towards A Linearly Scalable Application Infrastructure

16

Services can be Java, C++, .Net

Content-Based Routing

Shared state to enable stateful services

SBA = Real-time SOA for Stateful Applications

Page 16: No More Hops Towards A Linearly Scalable Application Infrastructure

17

Space Bus

ValidationService

Service Bean

MatchingService

Service Bean

Take Write Notify

Declarative Spring-SBA - Making Scalability Even Simpler

Space Bus

ValidationService

Service Bean

MatchingService

Service Bean

Take Write Notify

Take/Notify Write Take/Notify WritePolling Event

ContainerNotify Event

ContainerPolling Event

ContainerNotify Event

Container

DeclarativeAbstraction

Page 17: No More Hops Towards A Linearly Scalable Application Infrastructure

18

Reaching Scalability with Space Based SOA

Write

TakeRead

Write

Notify

Page 18: No More Hops Towards A Linearly Scalable Application Infrastructure

Order Processing Demo: Logical Workflow

Write new Orders (Feed)Client

Accounting

BrokenOrderCleaner

Logistics

Take

Orders(new)

Write

Orders

(approved)

Take Orders

(approved)

Write

Orders

(shipped)

Take Orders

(shipped,

unshipped,

unapproved)

Write new Orders (once cleaned)

OrderSystem

Page 19: No More Hops Towards A Linearly Scalable Application Infrastructure

Linearly Scalable OrderProcessing: Deploy Once:

GSC 1

SpaceProxy

Processing Unit 1

orderfeed

Spring Bean

GSC 2

EmbeddedSpace

Processing Unit 2

ordersystem

Spring Bean

Page 20: No More Hops Towards A Linearly Scalable Application Infrastructure

GSC 1

Embedded Space

Processing Unit 1

ordersystem

Spring Bean

GSC 2

Embedded Space

Processing Unit 2

ordersystem

Spring Bean

GSC 3

Embedded Space

Processing Unit 3

ordersystemSpring Bean

One Logical Space

(Partitioned)

GSC 4

SpaceProxy

Processing Unit 4

orderfeed

Spring Bean

Linearly Scalable OrderProcessing: Deploy Again:

The throughput of the application grows linearly as the number of ordersystem deployments increase.

Page 21: No More Hops Towards A Linearly Scalable Application Infrastructure

22

Building SBA Application – How it works..

• Step 1:

– Implement POJO domain model

• Step 2:

– Implement the POJO Services

• Step 3:

– Wire the services through spring

• Step 4:

– Packaging

– Deploy to Grid (Scale-Out)

Register

Page 22: No More Hops Towards A Linearly Scalable Application Infrastructure

23

Come To The “Let’s Code” BOF!!!

• November 8th 2007 @7:15 PM in “City Room”

• Everyone bring a laptop

• Download GigaSpacesXAP6.0.1

– http://www.gigaspaces.com/os_downloads.html

• Install Eclipse 3.3 Europa [ or Intellij ]

• Go to my blog and download: “projectcreator.jar” (it is a zip in hiding)

– http://www.jroller.com/resources/o/owentaylor/project-creator.jar

Page 23: No More Hops Towards A Linearly Scalable Application Infrastructure

25

So, Why use a Declarative SBA?

• Simple!

– Building a fully fledged distributed application becomes just a matter of wiring

simple local beans

• It’s all declarative through annotation or XML

• Non intrusiveness through abstraction

– High level abstraction provides higher degree of flexibility to plug-in different

solutions from different topologies, technologies and standards without

compromising on the least common denominator

• Extremely Extensible

– Very easy to extend the model and the underlying implementation without

changing the application

• Reduced learning curve – It’s just Spring

– If you already know Spring – you are ready to begin

• Fits natively to the existing Spring model

• Utilizes common practices such as annotation, IoC etc.

Page 24: No More Hops Towards A Linearly Scalable Application Infrastructure

26

Questions Please?Thank You!

http://www.jroller.com/owentaylor