SlideShare a Scribd company logo
Best practices to optimize code and build
robust and scalable web applications
1.1 Introduction
This document discusses best practices and performance considerations for
developing web Application applications.
To begin, let’s have a look at the overall application development process
and how performance engineering fits into the picture.
A basic development lifecycle with performance engineering integrated into
the process is shown in Figure above. Note that this process itself is often
performed in an iterative manner that includes both prototypes and multiple
production releases.
The corrective measures after an unacceptable performance test get
increasingly more expensive and detrimental as you are required to go
farther back in the process. Thus, it is very important to spend some initial
time considering performance during the establishment of the overall
application architecture. It is much easier to refactor portions of the
application code than it is to change the underlying application architecture.
As was alluded to earlier, there should still be a balance in terms of how
much time and effort is spent on this topic, but the following guidelines
usually hold true:
A scalable, efficient architecture is a must for high-performance applications.
Lower-level optimizations can always be done later.
2. Source code management
In development, it is important to manage generations of code. Carefully
organize and track application builds and the source code used to create
them to avoid confusion. In addition to tracking the version of the source
code, it is equally important to track the version of the build tools and which
machine was used to generate a build. Not all problems are due to bugs in
source code.
Developers produce code and usually use an integrated development
environment (IDE) such as the Application Server Toolkit or Rational
Application Developer to do that. Code in an IDE is stored in a workspace on
the file system, usually locally on each developer’s machine. As the project
continues, and perhaps new members join the team, the code grows and it
becomes necessary to manage the code in a central master repository. This
allows for:
_ Development team collaboration (work on common code)
_ Code versioning (managing which versions are in which releases)
_ Wider team collaboration (access for project managers, testers)
Scalability
Scalability is one of the most important factor in designing the web
applications. When the number of messages exceeds a certain quota,
storage service responds with an HTTP 503 Server Busy message. This
Best practices to optimize code and build
robust and scalable web applications
message indicates that the platform is throttling the queue. Application
designers should perform capacity planning to ensure that an appropriate
number of queues can sustain the application’s request rate. If a single
queue is unable to handle an application’s request rate, design a partitioned
queue architecture with multiple queues to ensure scalability.
An application could also leverage several different queues for different
message types. This ensures application scalability by allowing multiple
queues to co-exist without choking a single queue. This also allows discrete
control over queue processing based on the sensitivity and priority of the
messages that are stored in different queues. High priority queues could
have more workers dedicated to them than low priority queues.
3. Application Architecture
Web application architecture is the approach used to design and plan your
website. It is the way we organize content in our website. It consists of two
basic components, technology decisions and structural decisions.
Best structural decisions for good website architecture
 Avoid dynamic URLs. Yes, Google can index dynamic URLs pretty
well nowadays, but for a normal user it is a pain in neck job
 Avoid session IDs. If your CMS adds a session ID for each user at
the end of the URL then you need to change that as soon as possible!
Different URLs pointing to the same content means duplicate content.
And we all know what that means.
 Content/links in Java/JavaScript/Flash. It is always better to use
plain and simple HTML. Some search engines find it difficult to read
content in Flash or JavaScript. Let’s make their life easier.
 302 redirections. Make sure all redirections are 301 and not 302. A
302 redirection may redirect the user to the new page but does not
transfer any “link juice” from the old version of the page to the new
one. 301 redirection should be your default type of redirection if SEO
matters to you.
 Website hierarchy should match the way users search. Start
with your home page, and work your way to all the internal pages as
you want to make sure that the flow of navigation makes sense and is
easy to follow. Create categories and subcategories if necessary. You
can use a “card sorting” technique to create your category tree.
 Cross-link relevant content. This way you “cluster” all relevant
content, you pass “link juice” to all thematically relevant pages and
make your user happy, as he may find easily whatever he has been
looking for during his visit in your website.
 Use proper anchor text. Internal linking is pretty powerful,
especially if your website has thousands of pages. Take advantage of it
and use targeted keywords as anchor text instead of “more”, “click
here” and other generic terms. Prepare yourself to train designers as
well. Yes, they will be the first to complain.
 Use breadcrumb navigation. It very convenient when I user can
navigate a site via its breadcrumbs instead of clicking sidebar menus
or large navigation menus. This is where the “use proper anchor text”
tip can be applied to. Extra PRO tip: Use proper format to produce rich
snippets which affect CTR.
 Minimize link depth. Rule of thumb: No page should be deeper than
3 clicks away from your homepage. Make you site architecture flat.
The deeper you “bury” a page, the less “link juice” is passed, the less
“link juice passed” to a given page, the more difficult will be for a page
to be kept in Google index. As we know, if a page has an amount of
“link juice” which is below a certain threshold, then Google is very
likely to drop this page from its index (or not index it at all).
Conclusion
Making an application robust, is an ongoing process. You discover bugs, fix
them, and write tests to make sure they don't come back. When your
application goes down due to an external system failure, you isolate that
system to make sure the failure can't snowball again. Exception handling is
your best friend when it comes to doing this. Even the most failure-prone
application can be turned into a robust one if you apply good exception
handling practices consistently, over time.
Of course, exception handling is not the only tool in your arsenal when it
comes to making applications more resilient. Also, Asynchronous processing,
can be applied to make application fault tolerant.
Best practices to optimize code and build
robust and scalable web applications

More Related Content

What's hot (20)

PPTX
Core web vitals is the thing you should focus on if you own a website in 2021
World Web Technology Pvt Ltd
 
PDF
MAAK WEBSITE
eagle64crime
 
PDF
7 secrets of performance oriented front end development services
Katy Slemon
 
DOCX
Developing an open source content managment system
Adam Erickson
 
PPTX
Budgeting 2021 Tip for WordPress Website Owners
Karen Callahan
 
PPT
Web Development on Web Project Presentation
Milind Gokhale
 
PPTX
Internship Presentation 1 Web Developer
Hemant Sarthak
 
PPTX
Web topic 32 validate web contents
CK Yang
 
PPT
Search Engine Optimization
Mindfire Solutions
 
PDF
8 web design facts that we know
Immortal Technologies
 
DOCX
Web deveopment using React js and Node js with SQL.
Jayant Surana
 
PDF
WordPress Optimisation - A4UExpo
Joost de Valk
 
PPTX
Pcs global (4)
Suraj Soni
 
PPT
AngularJS – What, Why, Advantages and Disadvantages
karenmsmith0504
 
PPTX
List of 7 popular java frameworks for 2019
kritikumar16
 
PDF
Web Development with HTML5, CSS3 & JavaScript
Edureka!
 
PDF
Know about cake php framework with vertexplus
VertexPlus Softwares Pvt. Ltd.
 
PPTX
ppt of web development for diploma student
Abhishekchauhan863165
 
PPTX
Top 10 Frameworks Programmers Should Learn in 2020
NexSoftsys
 
DOC
Bootstrap responsive design
Ishtdeep Hora
 
Core web vitals is the thing you should focus on if you own a website in 2021
World Web Technology Pvt Ltd
 
MAAK WEBSITE
eagle64crime
 
7 secrets of performance oriented front end development services
Katy Slemon
 
Developing an open source content managment system
Adam Erickson
 
Budgeting 2021 Tip for WordPress Website Owners
Karen Callahan
 
Web Development on Web Project Presentation
Milind Gokhale
 
Internship Presentation 1 Web Developer
Hemant Sarthak
 
Web topic 32 validate web contents
CK Yang
 
Search Engine Optimization
Mindfire Solutions
 
8 web design facts that we know
Immortal Technologies
 
Web deveopment using React js and Node js with SQL.
Jayant Surana
 
WordPress Optimisation - A4UExpo
Joost de Valk
 
Pcs global (4)
Suraj Soni
 
AngularJS – What, Why, Advantages and Disadvantages
karenmsmith0504
 
List of 7 popular java frameworks for 2019
kritikumar16
 
Web Development with HTML5, CSS3 & JavaScript
Edureka!
 
Know about cake php framework with vertexplus
VertexPlus Softwares Pvt. Ltd.
 
ppt of web development for diploma student
Abhishekchauhan863165
 
Top 10 Frameworks Programmers Should Learn in 2020
NexSoftsys
 
Bootstrap responsive design
Ishtdeep Hora
 

Similar to Best practices to optimize code and build robust and scalable web applications (20)

PPT
Developing For The Web
aleemb
 
PDF
How to Build a Scalable Web Application for Your Project
BitCot
 
PPT
Web Speed And Scalability
Jason Ragsdale
 
PDF
BUILDING SCALABLE AND ROBUST WEB APPLICATIONS: BEST PRACTICES
flaviusnoja1
 
DOCX
Performance Optimization
Neha Thakur
 
PPTX
Html Optimization for SEO
S. Ernest Paul ✪
 
PPTX
Seo for Engineers
Cort Tafoya
 
PDF
Tech Headline - JavaScript Performance
Rodrigo Castilho
 
PDF
5 Best Practices For Blazing Fast Website Performance presented by Gomez & Fo...
Compuware APM
 
PDF
7 Habits of Exceptional Performance
Nicole Sullivan
 
ODP
Basics of-software-development
lukaramishvili
 
PPT
scale_perf_best_practices
webuploader
 
DOCX
The principles of agile development
Rajat Samal
 
PDF
Django in the Real World
Jacob Kaplan-Moss
 
PPT
Frontend performance
sacred 8
 
PPT
J2EE Performance And Scalability Bp
Chris Adkin
 
PDF
High performance website
Chamnap Chhorn
 
PDF
High Performance Websites
Aaron Grogg
 
PPTX
OSSCube - Zend Webinar
OSSCube
 
PPTX
10 Tips to make your Website lightning-fast - SMX Stockholm 2012
Bastian Grimm
 
Developing For The Web
aleemb
 
How to Build a Scalable Web Application for Your Project
BitCot
 
Web Speed And Scalability
Jason Ragsdale
 
BUILDING SCALABLE AND ROBUST WEB APPLICATIONS: BEST PRACTICES
flaviusnoja1
 
Performance Optimization
Neha Thakur
 
Html Optimization for SEO
S. Ernest Paul ✪
 
Seo for Engineers
Cort Tafoya
 
Tech Headline - JavaScript Performance
Rodrigo Castilho
 
5 Best Practices For Blazing Fast Website Performance presented by Gomez & Fo...
Compuware APM
 
7 Habits of Exceptional Performance
Nicole Sullivan
 
Basics of-software-development
lukaramishvili
 
scale_perf_best_practices
webuploader
 
The principles of agile development
Rajat Samal
 
Django in the Real World
Jacob Kaplan-Moss
 
Frontend performance
sacred 8
 
J2EE Performance And Scalability Bp
Chris Adkin
 
High performance website
Chamnap Chhorn
 
High Performance Websites
Aaron Grogg
 
OSSCube - Zend Webinar
OSSCube
 
10 Tips to make your Website lightning-fast - SMX Stockholm 2012
Bastian Grimm
 
Ad

Best practices to optimize code and build robust and scalable web applications

  • 1. Best practices to optimize code and build robust and scalable web applications 1.1 Introduction This document discusses best practices and performance considerations for developing web Application applications. To begin, let’s have a look at the overall application development process and how performance engineering fits into the picture.
  • 2. A basic development lifecycle with performance engineering integrated into the process is shown in Figure above. Note that this process itself is often performed in an iterative manner that includes both prototypes and multiple production releases. The corrective measures after an unacceptable performance test get increasingly more expensive and detrimental as you are required to go farther back in the process. Thus, it is very important to spend some initial time considering performance during the establishment of the overall application architecture. It is much easier to refactor portions of the application code than it is to change the underlying application architecture. As was alluded to earlier, there should still be a balance in terms of how much time and effort is spent on this topic, but the following guidelines usually hold true: A scalable, efficient architecture is a must for high-performance applications. Lower-level optimizations can always be done later. 2. Source code management In development, it is important to manage generations of code. Carefully organize and track application builds and the source code used to create them to avoid confusion. In addition to tracking the version of the source code, it is equally important to track the version of the build tools and which machine was used to generate a build. Not all problems are due to bugs in source code. Developers produce code and usually use an integrated development environment (IDE) such as the Application Server Toolkit or Rational Application Developer to do that. Code in an IDE is stored in a workspace on the file system, usually locally on each developer’s machine. As the project continues, and perhaps new members join the team, the code grows and it becomes necessary to manage the code in a central master repository. This allows for: _ Development team collaboration (work on common code) _ Code versioning (managing which versions are in which releases) _ Wider team collaboration (access for project managers, testers) Scalability Scalability is one of the most important factor in designing the web applications. When the number of messages exceeds a certain quota, storage service responds with an HTTP 503 Server Busy message. This
  • 3. Best practices to optimize code and build robust and scalable web applications message indicates that the platform is throttling the queue. Application designers should perform capacity planning to ensure that an appropriate number of queues can sustain the application’s request rate. If a single queue is unable to handle an application’s request rate, design a partitioned queue architecture with multiple queues to ensure scalability. An application could also leverage several different queues for different message types. This ensures application scalability by allowing multiple queues to co-exist without choking a single queue. This also allows discrete control over queue processing based on the sensitivity and priority of the messages that are stored in different queues. High priority queues could have more workers dedicated to them than low priority queues. 3. Application Architecture Web application architecture is the approach used to design and plan your website. It is the way we organize content in our website. It consists of two basic components, technology decisions and structural decisions. Best structural decisions for good website architecture  Avoid dynamic URLs. Yes, Google can index dynamic URLs pretty well nowadays, but for a normal user it is a pain in neck job  Avoid session IDs. If your CMS adds a session ID for each user at the end of the URL then you need to change that as soon as possible! Different URLs pointing to the same content means duplicate content. And we all know what that means.  Content/links in Java/JavaScript/Flash. It is always better to use plain and simple HTML. Some search engines find it difficult to read content in Flash or JavaScript. Let’s make their life easier.  302 redirections. Make sure all redirections are 301 and not 302. A 302 redirection may redirect the user to the new page but does not transfer any “link juice” from the old version of the page to the new one. 301 redirection should be your default type of redirection if SEO matters to you.  Website hierarchy should match the way users search. Start with your home page, and work your way to all the internal pages as
  • 4. you want to make sure that the flow of navigation makes sense and is easy to follow. Create categories and subcategories if necessary. You can use a “card sorting” technique to create your category tree.  Cross-link relevant content. This way you “cluster” all relevant content, you pass “link juice” to all thematically relevant pages and make your user happy, as he may find easily whatever he has been looking for during his visit in your website.  Use proper anchor text. Internal linking is pretty powerful, especially if your website has thousands of pages. Take advantage of it and use targeted keywords as anchor text instead of “more”, “click here” and other generic terms. Prepare yourself to train designers as well. Yes, they will be the first to complain.  Use breadcrumb navigation. It very convenient when I user can navigate a site via its breadcrumbs instead of clicking sidebar menus or large navigation menus. This is where the “use proper anchor text” tip can be applied to. Extra PRO tip: Use proper format to produce rich snippets which affect CTR.  Minimize link depth. Rule of thumb: No page should be deeper than 3 clicks away from your homepage. Make you site architecture flat. The deeper you “bury” a page, the less “link juice” is passed, the less “link juice passed” to a given page, the more difficult will be for a page to be kept in Google index. As we know, if a page has an amount of “link juice” which is below a certain threshold, then Google is very likely to drop this page from its index (or not index it at all). Conclusion Making an application robust, is an ongoing process. You discover bugs, fix them, and write tests to make sure they don't come back. When your application goes down due to an external system failure, you isolate that system to make sure the failure can't snowball again. Exception handling is your best friend when it comes to doing this. Even the most failure-prone application can be turned into a robust one if you apply good exception handling practices consistently, over time. Of course, exception handling is not the only tool in your arsenal when it comes to making applications more resilient. Also, Asynchronous processing, can be applied to make application fault tolerant.
  • 5. Best practices to optimize code and build robust and scalable web applications