Posts

Showing posts from 2021

What is Papertrail? Uses and Advantages

Papertrail is basically a log management tool used for catching Heroku systems and build but not limited to. It has been useful because on Heroku we can check live logs and can't check logs for the previous requests except for logs for the deployment process. So below are some of the key features which paper trail providing us: Recording the system logs live and we can also look into the logs of the past (from n no. of days up to a year) based on the plan we choose. It allows searching past logs by date-time, string or regex. It also allows us to configure alerts (emails, Slack) for a specific type of request failure response like time-out, system error or even request taking time more than a particular limit. It allows us to set filters for logs to save or not to save. Some advantages we seek from Papertrail are: Heroku adon is available with one-click installation like other adon. Fast and easy search interface. Able to store long time period logs history (up to 1 year) Custom al...

How to Upgrade or Downgrade Heroku Postgres adon plan

Image
If you are using Heroku and Postgres adon in your project, by the time you may want to upgrade or downgrade Heroku Postgres adon plan based upon your project's database size decrease or increase with time. Although you can follow Heroku documentation for the purpose: Changing the Plan or Infrastructure of a Heroku Postgres Database But I wish to introduce you to another way to upgrade or downgrade the Heroku PostgreSQL Database adon plan. In this process we have 3 steps to follow: 1. Add additional Heroku Postgres adon with the desired plan (you want to switch) using the below command:      heroku addons:create heroku-postgresql:adon-plan --app your-appname Where `adon-plan` can be replaced with the desired plan from the plan list and `your-appname` with your application name. 2. Now copy your database from the old Postgres adon to the newly added Postgres adon.           heroku pg:copy HEROKU_POSTGRESQL_MAUVE_URL HEROKU_POSTGRESQL_PINK_URL ...

Differences between json and jsonb - JSON data type in PostgreSQL

You may have read differences between PostgreSQL datatypes JSON and JSONB. If not, let see the difference between both theoretically and practically. Although, both json and jsonb are types of PostgreSQL JSON datatypes and accepts almost same format as input values i.e. json. But still there are some difference which one must know to efficiently use or can choose from both json and jsonb.  The main different is how they actually store data; the json data type stores input value as it is but  jsonb stores value in a decomposed binary format which lead to difference in  efficiency .  Jsonb is slower as compare to json while saving the input values because of converting json values to binary format before saving. Jsonb fast in processing the data because no re-parsing needed as compare to json datatype which needs processing function to re-parsing on every execution. Few other differences between json and jsonb are: Jsonb supports indexing which is advantage over j...