Gonza

Gonza

So for my resources, and assuming I can’t yet guarantee 100% uptime, is it either Postgres or SQLite? Is there a way of perhaps working with ETS and saving its state to disk from Ash? There is no MongoDB support just yet, right?


EDIT: A little context, in case it helps: My goal here is to a) simplify my systems as much as I can. If I could just do away with the database and all its accompanying headaches, I would be a happy man. And b) engineer my systems to be performant from the start. The fewer roundtrips to external services, the better. Again, if I could just work in-memory, for most or even all parts of my apps, it would probably be ideal.
I get that it’s not always realistic or feasible though, of course. I’m only trying to get the lay of the land for now, so to speak.

Showing Posts 1 to 10

FlyingNoodle

FlyingNoodle

So you want to build a system that should be persistent and scale also in the future but at the same time you don’t want to use the very software that was invented to do exactly this?

You can spin up a postgres instance somewhere for almost free and then connect to it using a query string. It can’t get any easier than this.

If you are not happy with the supplier of your DB as a service, you simply dump it, spin up a new copy somewhere else, load the dump and bob’s your aunty.

I would focus my efforts on trying to solve business problems and not re-invent things like performant persistent storage.

zachdaniel

zachdaniel

Creator of Ash

Ultimately, using PostgreSQL is that simplification. We have in memory options, and they are useful when you need them but the truth is (and this is true for pretty much any app, framework, language) that choosing an in memory store when a database would suffice is riddled with caveats, new challenges, and solving solved problems.

In the case of Ash, AshPostgres is the only data layer that supports every capability of Ash. AshSqlite doesnt support aggregates or atomic updates, but if you must eliminate a service, then I’d suggest using Sqlite and mounting it on a persistent volume.

There are very few universals in software engineering but probably the closest I’ve come to is “just use Postgres if at all possible”.

Gonza

Gonza OP

Gotcha. PostgreSQL is really my only option.

I guess I’m just a little wary about it. I have had bad experiences with minor version updates breaking the very format used to save the data so after a routine system upgrade I got backends refusing to connect and crashing. Happened at least once a year when I would use it. Later I got to work with MongoDB and that wasn’t a problem anymore. I guess I’ll just have to use a specific containerized version and leave it at that.

Thanks for your replies.

zachdaniel

zachdaniel

Creator of Ash

Interesting, I’ve not had that problem. In fact I’ve done Postgres major version upgrades in place across multiple major versions (and every major version since 9) and never had a problem :cold_face: Maybe you have bad luck :stuck_out_tongue_closed_eyes:

Gonza

Gonza OP

To be fair, I’ve never been an expert at PostgreSQL. Maybe I did something wrong. I remember distinctly the error message saying something like “This is PostgreSQL v x.y.z. Your database was created by version x.y-1.z, so we can’t read it and you’ll have to migrate it manually. Go to this website to learn how” More or less… The 2nd time it happened I just ran away and been avoiding it ever since lol

D4no0

D4no0

True, I’ve migrated once a 2TB production database from PG9 to PG14 using replication and it just worked out of the box, we were all shocked on how we did the migration in less than a week with a few minutes of downtime.

Gonza

Gonza OP

See, that’s exactly the kind of problem I am trying to avoid. It just seems so unnecessary to waste a whole week doing a maintenance chore when it should just run flawlessly IMHO, like it had been doing for the past weeks or months. Maybe I’m too used to MongoDB, but I would die a little inside if I had to pause my one-man-startup for a whole week every once in a while just because of a tool upgrade.

D4no0

D4no0

Please don’t try to twist my words, I never said anything was wrong with the running setup that was working for well over 7 years under some really heavy load. We migrated to the new version because we wanted some of the nicer shiny things for optimization and new features. We also changed caching configuration and tuned some other things for the new instance. It also took a week, because we did the migration with downtime under 5 minutes, that was a hard requirement.

If mongo works for you then nobody said not to use it, but I can say that I’ve used postgres for all the startups I’ve worked on and I would never consider using mongo ever, I am not a fan of their paid plan and the limitations around it, also the businesses I worked in, data integrity and database level validations were a requirement.

sevenseacat

sevenseacat

Author of Ash Framework

Your one-man-startup also isn’t looking at migrating a 2TB database over five major versions of PostgreSQL…

Gonza

Gonza OP

Sorry, I wasn’t trying to twist your words. I just saw that migration as a problem, but I see it wasn’t, only an opportunity you took to improve your system.

Thank you all for your replies. I learned a lot today

Where Next? Top

Trending in Questions Top

RSP87
I’m working on a project that simulates the bumbl example in the programming phoenix book. It acts almost like an email client. We have a...
New
nseaSeb
Hello, I know there is an approach for handling lists that allows for optimized traversal, but I can’t recall the specific method (somet...
New
RemyXRenard
I’m seeing that a list inside a Kino.DataTable will be interpreted as a charlist, even if the Kino.configure() is set to charlists: :as_l...
New
brecabral
Documentation While reading the Scoped Routes section, I noticed that the documentation currently refers to a problem without explainin...
New
velrest
So my question is quite simple and i have found no conclusive answer on forum, google or AI. Should we use :erlang.float for Integer to ...
New
samoloth
Hi, I’ve just set up an application with ash_authentication. There is only magic link strategy for now, so there is no confirmation add o...
New
FlyingNoodle
If a change or preparation module uses Ash.Changeset.get_argument/2 or Ash.Query.get_argument/2 (or any of the other get_argument functio...
New

Other Trending Topics Top

mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
marciok
Hi there! We created Gust: A task orchestrator inspired by Airflow. For those who have never heard about Aiflow, it’s a Python-based wor...
New
mhanberg
Hi everyone! The first release candidate for the Expert language server project is now available! We’ve published a press release detai...
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
Dmk
Xamal is a deployment tool for Elixir apps that deploys native releases to bare metal servers over SSH. It’s a port of GitHub - basecamp/...
New
netoum
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews