Skip to content

SimpleQA : A proof of concept

Val edited this page Sep 29, 2016 · 11 revisions

SimpleQA is a proof of concept of a Q&A site using procecures. It based on the example provided in the book Redis in Action, and also a poor imitation of inspired by StackExchange sites.

This app is in development process. I develop this application to learn Redis myself and try different things.

Its purpose is to test vtortola.RedisClient's procedures in diverse scenarios in a web application, like:

  • Leaderboard.
  • Pagination.
  • Session validation.
  • Tag driven taxonomy.
  • Auto-complete inputs.
  • Editable content.
  • Push notifications via websockets.

Because this is just a proof of concept, the app totally lacks a business/domain layer and all is centered around getting data in and out of Redis with RedisClient.

The app is divided in read and write controllers:

  • Read controllers use IModelBuilder<TRequest,TModel>: to build the view models that are used in MVC to render the views. They are read only operations, and in a production system using CQRS they may look as they look in this demo. Essentially they just go to the read database (in this case, Redis) and gets the data that is going to be used to render views.
  • Write controllers use ICommandExecuter<TCommand, TResult>: to cause changes in the data. They are read/write operations, and in a production system WON'T look like the ones in this demo. Usually this changes are executed in another type of database directly or indirectly (eg: through an event store) and later on those changes are replicated to Redis, directly or indirectly. However, for the sake of simplicity the changes are executed directly in Redis.

In big web applications, data maybe inserted in Redis on demand as a cache, giving it a expire time. For sake of simplicity, this POC assumes the data in Redis is not transient.

The key names used in SimpleQA using hashtags thinking in the upcoming Redis Cluster support in vtortola.RedisClient.

Source code is located here. A helper application to upload StackExchange data dumps into SimpleQA is also available. Please note that the purpose of this helper application is to put some data to play with in SimpleQA, not to upload a dump of 500Mb. A small data dump like crafts.stackexchange.com.7z will do.

Screenshots

Clone this wiki locally