-
Notifications
You must be signed in to change notification settings - Fork 53
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
Insights wanted on gstore-node! :) #101
Comments
Datastore schemas are so dynamic, down to the point of defining indexes per record/entity, as opposed to indexes on the entire Table/Kind. So I can create one record with an index in one column, and another record without that index in the same column. So you might be onto something about Datastores not being used with schemas in mind. I see the usefulness in schema validation though. One thing I'm a little concerned about is memory consumption. I made a simple Google Function using gstore-node and a single request to the API used 80MB of memory. I think it's a bit too much, but I'm not sure whether this is coming from gstore-node or google/datastore, or my own code. For comparison, a Google Function using Sequelize connecting to MySQL uses about 30MB or memory. I didn't have the chance to test things yet as I'm not currently working on APIs and it's going to take a while until I can. But once I have a chance, I'll let you know of my findings. |
@pauloddr Thanks for your insight. I can understand perfectly the need to have this flexibility of dynamic fields. It's the beauty of Schemaless :) But I don't see a use case where you don't want a property being indexed for some entities and for others you do. Don't you expect consistency in the Queries result? For the memory, if you have time to make the same test with google-cloud/datastore it'd be great! 😄 I don't think, with a few Models (that's what you'd have I guess) gstore adds much memory, but I might be wrong. I will look into this also to make sure. 👍 |
@sebelga A use case for not wanting to index a property for some entities might be properties that can be larger than 1500 bytes on occasion. Does this library offer any kind of functionality to easily keep track of entity counts by any chance? This is a problem I am stuck with at the moment (using sharding counters but running into problems with transactions expiring too quickly under heavy load with lots of updates). I would really like to try this out. Hope I'll find the time. 🕚 (If this lib would help me with the counting problem, I think that would save me a lot of time. I'm beyond all deadlines atm. 😅 ) |
@trollkotze For your "counts" issue, I have in my todo list (for some time now) the task to add an abstraction to automatically shard entities with a counter built-in :) But I haven't had the chance to work on it yet. Can I ask what do you mean by "transactions expiring too quickly"? const gstore = require('gstore-node')();
const { cache } = gstore;
// read
cache.get('user-count').then(...);
// write
cache.set('user-count', 12).then(...); |
Hi @trollkotze You are probably doing something wrong as 60 seconds is a lot 😄 But it'd be better to get help and insight in a separate issue ticket. Just for info https://redislabs.com/ has a free tier of 30MB which is plenty for a counter 👍 Cheers! |
Yes, I had that on mind, now especially after having looked deeper into your library, but deciding not to use it, because I see a lot to improve. I have not much time at the moment to get deeper into this and provide constructive criticism or ideas, because I have to get finished with something. But it has helped me to find into Redis at least, which I am now using besides Cloud Datastore, and I hope to come back here when I find time, because I really like the idea of this project. And yes, I am already using RedisLabs free tier now for testing, will use enterprise tier in production as well. Thanks for the tip! (It seems I cannot delete my long rambling comment from here, after I just moved the issue over to here. I guess it makes sense to keep this thread clean, so feel free to remove it here.) |
Looking forward for your insight and how we could improve the lib. Whenever you have time! 👍 |
@sebelga I'm trying to remember how I first found your package... I think it was via I use Datastore as a backend for GraphQL APIs and |
Thanks for the input @carnun ! Yes, I do think the visibility of gstore might be improved, I wish I had more time to blog about it. Let me know about your blog posts when you have them, I am interested to know more about your stack (didn't know about TypeGraphQL, very interesting). |
Hello to all of you using gstore-node!
I'd like to ask you something... What do you think could be done better to make gstore-node more visible/used by Node.js developers that are currently simply using the "google-cloud/datastore" package?
When I see the stats in npm of both packages:
As gstore-node offers exactly the same API + many more features, I do wonder what is the reason for such a difference... Maybe the Datastore is not used/thought with Schemas in mind?
Happy to hear some feedback! 😄
The text was updated successfully, but these errors were encountered: