Tropeçando 78

Replicação: o que mudou

Detalhes das mudanças na replicação do PostgreSQL desde a versão 9.0 até a 9.6.

What the hell are Generics and would I want them in PHP?

So everyone is talking about this hip “new” kid on the block for PHP: Generics. The RFC is on the table and a lot of people are getting all excited about it, but you don’t fully see the excitement? Let’s explore what it’s all about!

The Easy Way to Setup PostgreSQL 10 Logical Replication

PostgreSQL workings in one picture

With the below illustration I attempted to capture key processes that encompass Postgres workflow. Here is a quick overview.

Speeding up Application Development with Bootstrap

Bootstrap is one of the best and most used HTML/CSS/JS front-end frameworks. Almost any web developer who has made a website or two has heard of this popular framework. It offers so many ready-made components and resources, Bootstrap can significantly speed up your application development.


Tropeçando 77

How to Measure Execution Time in Node.js

Design Pattern Workshop

Recently on the pgsql-performance mailing list, a question popped up regarding Postgres RAM usage. In this instance Pietro wondered why Postgres wasn’t using more RAM, and why his process was taking so long. There were a few insightful replies, and they’re each interesting for reasons that aren’t immediately obvious. Let’s see what is really going on here, and perhaps answer a question while we’re at it.

Ativando o Optimus NVIDIA GPU no Dell XPS 15 com Linux, mesmo na bateria

New Features Coming in PostgreSQL 10

Postgres 10 highlight - SCRAM authentication


Tropeçando 76

Crie um proxy SOCKS em um servidor Linux com SSH para ignorar filtros de conteúdo

O método mais rápido para melhorar o desempenho de qualquer Servidor de Aplicações Web PHP usando MySQL ou PostgreSQL

Getting first and last values per group

Every so often someone needs solution to getting first (or couple of first) values for given column. Or last. For some cases (when there is not many groups) you can use recursive queries. But it's not always the best choice. Let's try to implement first() and last() aggregates, so these could be easily used by anybody.

Roadmap to becoming a web developer in 2017


Tropeçando 75

Dply – Serviço permite criar um servidor Linux na nuvem que fica disponível por 2 horas gratuitamente

Promise Anti-patterns

Promises are very simple once you get your head around them, but there are a few gotchas that can leave you with your head scratching. Here are a few that got me.

PG Phriday: Why Postgres

Generic HTTP Error Handling in AngularJS

Lately during development at one of our clients, Ravello Systems, we decided we wanted better HTTP error handling.

Basically, our perfect solution would have generic handlers for errors, and most calls in the code will not have to do any special work for handling errors. This means that things like authentication problems, server unavailability issues, etc. will be handled in one place — like adding a generic “something went wrong” modal.

The Fastest Method to Evaluate Tune the Performance of Any PHP Web Application Server using MySQL or PostgreSQL

In the Web development world, we often have the problem of choosing the right server to use in the production environment of a Web application.

Maybe we need to buy a new server to handle the expected load, or maybe the customer wants to deploy in an existing server.

In any case, if after deploying and running the application it will show poor performance, then we need to ask the team what we can do to make the application faster or use a better server.

Therefore we need to determine if the application is performing well. Read this article to learn how to quickly determine the performance of an application on the current server.

Postgres 9.6 Features

The Definitive Guide to DateTime Manipulation

As a software developer, you can’t run away from date manipulation. Almost every app a developer builds will have some component where date/time needs to be obtained from the user, stored in a database, and displayed back to the user. – My personal OS report

The script collects a lot of information about the running system and save the output of each commands in a text file, and saves copies of important files in a directory named files. At the end of the script everything is compressed with tar in the global directory.

Faster PostgreSQL Counting

Everybody counts, but not always quickly. This article is a close look into how PostgreSQL optimizes counting. If you know the tricks there are ways to count rows orders of magnitude faster than you do already.


Tropeçando 73

Tables and indexes vs. HDD and SSD

Although in the future most database servers (particularly those handling OLTP-like workloads) will use a flash-based storage, we’re not there yet – flash storage is still considerably more expensive than traditional hard drives, and so many systems use a mix of SSD and HDD drives.

pgBackRest 1.0 Released

The first stable of release of pgBackRest introduces a new, more capable repository format, simpler configuration, and comprehensive support for backup and restore of symlinked directories and files.

Visualização de Postgres Plan Query

Uma ferramenta que pode fazer planos (EXPLAIN) simples de entender e visualmente agradável.

PG Phriday: Trusty Table Tiers

Well, there is another way to do partitioning that’s almost never mentioned. The idea is to actually utilize the base table as a storage target, and in lieu of triggers, schedule data movement during low-volume time periods. The primary benefit to this is that there’s no more trigger overhead.

Safe and unsafe operations for high volume PostgreSQL

If I run a bad command, it can lock out updates to a table for a long time. For example, if I create a new index on table, I cannot create new record in this table while that index is building. Anyone who tries to make a record in this table will block, and possibly time out, causing a partial outage. In general, I am ok with database operations taking a long time. However, any operation that locks a table for updates for more than a few seconds means downtime for me.

I decided to make a list of an operations, which can be done safe (without downtime) and usafe.




Tropeçando 72

A simple JSON difference function

A function that would take two JSONB objects in PostgreSQL, and return how the left-hand side differs from the right-hand side.

Deadlocks in PostgreSQL

Compreenda os tipos de lock existentes no PostgreSQL, como ocorre um deadlock e pesquisar o causador do lock.

PG Phriday: COPY and Alternative Import Methods

Alternativa para cópia de conteúdo de arquivos para o banco de dados.

Always Do This #4: Put stats_temp_directory on a memory file system

The PostgreSQL statistics collector generates a lot of very important statistics about the state of the database. If it’s not working, autovacuum doesn’t work, among other problems. But it does generate a lot of write activity, and by default, that goes back onto the database volume.

Instead, always set statstempdirectory to point to a RAM disk (which has to be owned by the postgres user, with 0600 permissions). The statistics are written back to the database on shutdown, so in normal operations, you won’t lose anything on a reboot. (You’ll lose the most recent statistics on a crash, but you will anyway; the statistics are reset on recovery operations, including restart from a crash.)

This can substantially cut down the amount of write I/O the main database storage volume has to receive, and it’s free!

Putting stats_temp_directory on a ramdisk

When statistics are not generated, we can have, among other problems, the halt of the autovacuum execution. As a consequence of the problems caused by the interruption of statistics collection, large spikes in writing activity end up occurring, which overloads server utilization. Changing the stat_temp_directory setting can prevent this.


Tropeçando 71

PG Phriday: Displaced Durability

Há tabelas que possuem dados com os quais você não se importa de perdê-los. São situações de dados transientes, como áreas de dados passageiros, tabelas temporárias persistentes, tabelas com dados crus de importação. Por quê não aproveitar o fato do PostgreSQL oferecer a opção de ser UNLOGGED? Ainda mais porque pode-se evitar usar recursos do servidor desnecessariamente.

Check your pg_dump compression levels

Ao realizar backups do banco PostgreSQL, há muitas situações em que encontramos uma sobrecarga inesperada e o nível de compressão escolhido para fazer o backup pode ter ação direta sobre isso. Como a compressão nem sempre é tão importante, não esquecer este detalhe pode poupar incômodos desnecessários em operações de backup que não as rotineiras.

How to install an Opensource VPN Server on Linux

Instalação de VPN própria para assegurar o controle do tráfego em conexões.

Filtrando e validando dados no PHP com filter_var()

Entrada de dados é uma característica de quase a totalidade dos sistema ou sites. É indispensável, para segurança dos dados, filtrar esta entrada a fim de evitar invasões, roubo de dados ou inconsistência. No PHP, aprenda a fazer isso usando filter_var().

FFmpeg no Ubuntu: veja como instalar esse pacote no 14.04/14.10 via repositório

Trabalhando com logs no PostgreSQL

Dicas de configurações de log em servidores PostgreSQL. As informações contidas em logs são essenciais em muitos problemas e importantes para a saúde da aplicação e do sistema de banco de dados.


Tropeçando 70

Estressando CPU, memória RAM e disco rígido com stress-ng no Ubuntu

Um programa para realizar teste de estresse em recursos do computador. Com isso, será possível conhecer melhor os limites da máquina.

Developer’s Guide to Open Source Licenses

Building REST API for Legacy PHP Projects

PostgreSQL 9.4 streaming replication over SSL with Replication Slots

Export to xls using angularjs


Tropeçando 68

PG Phriday: 10 Ways to Ruin Performance: Functionally Bankrupt

O uso inadequado de funções em consultas e índices e que arruinam a performance do banco.

A arte da linha de comando

Fluência na linha de comando é uma habilidade muitas vezes negligenciada ou considerada obsoleta, porém ela aumenta sua flexibilidade e produtividade como desenvolvedor de diversas maneiras, sutis ou não. Este texto descreve uma seleção de notas e dicas de uso da linha de comando que me parecem muito uteis, quando usando o Linux. Algumas dicas são elementares, e outras são mais específicas, sofisticadas ou obscuras. Esta página é curta, mas se você souber usar e lembrar todos os items que estão aqui, então você está mandando bem.

Verify that a network connection is secure

Através da captura dos pacotes que trafegam na rede em que você está conectado, verifique se há vulnerabilidades e a  possibilidade de desvio das informações quando você está usando protocolos de encriptação.

7 Essential JavaScript Functions

Funções JavaScript utilíssimas: debounce, poll, once, getAbsoluteURL, isNative, insertRule, matchesSelector

PG Phriday: Partitioning Candidates

Entendendo quando tabelas são boas candidatas ao particionamento

Is sending password to user email secure?

Salvando diff em HTML

PG Phriday: Dealing With Table Bloating

Menu slide-down com seletores avançados


Tropeçando 67

Changing Owner of Multiple Database Objects

Partitioning – what? why? how?

PG Phriday: 10 Ways to Ruin Performance: Out Of Order

Is it really not possible to write a php cli password prompt that hides the password in windows?

Esconder a senha que está sendo digitada em um programa de PHP em linha de comando.