WaveMaker Docs

WaveMaker Docs

  • Get started
  • Widgets
  • How-to
  • Enterprise
  • Releases
  • Blog
  • Sign-in

›All Blog Posts

All Blog Posts

  • Mitigating Spring Zero-day Vulnerability CVE-2022-22965
  • Archiving WaveMaker 9 Projects
  • URL Change in WaveMaker Android WebView
  • Announcement about Angular 11 Update
  • Mitigating Log4J 2 Vulnerability CVE 2021 44228
  • Ending Support of WaveMaker 9 Projects
  • Git Branching Strategy
  • Important Announcement about Angular 10 Update
  • Accessibility Support in WaveMaker
  • Generating .aab files using wm-cordova-cli or AppChef
  • WaveMaker Studio enables faster database imports
  • Integrate SAP HANA Database with WaveMaker
  • Redshift Database Integration
  • Important Announcement about Changes to Documentation Domain
  • WaveMaker Releases 10.7 Version
  • Theme Builder with some coding (Build + Edit)
  • Understanding Scaling of WaveMaker Applications
  • Automatically Import your Website Branding Styles into a Theme
  • Certificate Pinning Case Study
  • Cordova 10.0.0 Upgrade
  • WaveMaker Releases 10.6 Version
  • Retain UI State in WaveMaker Apps
  • Theme builder is ready with a new update
  • PostgREST OpenAPI support in WaveMaker
  • Fully automated and scalable test execution using k8s
  • New file picker for mobile apps - Improvements in UI to select files in mobile
  • WaveMaker releases 10.5 version
  • Deliver faster applications with WaveMaker!
  • GraphQL in a Micro Services Architecture
  • Build Themes for WaveMaker Apps Without Any Coding
  • COVID-19 Visualization using WaveMaker - Part 2
  • COVID-19 Visualization using WaveMaker - Part 1
  • WaveMaker Integrates with DigitalOcean Kubernetes for App Deployments
  • Deployment Experience made better!
  • OpenAPI support in WaveMaker
  • WaveMaker platform is updated to use WKWebView.
  • Deliver WaveMaker Apps as Micro Frontend Modules
  • All-new WaveMaker docs with a powerful Search
  • Welcome to the WaveMaker Developers Blog

Understanding Scaling of WaveMaker Applications

January 4, 2021

Swetha Kundaram

You have developed an exceptional application, and the demand for your application is increasing. You need to expand its accessibility and develop a plan to scale your application. Understanding how to scale an application means ensuring that your application can handle a larger number of users simultaneously. WaveMaker generates code based on open standards and brings best practices to the way applications should be architected. This makes scaling the application easy to understand and apply.

What happens if you don't scale your application?

It is the point when an application can no longer handle additional requests effectively that will limit its scalability. This limit is reached when the resources run out, requiring more machines or more capacity.

In this article, learn about scaling approaches and how WaveMaker scales an application.

Understanding Scaling Approaches

Following are the two approaches for scaling an application.

  1. Vertical Scaling
  2. Horizontal Scaling

Vertical Scaling

In simple terms, Vertical scaling means adding more resources to the server, for example, increasing the capacity of the CPU, RAM, and DISK space in a single machine to "scale-up". Vertical scaling is limited to the capacity of a single machine, therefore, scaling beyond that capacity often involves downtime when switching from a small machine to a bigger machine.

Horizontal Scaling

Horizontal scaling means it scales an application by adding more machines into the pool across the horizontal direction to "scale-out", and the scaling is based on partitioning the data. It replicates the application by growing the number of nodes in the cluster. Also, distributing the responsibilities of each node and providing additional end-points for client connections.

Which one is better for your application?

The decision depends on a number of factors, including the following.

  1. Is the application request volume steadily growing?
  2. Is the application's current growth experiencing spikes that lead to service degradation?

Combine these factors with the application's unique requirement to evaluate and determine the optimal scaling approach.

However, when you compare both Vertical and Horizontal approaches, Horizontal scaling offers a benefit of elasticity. Instead of taking your server down while you are scaling up to a better one, you keep your existing pool of resources online while adding more to what you already have. By adding more machines to the existing pool, you are not limited to the capacity of a single machine, and that scales your application with almost no downtime, and you do not get caught into the resource-shortfall.

WaveMaker's approach for Scaling Applications

Although horizontal scaling is the desirable approach for scaling an application, there are still a few challenges that need to be addressed. Let's understand that first.

How data partition can be a challenge in Horizontal scaling

The following image shows a deployment architecture of Horizontal scaling.

Horizontal Scaling Deployment Architecture

With Horizontal scaling, the data gets distributed among the nodes, and each node contains only a part of the data. Therefore, the user-session created by a node cannot be understood by the other node. In this case, when the user logins again, it rejects the request if the request goes to another node.

WaveMaker generates open standards code based on Spring for the back end. So, for Horizontal scaling, Spring Session Module implementation can be used, configured to handle session management for the application.

Integrating Spring Session with WaveMaker

Spring Session manages user's http session information while supporting clustered sessions without being tied to an application container specific solution.

In the following illustration, see how WaveMaker applications scale horizontally; specifically, storing user authenticated sessions when the requests are served by different nodes using the round-robin mechanism and without using any sticky sessions.

Distributed Persistence of User Authentication Session Architecture

Distributed Persistence of User Authentication Session

For this approach, WaveMaker uses spring-session-core as a runtime dependency. It distributes the persistence of the user authentication session. With a distributed session registry, the user session created by a node can be understood by the other nodes by persisting the user sessions in a distributed manner.

Spring-session based on External Store

There are two ways for configuring external session stores depending on your requirements by choosing from Redis and JDBC. To configure with Redis as an external store, WaveMaker adds spring-session-data-redis along with lettuce-core dependency. Similarly, for JDBC, we add a spring-session-jdbc dependency. WaveMaker internally adds these dependencies to scale applications and handle session management for the application.

With release 10.6, all the WaveMaker applications provide an option to opt for Horizontal scaling by choosing from Redis, JDBC, along with MapSessionRepository as a Distributed Session Registry.

Session Persistence with Horizontal Scaling

MapSessionRepository is an In-memory type that does not scale the application horizontally, and it is the default settings when you create a WaveMaker application. To enable Horizontal scaling, simply select an option from the dropdown, and follow the on-screen instructions. To learn how to use this feature, see Horizontal Scaling using Session Persistence.

Tweet
Recent Posts
  • Understanding Scaling Approaches
    • Vertical Scaling
    • Horizontal Scaling
    • Which one is better for your application?
  • WaveMaker's approach for Scaling Applications
    • How data partition can be a challenge in Horizontal scaling
    • Integrating Spring Session with WaveMaker
    • Spring-session based on External Store
WaveMaker
  • PRICING
  • PARTNERS
  • CUSTOMERS
  • ABOUT US
  • CONTACT US
Terms of Use | Copyright © 2013-2022 WaveMaker, Inc. All rights reserved.