11

What architecture and application development best practices must be followed in order to scale a TWX application?

The majority of applications start with few devices but with time they quickly build up to thousands of devices. Once the amount of traffic is too much for one TWX instance what strategy should be followed? The same question applies when the front end is overwhelmed by the number of users.

Mgccon
  • 425
  • 3
  • 11

2 Answers2

5

Anytime I have had ThingWorx architecture concerns, I have been redirected to the PTC ThingWorx guide linked below. I do not believe you need a PTC account to view it, but if so it is free.

ThingWorx 8 High Availability Administrators Guide http://support.ptc.com/WCMS/files/173281/en/ThingWorx_8_High_Availability_Administrators_Guide.pdf

In your case where you have big load concerns, the guide recommends using two ThingWorx instances to handle the load.

At least two ThingWorx instances are required for HA configuration. A single instance is started, which becomes leader and fully connects to the database. Standby servers boot up and can become the leader if needed, but they do not fully connect to the database or load information like the leader does. All ThingWorx servers have a service that is called by the load balancer, which indicates their availability. Different codes identify the leader, which receives traffic, and standby nodes, which do not receive traffic but may become leader.

High-Level Architecture example from the referenced guide: HighLevel Example Thingworx Architecture

The Load Balancer determines which ThingWorx instance is to be used by the user. Usually it is used to determine which is available in a redundant architecture (which is what makes it Highly Available). However, it can also be used to determine which to use based on performance. In PTC's HA Admin Guide, they use HAProxy (see page 47) as the Load Balancer. See Section 3.2 of the HAProxy Config Doc for how to configure based on performance.

Hope this helps! It is a pretty open-ended topic

Andrew Drake
  • 655
  • 1
  • 11
  • 25
  • The solution you are providing is related with high availability. Having an instance as leader and another as standby does not add more processing capacity and for that reason does not qualify as Horizontal Scalability. – Mgccon Apr 03 '18 at 13:50
  • Well, the info in my post is only a start and a high-level architecture. Determining which Thingworx instance the user is redirected to is determined by whatever you use as the Load Balancer, in PTC's guide they use HAProxy which you'll find more info on page 47. (config info: http://www.haproxy.org/download/1.5/doc/configuration.txt) Obviously the proxy can be configured to redirect based on which is available, but it can be configured for performance too. See section 3.2 in the config doc for HAProxy – Andrew Drake Apr 03 '18 at 14:03
0

With ThingWorx 9.0 release, the ThingWorx Foundation platform supports true horizontal scalability with an active-active clustering setup providing no single points of failure. The document here provides the details about the install and setup. There is also a ThingWorx 9.0 deployment architecture guide for an overview of all the architectural details.

ThingWorx High Availability Clustering setup image

user1693663
  • 1
  • 1
  • 1