-
Notifications
You must be signed in to change notification settings - Fork 75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[politeiad+www] Create single source of truth cache layer #546
Comments
www? |
Here's a summary of some of my thoughts on the database choice. Problem
In-memory stores MongoDB Compared to CockroachDB:
CockroachDB Compared to MongoDB:
CockroachDB is not as mature of a product as MongoDB. The company that builds CockroachDB was founded in 2015 and there is always the risk that they run out of funding like we've seen with other database projects (ex. RethinkDB). They've raised a total of $53.5M to date with their most recent round being a Series B, so I think there is a good chance that they'll be around for a while. Conclusion |
Be aware that there is much that CockroachDB does not support, although they aim to be compatible with PostgreSQL: https://www.cockroachlabs.com/docs/v2.0/sql-feature-support.html About a year ago I started with CockroachDB and quickly switched to PostgreSQL. Perhaps it is getting closer to prime time for CockroachDB, but why not PostgreSQL? |
@chappjc there was a previous discussion about PostgreSQL that you can check out here: |
* Improve proposal content backup logic * Remove unnecessary change
At this time www caches proposals, comments etc in memory. As this grows this is going to become increasingly hard on memory and the hosting machines. In addition, the caches we use are prone to errors because they are updated in several code paths.
What we need is a cache layer that politeiad has write-only access to and politeaid has read-only access from. The flow of data becomes as follows: www receives command -> www cooks command and sends to d -> d stores new data -> d updates cache -> d completes command to www -> www reads cache (if needed) and replies completion to user.
With such an architecture we can scale www without putting too much strain on politeiad and thus prolonging the usefulness of git as the backend in politeiad. In addition, this will reduce chattiness and reliance on d for all responses. RPC commands will be able to be trimmed down (don't reply with data at all, just status) and solely rely on cache for data answers.
The text was updated successfully, but these errors were encountered: