In a standard full-stack approach you just create a cluster of applications servers, and a load balancer with sticky sessions for incoming requests. There is an example of setting up the application for working in a Kubernetes cluster in the docs: Kubernetes Cluster :: Jmix Documentation.
Limitations (of a single node) are the same as in CUBA: each user session requires a certain amount of memory on the server, and if the server goes down the users working with this server lose the UI state and have to re-login. Regarding possible load capacity of a single node, see performance test results in the Bookstore sample application. This test shows the application behavior with 1000 concurrent users.
In case of separate backend and frontend applications, both can be scaled using separate clusters. Limitations mentioned above apply only to the frontend application. The backend can be completely stateless and require less resources.
Yes you can. Create two clusters connected to the same database, and use draining on the load balancer to move users gradually from one cluster to another. Obviously, you should update your database schema very carefully, keeping compatibility with the previous application version running on the different cluster.
Yes, but you have to copy entities from backend project to the frontend one manually and remove JPA annotations. In the future, we’ll try to automate or eliminate this task.
On the backend you expose a service using @RestService/@RestMethod
annotations:
@RestService("InventoryService")
public class InventoryService {
@RestMethod
public Double getAvailableInStock(Product product) {
return (double) Math.round(Math.random() * 100);
}
}
On the frontend, in the current Jmix 2.5 you have to write “service proxies” manually, using Spring’s RestClient calls as shown in this guide. In Jmix 2.6 (will be released this month) all you have to do on the frontend side is to declare an interface with @RemoteService
annotation, and a proxy implementation will be created automatically:
@RemoteService(store = "products")
public interface InventoryService {
Double getAvailableInStock(Product product);
}
Regards,
Konstantin