web - Generating pages that require complex calculations and data manipulation -
what's best approach generating page results of complex calculation/data manipulation/api calls (e.g. 5 mins per page)? can't calculation within rails web request.
a scheduled task can produce data, should store it? should store in postgres table? should store in document oriented database? should store in memory? should generate html?
i have feeling of being second-level ignorant subject. there known set of tools deal kind of architectural problem?
thanks.
i suggest following approach:
1. once receive initial request:
you can start processing in separate thread when receive first request input calculation , send token/unique identifier request.
2. store result:
then start calculation , store result in memory using tool memcached.
3. poll result:
then request fetching result should keep polling result generated token/unique request identifier. adriano said can use ajax (i assuming getting requests web browser).
Comments
Post a Comment