newsdev/elex-loader

Solve table drop conundrum

jeremyjbowers opened this issue · 5 comments

Clients will read the DB and periodically see the table is empty / view doesn't exist.
Unhandled rejection SequelizeDatabaseError: relation "elex_results" does not exist
This happens because we are dropping the tables and bulk updating the records.

This is a problem with any system where we have a synchronous process (the daemon loading results) and an asynchronous process (dynamic API calls). We can solve this by removing any dynamic requests to the API and bake JSON or HTML in the daemon loop since we'll know when the table is unavailable.

Alternately can solve this with a cache. But caches are terrible and nobody has time for cache invalidation.

Will talk to @wmandrews about this when he gets in.

Do we know how other people are handling this problem?

Synchronous loading/baking cycles, in the case of NPR.

contact([{ "twitter": "@jeremybowers", "phone": "727-667-0510", "github": "
http://github.com/jeremyjbowers" }])

On Wed, Jan 13, 2016 at 4:42 PM, Tom Giratikanon notifications@github.com
wrote:

Do we know how other people are handling this problem?


Reply to this email directly or view it on GitHub
#2 (comment).