Gonza
What are the persistence options in Ash?
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.
Marked As Solved
zachdaniel
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”.
Also Liked
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.
Gonza
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
frankdugan3
Postgres releases require the use of pg_upgrade for major versions, while minor versions will migrate seamlessly. Every distro handles this differently, but Arch specifically expects you to do the upgrade yourself. It’s a minor nuisance, but major Postgres releases only happen once a year.
Edit: Forget to mention, but on Debian, I think most people use the official apt repo the Postgres team provides, which namespaces by version number. So, you never get caught off-guard with a version change while installing updates. Or they provide the option of using one that automatically upgrades and migrates for you, always keeping it the latest version without hassle. That’s what do personally.
Popular in Questions
Other popular topics
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
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #advent-of-code
- #elixirconf-us
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #performance








