DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Please enter at least three characters to search
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Zones

Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

Last call! Secure your stack and shape the future! Help dev teams across the globe navigate their software supply chain security challenges.

Modernize your data layer. Learn how to design cloud-native database architectures to meet the evolving demands of AI and GenAI workloads.

Releasing software shouldn't be stressful or risky. Learn how to leverage progressive delivery techniques to ensure safer deployments.

Avoid machine learning mistakes and boost model performance! Discover key ML patterns, anti-patterns, data strategies, and more.

Related

  • Visually Designing Views for Java Web Apps
  • Delivering Your Code to the Cloud With JFrog Artifactory and GitHub Actions
  • Migrating Spring Java Applications to Azure App Service (Part 1: DataSources and Credentials)
  • Identifying, Exploiting, and Preventing Host Header Attacks on Web Servers

Trending

  • Unlocking the Benefits of a Private API in AWS API Gateway
  • Unlocking the Potential of Apache Iceberg: A Comprehensive Analysis
  • Beyond ChatGPT, AI Reasoning 2.0: Engineering AI Models With Human-Like Reasoning
  • Cookies Revisited: A Networking Solution for Third-Party Cookies
  1. DZone
  2. Software Design and Architecture
  3. Performance
  4. Importance of Separating Static From Dynamic Content for Modern Web Apps

Importance of Separating Static From Dynamic Content for Modern Web Apps

A discussion of the importance of architecting a web application to store and serve content, and when to use a third-party service.

By 
Ashan Fernando user avatar
Ashan Fernando
·
May. 30, 18 · Opinion
Likes (1)
Comment
Save
Tweet
Share
10.7K Views

Join the DZone community and get the full member experience.

Join For Free

Over the past few years, storage has become significantly cheaper compared to computation power. You might wonder, what does this have to do with web apps? Well, if you consider using a single web server and a database server for a small three-tier web app, this might not matter much, but with scale, how you store and serve content has a direct impact on achieving the required performance with the least cost involved.

Let's dive into the details to understand the importance of architecting a web application to store and serve content.

Image title

When it comes to the content served from a web app, these can be classified into two segments called Static Content and Dynamic Content. Static Content mostly involved things like HTML, JavaScript, CSS, Images, Videos, and Files. In contrast, it is difficult to identify the exact types of Dynamic Content, but mostly these applications data are in the form of Dynamic Content which is commonly saved in a database. It is important to understand that some Static Content may also be served as Dynamic Content depending on the specific application requirements.

Traditional Three-Tier Web App

Traditionally in a three-tier application, we were used to storing all content in a web server and in a database server.

I have seen many applications store Static Content such as HTML, JavaScript, web app images, and CSS on the web server. This is fine since these files are changing once a new deployment happens. However, it is not recommended to store files, images, and videos uploaded from the application inside the web server since it greatly limits the horizontal scaling abilities of the application as well as increases the file I/O and storage consumption of the web server. Using a third-party managed service or Network Attached Storage to store Static Content could help to address these concerns.

Similarly, it is not recommended to do computationally heavy and memory intensive operations such as image manipulation or transcoding video on a web server. These operations are highly resource intensive and could affect the common operations of the web server suffering from performance bottlenecks at scale.

You might wonder whether using third-party services, CDNs, etc. could help to reduce costs and improve reliability, performance, and efficiency of a web app. Only looking at content storage won't show you the whole picture.

Reducing the Computational Need

It is a constant debate to find the right balance between Static Content and Dynamic Content for a web application. As we discussed, since storage is cheaper, there are techniques to minimize the computational needs of web servers.

For example, you can do the image manipulation on the client-side using JavaScript and upload the image to either to a web server, file storage server, or even a third-party managed service.

This is one of the reasons that Single Page Applications are getting more popular when it comes to rendering the HTML on the client-side rather than on the web server.

When developing web apps, it is also possible to identify data which requires high processing power and time to compute or to query, which can be stored for direct access rather computing or running complex queries each time.

Serving Web App Content

When serving Static Content and Dynamic Content, the caching requirements are different. For example, Static Content could be easily served through a Content Delivery Network (CDN) while Dynamic Content will require Third-Party Caching solutions at the application level or database level at scale. In addition, Dynamic Content is mostly served through the Web Server but for Static Content, it is not mandatory.

When using third-party managed services, such as Amazon S3, Azure Blob, Cloudinary, etc., it is possible to store and serve the files either directly or through their CDN counterparts.

How Does This Affect Total Cost of Ownership

When we consider using a web server to handle both Static and Dynamic Content, the hardware we choose is a big factor in overcoming the limitations (can be processing, memory, storage, and throughput). At scale, this will increase the costs since we have to horizontally scale these servers to handle the increased capacity. In addition, it is quite expensive to build a Content Delivery Network for a global user base due to large overhead in implementing data centers all around the world. On top of this, implementing reliability will further increase the cost and complexity which is more relevant at scale.

Therefore, it is important to identify the Static and Dynamic Content, Storage, and Delivery requirements and use appropriate third-party managed services (or required distributed storage and delivery implementations) and design the web app.

Conclusion

Let us revisit the question of whether using third-party services, CDNs, etc. can help to reduce costs and improve reliability, performance, and efficiency as compared to scaling out a single web server which handles both Static and Dynamic Content.

Overall it is quite difficult to say whether it will actually reduce the costs or not for the web app since it is dependent on the particular third-party service being used. However, using these managed services will probably improve reliability, performance, and efficiency of the web app compared to scaling out a single web server with a competitive total cost of ownership.

Web Service app Web server Web apps application Content delivery network

Opinions expressed by DZone contributors are their own.

Related

  • Visually Designing Views for Java Web Apps
  • Delivering Your Code to the Cloud With JFrog Artifactory and GitHub Actions
  • Migrating Spring Java Applications to Azure App Service (Part 1: DataSources and Credentials)
  • Identifying, Exploiting, and Preventing Host Header Attacks on Web Servers

Partner Resources

×

Comments
Oops! Something Went Wrong

The likes didn't load as expected. Please refresh the page and try again.

ABOUT US

  • About DZone
  • Support and feedback
  • Community research
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends:

Likes
There are no likes...yet! 👀
Be the first to like this post!
It looks like you're not logged in.
Sign in to see who liked this post!