-4

One of our applications is going to become more of a Micro-services based architecture with drivers being cloud readiness, responsive, cross channel, embracing APIs, heavy client side architecture, stateless applications, dynamically scalable applications etc.

What do they mean by stateless applications here? What are the web technologies available to build stateless applications?

CupawnTae
  • 14,192
  • 3
  • 29
  • 60
yathirigan
  • 5,619
  • 22
  • 66
  • 104

1 Answers1

2

'Stateless' means that the server-side application isn't keeping information about individual clients across calls to it. Many applications keep information in the HTTP session (maintaining conversational state or caching things that are likely to be needed again), a stateless application would not do this. The client side can make calls to the server side and keep state locally.

Stateless is good because it means any server can service any request, without having to resort to clustering (where HTTP sessions have to be replicated across servers this bogs down as the number of servers increases) or sticky sessions (sending requests to the same server where the user started a session, so a server's load can get unbalanced easily). With no state the requests can be distributed across the servers more evenly, and if one goes down it's less of a problem.

The server can expose data through web service calls using REST or SOAP. There are a lot of frameworks to help you expose services whether you use Spring or pure Java EE. The client can call these services and maintain a local model within the browser as part of the DOM using AngularJs. Having services return data as JSON makes them more convenient for the client-side JavaScript to consume.

Nathan Hughes
  • 94,330
  • 19
  • 181
  • 276
  • this answer is starting to show some direction for me to explore. If you don't mind, I have few more questions based on your response. If client is going to maintain the state, does it mean only via Cookies? or does frameworks like AngularJs provide techniques other than cookies? Also, how security is ensured when user session is stored in client ? – yathirigan Jan 04 '15 at 20:14
  • does this also means that literally no session will be maintained in the application server ? – yathirigan Jan 04 '15 at 20:16
  • 1
    @yathirigan: that probably depends on the application server. for some you get an httpsession even if you don't want one. – Nathan Hughes Jan 04 '15 at 20:29
  • 1
    @yathirigan: angular keeps state in the browser as part of the DOM. and there is no security, don't put anything there you don't want the client to be able to see and manipulate. – Nathan Hughes Jan 04 '15 at 20:30