In my previous post, I have provided step by step process to setup Heroku Connect with your app and Salesforce. We will use same as a base for this post and continue the solution. If you want to go to my previous post, here is the post link Seamless Integration with Heroku Connect
In this post, we will try to do some changes in the database from the app and sync them with Salesforce to reflect the changes there as well.
I have used NodeJS for this post to create a server and connect with Postgres to access this newly created Database. I have specifically created a wrapper to do all basic CRUD operations(CREAD, READ, UPDATE, DELETE) with this database. They are pretty clear and I am adding all the logic below.
Hope this helps!