computer measurement group, india 1 1 optimal design principles for better performance of next...
TRANSCRIPT
Computer Measurement Group, India 1Computer Measurement Group, India 1
www.cmgindia.org
Optimal Design Principles for better Performance of Next generation Systems
Balachandar Gurusamy, InfosysMaheshgopinath Mariappan, Infosys
Indranil Dharap, Infosys
Computer Measurement Group, India 2Computer Measurement Group, India
Introduction• Design is the key in Software Engineering Methodology
• Design errors are difficult to address and will be very expensive to fix at a later stage
Computer Measurement Group, India 3Computer Measurement Group, India
Programming Language
Computer Measurement Group, India 4Computer Measurement Group, India
Selection of Database
• Big Data/No SQL will not solve all the data problems
• Problems faced due to wrong DB selection- Querying becomes complex- Query execution time will be very high and it results in slow responses to the user
• Case study – Trouble ticket application
• RDBMS for systems having relation among data and involves frequent reads
• NoSql for voluminous data without relation and less reads
ORA
CLES
QL
SE
RV
E
RH
A
D
O
OP
Computer Measurement Group, India 5Computer Measurement Group, India
Replication strategies
Synchronous
Frequent updates
Slow response
Asynchronous
Less updates
Faster response
Computer Measurement Group, India 6Computer Measurement Group, India
Caching
• Store only static data in the cache
• Implement proper cache eviction policies
• Use in-memory cache than secondary cache
Computer Measurement Group, India 7Computer Measurement Group, India
Garbage collection• Garbage collection is a way of doing automatic memory
management• Case study – Queuing application dropping requests
- No issues in the system logs but application was dropping customer requests- Root cause analysis identified the issue related to bad garbage collection configuration
1 2 3 40
10
20
30
Dropped connection vs Full GC's
Full GC cycles(fixed time interval)Dropped connections
Computer Measurement Group, India 8Computer Measurement Group, India
Session management• Session management is more like managing a transaction
• Every session started should be closed properly
• Case study – Ecommerce site not able to handle transactions- Lot of unmanaged customer session in memory- Session data is huge and consuming lot of system resources- Optimized configurations like, closing sessions once client is disconnected, timeout the session based on the application requirement, move data to temporary journal helps to address this issue
Computer Measurement Group, India 9Computer Measurement Group, India
Client side computing vs Server side computing
Implemented using Javascript, Ajax , Flash
Implemented using PHP, ASP.net, JSP, Python, Ruby on rails
Interactive web applications Quick business rules computation
Less Network bandwidth Efficient caching implementation
Quicker initial load time Better data security
Preferred for dynamic loading of content, animations
Preferred for validating user preferences
Data storage in local temporary storage To develop structured web applications
Computer Measurement Group, India 10Computer Measurement Group, India
Retry Mechanism
• Retry mechanism is used to enhance user experience
• It will be employed through Database calls and third party calls to cover the failures
• Case study – Real time communication project- No sql database is used in the project- When the database went down due to system issues, all the Clients
were retrying indefinitely and brought down the entire infrastructure - By configuring optimum number of retries the application works without
issues keeping the infrastructure issues away
1st Attempt- No response
2nd Attempt- No response
3rd Attempt- No response
No further attempts unless the protocol is followed
Computer Measurement Group, India 11Computer Measurement Group, India
Choice of Design patterns• Currently more than 200 design patterns exist in the market• Design pattern Intent ontology is one of the method to
identify the suitable design pattern.• Design pattern wizard tool helps to select the appropriate
design pattern
Computer Measurement Group, India 12Computer Measurement Group, India
Parallelism
1
23
4
• Identify the tasks that can be executed independently
• Break down large transaction into smaller tasks
• High throughput & better performance
• Map Reduce is the best example
Computer Measurement Group, India 13Computer Measurement Group, India
Choice of data structures
Used by computers to store and retrieve data internally
Commonly used data types - List, Map, Set and Queue
List to retrieve items in the input order
Map for retrieving items based on the key
Set to store only unique set of data items
Queue to implement worker thread model
If possible override the default size of the data structure
Computer Measurement Group, India 14Computer Measurement Group, India
Async transactions
Determine the transactions that can be done in asynchronous
manner
Helps to reuse expensive resources
effectively
Items that can be done asynchronously• Database read or
write• IO intensive
operations• Calls to third party
systems• Enable NIO
connections in the application servers
Computer Measurement Group, India 15Computer Measurement Group, India
Avoid lot of hops
X
Computer Measurement Group, India 16Computer Measurement Group, India
Thank You