rtj

rtj

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

Showing Posts 1 to 10

idi527

idi527

I would try

  • scylla [0] for storing messages,
  • postgres for storing user metadata (might replace with cockroach [1] for lolavailability, it’s definitely production ready, hit 1.0 a few weeks ago),
  • elasticsearch for, well, searching through all those messages and users,
  • prometheus 2.0-alpha [2] for collecting and storing metrics (2.0-alpha because stable is way too stable)

[0] http://www.scylladb.com
[1] https://www.cockroachlabs.com
[2] https://prometheus.io

Actually, even though cockroach is very nice, I might still stay with postgres because of postgis (might come in handy if you plan to support location sharing, “users nearby”, “boys from my hood” etc.).

Note: I’ve never written anything more complex than a “hello world.” So you should really just skip to the next answer.

venkatd

venkatd

How much traffic do you expect on it? I would keep it simple and stick to Postgres. It plays well with Ecto, widely used in the industry, better tooling, easy to setup, etc.

Qqwy

Qqwy

TypeCheck Core Team

I’m sorry for answering your question with somewhat of a non-answer, but it has to be mentioned: A Little Architecture by ‘Uncle Bob’.

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).

WolfDan

WolfDan

Any example for advances searchings with postgre? I’m interested :o

JEG2

JEG2

Author of Designing Elixir Systems with OTP
idi527

idi527

Sure, it’s just that master-master story in postgres is still far from perfect, although postgres can make it far without any need to scale/replicate, but then (in case the chat app is international) I would want to spin up a database server on each continent in an attempt to reduce latency, and that would make postgres a bit harder to operate.

Also @rtj, you might want to read this A Comparison of Advanced, Modern Cloud Databases — brandur.org.

OvermindDL1

OvermindDL1

PostgreSQL has some pretty great libraries now for such replication, two main styles too (one replicates the raw data, always perfect consistency, the other replicates commands, much less bandwidth).

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.

jeramyRR

jeramyRR

I feel like everyone here has forgotten that Whatsapp uses only Mnesia (or at least used too, I’m not sure about anything after 2014).

Where Next? Top

Trending in Questions Top

stjefim
Hello! Suppose you are building workflow (order / task / payment) processing system with the following requirements: Each workflow con...
New
water
I’m aware of 2 such projects, are there others? git: GitHub - team-alembic/realworld: A fullstack Phoenix LiveView application with back...
New
peck
Hi everyone. My team and I have been working on a fairly modest app based around video streaming and chat, but we’ve landed a customer t...
New
bradley
I really like the adapter patterns that ecto, nebulex, waffle, etc. use and would love find something similar for a key management servic...
New
unaware8150
Hello folks! So at work, we are seeing some situations where we have to define some “fixed” strings that are used across the codebase in...
New
Alvinkariuki
How Can I Optimise Compile Time Dependencies I have been building an elixir application for about 2 years now. Many modules and files ha...
New
leoschweizer
Hi, we run different LLM models across a cluster, with each node loading a configurable subset. Model-specific queues let nodes consume ...
New

Other Trending Topics Top

mudasobwa
I fully migrated to my own harness from Anthropic/Gemini and I think it’s time to share it. Welcome DSH, the DeepSeek Harness, fully writ...
New
KristerV
Hey. Is there anyone here who creates agents in their apps? Not talking about using agents, but creating them. I’m finding it pretty diff...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
juhalehtonen
There has been a thread to discuss the Stack Overflow Developer Survey on this forum every year since 2018, so here’s yet another one for...
New
webofbits
With AI doing more of the implementation work, I’ve been wondering how much coding I should deliberately keep doing myself. My main conc...
#ai
New
budgie
I love Elixir. It’s one of 2 programming languages I’ve ever fallen in love with. But I don’t use it anymore. Serverless was the promis...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews