Always have a “.dockerignore” and always have “.git” in it

Without “.dockerignore” the whole directory where Dockerfile is in will be sent to docker daemon, which may be huge And always create a “.git” entry in the file, because this directory can be very big. P.S. Failling to do this may lead to the hanging of “docker-compose up”. It will show the following message: You …

Always have a “.dockerignore” and always have “.git” in it Read More »

Best practice: all Postgres tables can have these columns

They should all have these columns: Primary key: id , bigserial (which creates a sequence behind the scene) Date created: utc_created – Use current timestamp as a default value Date updated: utc_updated – Use a trigger to automatically update it (See code below) Creator: created_by – text type, can be anything Updator: updated_by – text …

Best practice: all Postgres tables can have these columns Read More »

Timezone choice for Postgre and things to do in Java

Always use UTC as the timezone for postgre timestamp/date columns, which is considered to be the best practice and recommended by Postgre, e.g. And you java application is normally using LocalDateTime/LocalDate, if your system is not a global operation. So there needs to be a conversion in data access layer of you java application. According …

Timezone choice for Postgre and things to do in Java Read More »