-
Notifications
You must be signed in to change notification settings - Fork 179
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is it time to redefine the purpose of ActiveHash? #234
Comments
I know this is old, but since it's open i would like to pitch in. I am a happy user, but have gone beyond read-only I have written a small cms and use ActiveHash files as store. All edits happen on developer machines and so content changes flow in the same way as code canges. |
@rubydesign is there a reason why you don't want to use active record and SQLite? If the discussions are any indication, it seems many users want to go in this direction. I was curious for the reason. Understanding the reasoning is the best way to properly meet those needs. Then we can possibly update the goal in the Readme. We can also use this to guide our future direction |
On my current project, we use fixture files snd populate Postgres using |
@kbrock Thanks for asking, i did not expect this to be picked up. But as i said, i am a happy read/write user and would be happy to contribute back. For me the functionality has been very helpful. My use case is quite simple, the data is generated in development/staging environments. So db is not an option. Files are useful because the whole development process works around files. Then the question is, why do i generate data in development/staging. I think the answer is very very similar to the original project use case.
My needs are currently met in a single-user, non threaded implementation. Ie upon change i write all files out. |
@rubydesign thanks.
That makes sense. Storing yaml text data in git handles merge conflicts better than a bin file. So it would require adding imports and exports and a bunch of complexity. I've only ever used active hash for developer edited yaml files. My current team uses pot (via gettext) files for translations which are used across many ruby gems, languages, and frameworks. I just look at the complexities we are adding around mutexes, defaults, or quicker id generation. The new use cases seem like we're duplicating a standard rails database adapter. |
@kbrock That's the use, mostly, yes. And it is very useful (for me at least). I would imagine for translations too. Really a simple save for a collection would be enough. If you look at the method i linked, that's does a lot. I never understood why i have to do a reload there, but that simple save would be a good start that goes a long way. PS: sorry about the intermittent communication, i am in the mountains of Tuscany and there is surprisingly bad network coverage. |
I'm not a very active maintainer at this point, so feel free to discount my opinion; but I think it's a very bad idea to try to turn this gem into a transactional database. That is surely going to be a ton of work to do correctly, and will greatly increase the demands on the maintainers and the support burden (and I'm personally not prepared or willing to take that on). If people need something more advanced than a yaml file then I would strongly recommend looking into using a sqlite database that can be deployed with the app. If anyone feels super strongly that they want to go in this direction: would you consider forking this project to try to support those more advanced use cases, rather than introducing that complexity here? |
Hey @flavorjones My issue is that we seem to already be going in this new direction. examples:
A read only database probably doesn't need a mutex or id creation. Right? I wanted to know if others felt we were starting to veer in this new direction and see how they felt about this. |
Ok, since i have been pro saving here i just want to retract that. I fully understand that open source is collaboration and not making feature requests and don't want to add to anyone's burden. It just took me a couple of days to rewrite everything that i need, which includes save. Not multi threaded, and no ActiveRecord relations. just 140 lines of dense code that does what i need Thanks for the code/ideas i lifted and the code i used before. (torsten out) |
@rubydesign sorry I didn't reply sooner. That turned out nicely. I would have thought you'd just go towards using a sqlite database and stock ActiveRecord, but this looks like it meets your needs well. |
Yes, remember i needed the text files. For my "developer cms" that integrates into git workflow. I finally managed to publish it, thanks again for the hand up. https://rubygems.org/gems/breeze_cms |
Has the purpose of
ActiveHash
changed?Many of the recent feature requests feel like it is going towards an in-memory thread safe transactional database.
README.md
[ref]I read that
ActiveHash
is an alternative to storing reference data in the database or in constants.It even has a suggested migration plan for when requirements change and data is no longer read only. Then it suggests migrating the model to the standard SQL datastore. (or sqlite with
":memory:"
)Question
I don't feel that this library and the definition of this library match.
Is it time to re-evaluate the use cases for this library?
Hopefully update the statement at the top of
README.md
?The text was updated successfully, but these errors were encountered: