Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

A few week ago I discovered Postgres Schemas (worst named feature ever -- nothing to do with SQL schema definitions). Basically, schemas allow you to have multiple databases within a single database. So, you only need to manage (or host/pay for) a single database but each company can have their own schema which gives you complete separation of data across all the tables.

These, together with the Apartment gem for Rails, makes building isolated multi-tenant applications really easy. It also makes migrated to a true multi-database/multi-server/sharded setup much simpler.



If you were using Oracle or MS SQL you'd be quite familiar with what Postgres calls a schema.

The SQL standard as I understand it is very vague on how schemas should be implemented beyond the information schema.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: