Spring I/O: Redis-backed HTTP sessions

When you have the pleasant problem of trying to handle lots and lots of users, you quickly realize that tracking user state in the HTTP session doesn’t scale very well. To keep each session in memory could consume quite a lot of memory, for example, and distributing the session across multiple nodes is a bit cumbersome.

Many use cookies for this, but then we easily get the problem of too big and too many cookies in each request.

A solution to this can be to store the session in an external datastore, say Redis. This was the subject for the talk ‘Manage your user’s session with Spring Session’ by David Gomez.

As it turns out, it’s very easy to implement this with Spring Boot: you add the spring-session-data-redis dependency to your project, add the @EnableRedisHttpSession to your starter class, and boom: you’re done.

By default, the implementation uses session cookies, but you can change this to use HTTP Headers instead.

David Gomez made the claim that ‘The reason for the requirement on REST services to be stateless is mostly from scalability concerns, and using Redis-backed sessions lessens this concern’. I’m still not sure if it’s a good idea to introduce state into REST services, but it’s certainly an interesting thought.

I couldn’t find the slides for this presentation yet, but I hope they will show up soon.


A Holistic View on Developer Productivity

What does developer productivity mean, really? Is it churning out more code or less code? Is it to have less bugs in production or shipping code more often? Is it doing a lot of things or just one thing? Let’s think about this for a moment. I believe developer productivity is about getting more things […]


Improving the usability of Aftonbladet Video-clip pages

We have recently started the process of improving the usability of video-clip pages. In order to get an idea of where Aftonbladet stands compared to other world-class online video/news providers, we conducted an online test answered by 110 visitors of Aftonbladet TV. In this test we compared their perception of an Aftonbladet TV video-clip page […]


Schibsted’s 1st iOS Deployment Meet-up

Schibsted’s 1st iOS Deployment Meet-up Thursday, 28th of April 2016: getting to know each other, guests arrive Friday, 29th of April 2016: the meet-up date We here at Aftonbladet had been planning on having a meet-up with iOS developers across various Schibsted companies for many months. We had a range of topics in mind for […]


Hackday: The Future of Storytelling is social, engaging and rewarding

We gathered students, journalists, developers and designers to get together and conceptualize something new for the news industry. This was our first organized hack event – The Future of Storytelling Hack. The hack was a team-based, news-media-focused prototyping and experimentation event within storytelling over two days at Kungsbrohuset, Schibsted and Aftonbladets headquarter in Stockholm. A good story used to […]