More Related Content
Similar to Scaling web systems ts
Similar to Scaling web systems ts (20)
Scaling web systems ts
- 1. © 2010 Ariba, Inc. All rights reserved. The contents of this document are confidential and proprietary information of Ariba, Inc.
- 2. What is scalability?
© 2010 Ariba, Inc. All rights reserved. The contents of this document are confidential and proprietary information of Ariba, Inc.
- 3. Some standard definitions
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. (Wikipedia)
The ability to handle increased workload by
repeatedly applying a cost effective strategy
for extending a system’s capacity (SEI)
© 2010 Ariba, Inc. All rights reserved. The contents of this document are confidential and proprietary information of Ariba, Inc.
- 4. Consider a simple web application
© 2010 Ariba, Inc. All rights reserved. The contents of this document are confidential and proprietary information of Ariba, Inc.
- 5. Load v/s Performance of a nonscalable system
© 2010 Ariba, Inc. All rights reserved. The contents of this document are confidential and proprietary information of Ariba, Inc.
- 6. Scalability Bottlenecks
Memory
Out of memory
Disk thrashing
Fragmentation
CPU
Overload
Context switches
I/O waits
Others
Disk
Network
© 2010 Ariba, Inc. All rights reserved. The contents of this document are confidential and proprietary information of Ariba, Inc.
- 7. Load v/s performance of a scalable
system (Ideal)
© 2010 Ariba, Inc. All rights reserved. The contents of this document are confidential and proprietary information of Ariba, Inc.
- 8. © 2010 Ariba, Inc. All rights reserved. The contents of this document are confidential and proprietary information of Ariba, Inc.
- 10. Improve application performance
Identify and fix performance bottlenecks
Algorithms
DB queries
Thread Deadlocks
I/O
Why is it important
When you use less resources per task (processor
time, memory, N/W round trips etc)…
…You can handle a lot more load
© 2010 Ariba, Inc. All rights reserved. The contents of this document are confidential and proprietary information of Ariba, Inc.
- 11. Loose coupling paradigms - SOA
Loosely coupled interactions
One-to-one communications
Consumer-based trigger
Synchronous
© 2010 Ariba, Inc. All rights reserved. The contents of this document are confidential and proprietary information of Ariba, Inc.
- 12. Loose coupling paradigms - EDA
Decoupled interactions
Many-to-many communications
Event-based trigger
Asynchronous
© 2010 Ariba, Inc. All rights reserved. The contents of this document are confidential and proprietary information of Ariba, Inc.
- 13. Distribute work, data
Motivations:
Can scale independently
Failures are isolated
Segment Functionality
application pools
Segment Data
Based on functional areas
Horizontal split
© 2010 Ariba, Inc. All rights reserved. The contents of this document are confidential and proprietary information of Ariba, Inc.
- 14. Asynchronous communication
Motivations
Can scale components independently
Can decouple availability
Can spread peak load over time
Integrate different services asynchronously
Point to point / publish subscribe
Staged event driven architecture (SEDA)
© 2010 Ariba, Inc. All rights reserved. The contents of this document are confidential and proprietary information of Ariba, Inc.
- 16. Aggressive Caching
Motivations:
Save processing cycles
Save on network round-trip delays
Content caching on CDNs
Caching on clients (browsers/mobile devices)
Caching at application layer
Distributed caching
© 2010 Ariba, Inc. All rights reserved. The contents of this document are confidential and proprietary information of Ariba, Inc.
- 17. Cache Everywhere
Distributed In
memory Cache
Proxy
App Server
Web Browser
LRU Cache
Browser Cache
Page Cache
Query Cache
CDN
Resource
Cache
© 2010 Ariba, Inc. All rights reserved. The contents of this document are confidential and proprietary information of Ariba, Inc.
Database
Result Cache
- 18. Avoid or distribute state
Motivations:
Save memory and processing cycles
Reduce machine affinity
Strive for statelessness
Maintain session data in browsers if possible
Store session state in distributed cache
© 2010 Ariba, Inc. All rights reserved. The contents of this document are confidential and proprietary information of Ariba, Inc.
- 19. Database
Simplify entity relationships to aid split
Use the right kind of Database lock
Avoid distributed transactions
Don’t select everything, read only as much
data as you can use
Consider NoSQL storage
© 2010 Ariba, Inc. All rights reserved. The contents of this document are confidential and proprietary information of Ariba, Inc.
- 20. © 2010 Ariba, Inc. All rights reserved. The contents of this document are confidential and proprietary information of Ariba, Inc.
- 21. How do we scale…
Individual community
© 2010 Ariba, Inc. All rights reserved. The contents of this document are confidential and proprietary information of Ariba, Inc.
- 22. Scaling storage: Multi SID
Goal: To be able to scale out DB storage as required
Application
Realm-Schema map
Persistence Layer
DB Instance #1
Schema 1
Schema 2
Schema 20
DB Instance #2
Schema 1
Schema 2
Schema 20
© 2010 Ariba, Inc. All rights reserved. The contents of this document are confidential and proprietary information of Ariba, Inc.
- 23. Clustering v/s Sharding
Clustering
Oracle RAC, Hbase
Automatically scale datastore
Rebalances to distribute capacity
Nodes communicate with each other
Very complicated
Cluster manager failure!
Sharding
Data distributed manually
Split database to add capacity
Data does not move
Nodes are unaware of each other
Custom algorithm based on functional / key distribution
© 2010 Ariba, Inc. All rights reserved. The contents of this document are confidential and proprietary information of Ariba, Inc.
- 24. Scaling search: Arches
Goal: To be able to scale up search/publish activities linearly
© 2010 Ariba, Inc. All rights reserved. The contents of this document are confidential and proprietary information of Ariba, Inc.
- 25. Arches goals…
Elastic architecture with ability to add capacity on the fly
Sub-second search performance
Improving indexing performance with customer isolation
Eventually be used to build the global search service
all across Ariba
Arches interfaces…
Pub API: Publish endpoint exposed over one way
messaging
Search API: REST based search endpoint
Pull API: REST based data pull endpoint to be
implemented by applications
Manage API: REST based management endpoint
© 2010 Ariba, Inc. All rights reserved. The contents of this document are confidential and proprietary information of Ariba, Inc.
- 26. Lightweight Metadata: Overcoming
memory bottleneck
Problem:
All realms, even realms with no customization and
no activity consume lots of system resources
Realms with no customization have the same foot
print as realms with lots of customization
Important for mid-market offering
Goals
© 2010 Ariba, Inc. All rights reserved. The contents of this document are confidential and proprietary information of Ariba, Inc.
- 27. Light weight metadata solution
Shape of a Class is now shared across
Variants
Sub Types computed dynamically
© 2010 Ariba, Inc. All rights reserved. The contents of this document are confidential and proprietary information of Ariba, Inc.
- 28. Dynamic capacity realms project
Goal: Remove downtimes for scaling our products.
Dynamic scalability
Tolerate change to cluster topology
Central connection manager
Goal: Improve database connection usage.
Central connection manager to distribute
database connections based on usage
Local pools & Global pool
© 2010 Ariba, Inc. All rights reserved. The contents of this document are confidential and proprietary information of Ariba, Inc.
- 29. ADE (Ariba data enrichment) scalability
Instance 1
Weblogic
Managed
Server
ADE
Client
Weblogic
Administrative
Server
Load balancing
(EJBs & RMI)
Weight based sticky
session
JMS
Product
Product
Engines
Engines
Instance 2
Weblogic
Managed
Server
JDBC
Clustering
JMS
Product
Product
Engines
Engines
Instance 3
Weblogic
Managed
Server
JMS
Product
Product
Engines
Engines
ADE
DB
© 2010 Ariba, Inc. All rights reserved. The contents of this document are confidential and proprietary information of Ariba, Inc.
SDB
(Ops)
- 30. © 2010 Ariba, Inc. All rights reserved. The contents of this document are confidential and proprietary information of Ariba, Inc.