Skip to content

Latest commit

 

History

History
113 lines (92 loc) · 3.84 KB

README-brewdis.adoc

File metadata and controls

113 lines (92 loc) · 3.84 KB

Brewdis

Real-time inventory demo based on data from brewerydb.com.

Run the demo

git clone https://github.com/Redislabs-Solution-Architects/brewdis.git
cd brewdis
docker-compose up

Access the demo at http://localhost

Demo Steps

Presentation

An overview of the business context and demo architecture is available at pages.brewdis.demo.redislabs.com

💡
Hit the S key to open speaker notes

Products

  1. Launch redis-cli

  2. Show number of documents in RediSearch index:

    FT.INFO products

  3. Run simple keyword search:

    FT.SEARCH products chambly

    💡
    name, description, breweryName are phonetic text fields so you will notice results containing words that sound similar.
  4. Run prefix search:

    FT.SEARCH products chamb*

  5. Open http://localhost

  6. Enter a simple keyword search, e.g. chambly. Note highlighted matches.

  7. Expand the filter panel by clicking on the filter button:

    filter list 24px
  8. Enter some characters in the Brewery field to retrieve suggestions from RediSearch (e.g. Unib)

  9. Click the Submit button

  10. Refine the search by adding a constraint on the alcohol content (ABV field):

    @abv:[7 9]

  11. Change the sort-by field to ABV and click Submit

Availability

  1. Click Availability on one of the search results. This takes you to the availability map for that product.

  2. The map shows stores near you where the selected product is currently available.

  3. Stores in green have more than 20 in stock, amber: 10 to 20, red: less than 10

Inventory

  1. Click on a store and then on the link that pops up

  2. This takes you to the real-time inventory for that store

  3. The Available to Promise field is updated in real-time based on current difference between supply (On Hand) and demand (Reserved + Allocated + Virtual Hold).

Configuration

The app server is built with Spring Boot which can be configured different ways: Spring Boot Externalized Configuration. Depending on the way you’re running the demo you can either:

java -jar brewdis.jar --spring.redis.host=localhost --spring.redis.port=6379 ...
  • use environment variables:

export spring.redis.host=localhost
export spring.redis.port=8080
export ...
java -jar brewdis.jar

Here are the most common configuration options for this demo:

  • spring.redis.host: Redis database hostname (default: localhost)

  • spring.redis.port: Redis database port (default: 6379)

  • stomp.host: Websocket server hostname (default: localhost)

  • stomp.port: Websocket server port (default: 8080)

  • stomp.protocol: Websocket protocol (default: ws). Use wss for secure websockets

  • inventory.generator.rate: duration in millis the generator should sleep between inventory updates (default: 100)

  • availability-radius: radius to find in-store availability (default: 25 mi)

Architecture


Brewdis