spring-projects / spring-projects/spring-session

Session namespaces support

Open
#474 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

status: waiting-for-triage
Dominant language
Java
Stars
1.9k
Forks
1.2k
Avg merge
4h 27m
Merged PRs (30d)
55

Description

Hi, what do you think about adding namespaces support to Spring Session?
I have created such an impelmentation in data-couchbase support: https://github.com/spring-projects/spring-session/pull/468
@rwinch points out that there should not be a support for namespaces in the PR so let's discuss it here.

The idea is to have a global session namespace (that's how Spring Session is implemented now) and an additional, optional appilication namespaces:

  • application namespace - attributes are visible only to instances of the same web application within a distributed system
  • global namespace - attributes are visible to all instances of all web applications within a distributed system

By default namespaces support could be turned off somehow.

Having namespaces pros (in my opinion):

  1. Session data in a large distributed system (aspecially in microservices architecture) can be pretty big. Having application and global namespaces reduces the amount of data to read every HttpSession.getSession() invocation. You can gain a significant performance boost using session namespaces.
  2. With namespaces multiple different apps/services in the system can set or get a session attribute of the same name without conflicting each other.

Here you can see how namespaces work in data-couchbase PR.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the discussion in issue #474 and the linked pull request #468. Read NamespacesSpec.groovy in the data-couchbase integration tests to understand the proposed behavior. The work is not ready until maintainers agree on whether namespaces belong in Spring Session and define the supported scope and acceptance criteria.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spring
Domain
backend, distributed-systems
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.