dojap
Have any of you compared MySQL vs PostgreSQL resource usage in your Phoenix app? I would go with Postgres but I am afraid that because my site is mostly about reads (MySQL is better here) and less about writes (Postgres is better here) Postgres would be a bad choice. Also, apparently Postgres is much more RAM hungry and spawns more processes and MySQL can handle more connections with the same amount of RAM.
But this is only stuff I read, I have no real world experience with this.
Have any of you tested both MySQL and Postgres with your Phoenix app? What were the results?
Trending in Questions
Hello!
Suppose you are building workflow (order / task / payment) processing system with the following requirements:
Each workflow con...
New
I’m in search of an Elixir library that offers PDF generation capabilities similar to Ruby’s Prawn. While there have been discussions abo...
New
I’m looking to build a personal workflow to quickly deploy web applications written in elixir/phoenix, for local consumption (ie not on t...
New
Before I dive in myself, did anyone successfully sprinkle Hologram into their existing LiveView app?
Looking for hints regarding:
Addi...
New
Hi all, I wanted to ask how the community is dealing with post-release steps.
Today we have Ecto migrations, which make sure that the db...
New
Kia ora,
We have been using elixir-google-api to connect to Google Drive. However, with the updates to Tesla due to CVEs this is now bro...
New
I am using Oban and occasionally, shortly after a deployment, a handful of jobs can fail because of dependency on other parts of the syst...
New
Other Trending Topics
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge & Solve.
They are GUI (Emerge) and State management (S...
New
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
Emily is an Elixir library that runs Nx computations on Apple’s MLX. Install it as the default Nx backend and Nx, defn, Axon, Nx.Serving,...
New
I just stumbled on a newly redesigned elixir-lang.org. :tada: It looks like @Software_Mansion did the work, and I think it is generally a...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #blog-post
- #phoenix_html
- #iex
- #graphql
- #genstage
- #ai
- #elixirconf-us
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #metaprogramming
- #security
- #hex










First 10 of 22 Posts
hauleth
Until you grow to the size, where you will be able to hire someone to handle that for you, then you will probably do not see any difference.
It is hard to tell what will work better in your particular use case, so you will need to do benchmarking on your own. However I think that you will still see no difference, and if so, it will be indistinguishable from noise.
dojap
This is from here: PostgreSQL vs. MySQL: 9 key criteria to drive your database decision
derek-zhou
In most sane environments there is a connection pool so the number of connections are bounded. The per process in PG overhead is not a big deal.
If I have to some layman comparison between PG and MySQL I would say that PG is more dev friendly, and MySQL is more ops friendly.
dojap
Thanks, I think I will go with MySQL then.
The scaling in the future factor is a huge plus of MySQL.
Also Uber went back to MySQL from Postgres. So, if MySQL can handle Uber it will be ok for me, I guess. MySQL also seems to be better configured for common web usage out of the box.
Postgres seems to need much more research and learning how to configure stuff out of the box.
The advantage of being able to embed Postgres with my app because of it’s liberal license is not important for me because it’s a web service hosted on a server and not a stand alone program. So, the MySQL license is ok for me for my web project meaning the SaaS is what I am after anyway.
Also, again, MySQL seems to be focused on web usage a lot, meaning much more reads than writes, as mentioned here: PostgreSQL vs MySQL: The Critical Differences | Integrate.io
Perhaps some realtime data input recording would be a better case for Postgres, I think in my case MySQL is the better option. 98 - 99% of everything in my service will be reads, only a tiny fraction will be writes to the database.
hauleth
This shouldn’t be a problem until you really grow.
Because for their particular use it was better. And their usage was quite specific as they are basically using DB as a KV store.
It also could handle Google. On the other hand Heat, Algolia, Netflix, Instagram, etc. use PostgreSQL. Using some piece of technology just because “X uses it and it works for them” isn’t wise. It is following trend, which isn’t always good thing.
I am on the PostgreSQL side, mostly because of it broader support for the SQL standard and also some useful things that make life much easier. For example tuple comparisons, support for array columns, better support for CTEs, more index types, better defaults, better UTF-8 support, etc.
Then maybe you do not need DB at all, and instead, for example, single file that would be loaded into memory would be better solution?
dojap
Thanks. I am curious in this part. I will now read about the utf8 support you linked, but could you explain the other things, or link to explanations if you don’t have time to explain that? Thank you.
My web is using relationships, I use joins. Table structure is perfect for me. I think in tables. One file would be weird. Especially with that amount of data present there.
Also, isn’t the MySQL or Postgres DB loaded in the memory as well? For example, the more DBs I have and use the more RAM the mysql/postgres is using on my computer.
focused
Maybe try Clickhouse for high speed “selects”, it is very very fast for reads; updates and deletes (mutations) not designed for frequent use. It has Ecto support, but I did not try it, I wrote plain SQL queries in my service.
dojap
Wow, thanks for the tip. Why isn’t this Clickhouse DB more widely known and promoted? Is there a catch? Can you recommend some nice summary or presentation on Youtube about this DB?
focused
It is useful primarily for stats and analytics, when you collect and insert user data, and later read it for analysis, but you may use it for any kind of content that requires often reads and almost no updates/deletes. Sorry, I don’t know any presentation or video.
This is how I used it in my microservice:
dojap
Thanks. Great. Does Ecto support Clickhouse DB?