Search code examples
postgresqlauthenticationorientdbelixirphoenix-framework

Is it ok practice to have a different database just for user authentication?


I started building an API with the Phoenix Framework. I just started learning Elixir and Phoenix so please excuse my lack of knowledge.

The data structure for my app relies on heavy use of relationships over multiple nodes. So I plan on using OrientDB. There is an OrientDB driver for Elixir. But so far it is just a binary driver and not integrated with Ecto. And there is a Token authentication solution for Phoenix (Marco Polo) using Ecto.

Since I am just building a prototype and am not that good with Elixir yet I think about the best way to deal with the missing link. Start integrating Marco Polo with Ecto or just store the user information for authentication in PostgreSQL. I then would have to mirror the users in OrientDB to be able to link them to records.

At the moment I favor using PostgreSQL and OrientDB together. Is there a downside I am not aware of? Has anyone done something similar and can share their experience?


Solution

  • A lot of big companies use different databases for authn versus regular application data storage. For example, most big companies use LDAP, and do the authn there.

    It's a mild PITA to sync user info between the two, but it's really the only way if you want centralized users and have many applications. It's probably more secure too, if the passwords only live in the authn database and never in the application databases.