Selenium 4 Grid ships with SessionMap.

A SessionMap is a store of session id and it's capabilities. It is a key value store. Now, how that data is stored differs on the implementation used. As of Selenium 4, we offer the
following types of data store.

## RedisBackedSessionMap

`RedisBackedSessionMap` uses Redis as datastore for key, value store. To start it, run the following command:

```
SESSIONS_IMPLEMENTATION=org.openqa.selenium.grid.sessionmap.redis.RedisBackedSessionMap \
SESSIONS_SCHEME=redis \
java -jar selenium.jar \
  --ext $(coursier fetch -p org.seleniumhq.selenium:selenium-session-map-redis:4.0.0-alpha-6) \
  sessions --sessions-host "<redis_host>" --sessions-port <redis_port>
```

## JdbcBackedSessionMap

The `JdbcBackedSessionMap` uses JDBC to talk to use any supported database for session map store.

The table name used to store sessions is: `sessions_map`.
It consists of three columns of string datatype: `session_ids`, `session_caps`, `session_uri`, `session_stereotype`, `session_start`

Prerequisites

1. Ensure the appropriate JDBC driver jar is downloaded on the host machine.

2. Ensure the "sessions_map" table with varchar "session_ids", "session_caps", "session_uri", "session_stereotype" and "session_start" columns is created in the database.

You can create the required table using something similar to:

```
CREATE TABLE sessions_map(
    session_ids varchar(256),
    session_caps varchar(1000),
    session_uri varchar(256),
    session_stereotype varchar(1000),
    session_start varchar(256)
 );
 ```
 
Here the size of each column is an arbitrary number. Ensure the datatype and limit matches the selected database. Also, the limit for varchar type should be able to accommodate the
capabilities json stored in "session_caps" and stereotype json stored in "session_stereotype".

To start the `JdbcBackedSessionMap`:

```
SESSIONS_IMPLEMENTATION=org.openqa.selenium.grid.sessionmap.jdbc.JdbcBackedSessionMap \
SESSIONS_SCHEME=jdbc \
java -jar selenium.jar
  --ext $(coursier fetch -p org.seleniumhq.selenium:selenium-session-map-jdbc:4.0.0-alpha-6 org.postgresql:postgresql:42.2.14.jre7) \
  sessions \
  --jdbc-user "<jdbc_user>" --jdbc-password "<jdbc_password>" \
  --jdbc-url "<jdbc_url>"
```

