As your application grows, scalability becomes critical. This article covers patterns for building Oorian applications that scale well.
Choose the Right Communication Mode
AJAX scales easiest—no persistent connections. SSE and WebSocket require session affinity for horizontal scaling.
Minimize Session State
// Bad: Storing large objects
private List<Customer> allCustomers; // Could be thousands
// Good: Store IDs, fetch on demand
private Long selectedCustomerId;
private Customer getSelectedCustomer()
{
return customerService.findById(selectedCustomerId);
}
Use Server-Side Pagination
grid.setRowModelType(RowModelType.SERVER_SIDE);
// Only loads data as needed
Horizontal Scaling
- Use sticky sessions for SSE/WebSocket pages
- Share session state via Redis or similar
- Design stateless services
Conclusion
Scalable Oorian applications choose appropriate communication modes, minimize session state, and use pagination for large datasets.