rtj

rtj

Best DB for chat

Hello everyone
I would like to know which database you prefer for chat applications?
I do not know if traditional databases are preferable or maybe there is some other option that works well with Elixir / Phoenix?

I would appreciate it if you can share your experience.
In this case it will be a fairly complete and large chat app.

Thanks

Most Liked

OvermindDL1

OvermindDL1

Eh, I’d honestly just use PostgreSQL for all that, it even has very advanced searching abilities that can out do elasticsearch in many cases, all while using the same database so no worry about things getting out of sync. Plus a chat app is mostly write and read with little to no ‘updating’, which is the perfect use-case for PostgreSQL (it flies the less ‘updating’ you do, mostly just reading and writing).

DianaOlympos

DianaOlympos

In general : Do Not Use Cassandra except if you have a really really good team of devs or a really really good team of Operators/SRE. And i would probably put a and here instead of a or if i could.

Cassandra seems nice from the outside, but it is really hard to operate and really hard to develop for, especially if you care about not losing data or getting acceptable time frame for answers.

JEG2

JEG2

Author of Designing Elixir Systems with OTP

I feel this is a rare problem to have and once you do have it, you’ll have the resources to address it.

brightball

brightball

I’d tend to agree with this assessment.

Plus, you also need to think about how the data is related before you think about scaling strategies. With a Chat app every message in the system is basically grouped by “room”. Whether that room accounts for 2 people or a group of people depends on your interface.

When it comes to scaling it, this is a data structure that is very, very easy to shard because you can shard by “room”. All that’s required to make it work is to have a central point to act as a directory of which rooms is on which database and then you can query conversation from there.

What I’m getting at is just, don’t dive to deep into trying to find some ultimate database that can spread itself across hundreds of machines when your data naturally separates into manageable chunks. Those “spreading” solutions become necessary when the data doesn’t separate so easily.

idi527

idi527

Then probably genserver + postgres will work fine.

Where Next?

Popular in Questions Top

JDanielMartinez
Hi! May someone helps me, please! I have two apps into an umbrella project: the first one is Database, which manages queries, and the se...
New
gshaw
What is the idiomatic way of matching for not nil in Elixir? E.g., First way: defp halt_if_not_signed_in(conn, signed_in_account) when...
New
itssasanka
Hi all, Trying to get some more clarity over utc_datetime and naive_datetime for Ecto: https://hexdocs.pm/ecto/Ecto.Schema.html#module-...
New
New
SoCreat
i’m a new one to elixir which editor can i use vs code? or atom? Thanks! :smiley:
New
chensan
I have a User schema with a :from_id field set to type :string: defmodule TweetBot.Repo.Migrations.CreateUsers do use Ecto.Migration ...
New
Fl4m3Ph03n1x
Background Let’s assume I have a typical GenServer that receives messages as requests, does some operation in a DB and returns responses....
New
mathew4509
I have a list say x = ["23gh", "56kh", "97mh"] I would like to pass each element to Val in each iteration. Say, in iteration 1 -------...
New
lucidguppy
I have a super simple question about elixir - how would I take a file like this foo bar baz and output a new file that enumerates th...
New
jc00ke
Expanding on this topic: https://forum.elixirforum.net/t/map-typespec-question/19217 Let’s say I have a map with required and optional k...
New

Other popular topics Top

peerreynders
Manning 2016 Halloween weekend sale via Deal of the Day Friday, October 28 - Half off all MEAPs - code WM102816LT Saturday, October 29 ...
326 29600 154
New
openscript
Hello! Sorry for this astonishing simple question, but I’m really stuck. I try to set up the intellij-elixir plugin, but I don’t know ho...
New
aalberti333
As the title describes, I’m trying to run Enum.map() over a list of key/value pairs, where the value is a map. My data looks like this: ...
New
AstonJ
You’re a programmer, so you don’t need spoon feeding with the conventional drivel about “this is an integer.” No. You need to know what’s...
New
jononomo
I am trying to figure out how Mix knows whether the environment is test, dev, or prod -- where is this set? Thanks.
New
hariharasudhan94
I would like to know what is the best IDE for elixir development?
New
mgjohns61585
Could someone help me? I'm making my first elixir program, number guessing game. I can't figure out how to convert the user's guess from ...
New
Patoshizzle
After calling mix ecto.create I get this error: 17:00:32.162 [error] GenServer #PID<0.412.0> terminating ** (Postgrex.Error) FATAL...
New
lucidguppy
I have a super simple question about elixir - how would I take a file like this foo bar baz and output a new file that enumerates th...
New
joeerl
Hello again - after a longish gap I’ve decided I really must dig into Elixir and see what’s been happening here - so I have a few questio...
New

We're in Beta

About us Mission Statement