What postgres sync solution should I use to duplicate production, but read it from another application? I'm a little out of my league with my current problem, but I'm looking for a solution where the following conditions are met:


My production database reads and writes as it currently does
My production application ALSO writes everything to a 2nd remote database
The writes to the 2nd database are frequent and near real time
I have a separate application that can read from the 2nd database


Both applications are rails, and the main application/database is the product. The 2nd application is a custom built analytics service that only reads from the 2nd database.

Which postgres solution(s) can support these requirements?  Thanks.
It sounds like streaming replication with a hot standby is the solution you're looking for.

Streaming Replication details the steps of how you go about setting it up. The hot standby option that they go over (they have it put to "on" which is what you will want) will allow you to run SELECTS against the 2nd database. Under this setup, however, your production application would only write everything to the master database ... postgres itself would then stream those changes to the 2nd database.