- I find a mistake in the book or somebody else points one out using the review system's notes.
- I fix the mistake in the ERB/XML version of the book.
- The ERB/XML version is then automatically converted into an XML document via a running Guard process.
- I commit both files to the Git repository for the book, and then push these to GitHub
- GitHub tells the review tool that a push has occurred, and sends through a push notification.
- The review tool receives the notification and stores a job in Resque to parse the book.
- A resque worker runs the job, detecting which files have changed and then updates just those chapters.
- For each chapter, each element is processed individually using an XSLT file and stored in a MongoDB database as HTML (I know, right?)
- When a user requests a chapter, this page is then read from the database and then cached back to Redis.
- Every time a chapter is updated, be it by the automated process or by a user putting a note on the book, the cache is reset.
OMG.
Damn dude, no kidding...