User rights management in PostgreSQL compared to MySql and Oracle

PostgreSQL has slightly different approach of user rights management comparing to MySql and Oracle. In this article, we will cover very basic concepts how to setup users for your application / maintenance people.
Just for reference we will shortly overview user rights management topic in MySql and Oracle databases as well.

MySql

MySql uses concept of databases, which are in general collections of objects (tables, views, procedures, etc). Users are managed on instance (server) level and might have global, database or object specific privileges (see manual for details).

CREATE USER 'myUser'@'localhost' IDENTIFIED BY 'myPassword';
GRANT ALL PRIVILEGES ON mydb.* TO 'myUser'@'localhost' WITH GRANT OPTION;
GRANT SELECT, UPDATE ON hrdb.* TO 'myUser'@'localhost';
GRANT INSERT ON erpdb.item TO 'myUser'@'localhost';

Continue reading

Enabling authentication in MongoDB 3.0

By default MongoDB 3.0 starts up with disabled authentication, meaning that anybody can access our sensitive data, modify or delete it. Obviously, authentication should be enabled on any more or less important database. Official documentation have separate chapter dedicated to this topic, but I have found it really hard to follow by begginer like me.

First of all, MongoDB has to be started with enabled authentication. It can be done via command line argument:

bin\mongod.exe --auth

Or via similar config file option:

dbpath=./data/
auth=true
smallfiles=true
nssize=2

YAML style:

storage: 
  dbPath: "./data/"  
  mmapv1:
    smallFiles: "true"
    nsSize: "2"    
security:
  authorization: "enabled"

Continue reading

Synchronizing stuff between developer’s machines

I have quite common situation – two machines used for development: the laptop, which I’m using in university, and more powerful workstation (PC) used at home. And so far such simple use case as synchronizing different stuff between my machines is not fully resolved by modern tools.

The most painful topic is sync of software (mainly various IDEs and tools) and its configuration. I’m trying to use (or create own) portable versions of tools as much as possible, because in that case the software sync problem is reduced down to file sync use case. I have tried various tools for it and so far have found more or less good combination of them for my needs.
Continue reading