I seek your advice on SPA (Single-page application) architecture.I'm building an SPA which edits a model. The models consists of objects which have a relation to one another. The objects (and relations) are stored in a single a collection on the server's database. The user must authenticate on server and sessions are implemented to track user activities.For this SPA I have a choice in thick or thin serve architecture.SPA thin server architectureThe complexity of managing inter object relations (model) is done on the clientFull data set is exchanged between client and server and thereFew interactions between client and serverHeartbeat pattern is implemented to keep session alive after authenticationProcess:User logs in (heartbeat starts)Client fetches all objects from the server database collectionClient constructs a data model from the objects (using the relations) and visualizes the modelUser edits the model and saves the changesOn save the client deconstructs the data modelAll objects are submitted to the server which stores these 1:1 in the database collectionSPA thick server architectureThe complexity of managing inter object relations (model) is done on the serverSmall data packages are exchanged between client and server (after initial load)Many interactions between client and serverFrequent changes omit the need for heartbeat to keep the session alive(though I except the risk of a session will time-out due to prolonged inactivity of the user)Process:User logs inClient fetches all objects from the server database collectionClient visualizes the server side model but does not construct a client side data modelUser edits the visualized model where each change is submitted to the severServers logic determines the changes to the model and updates (1 or more) the collection accordinglyWhich architecture would be favored for my SPA - and why?
SPA thin or thick architecture
design;design patterns;architectural patterns