How to update a existing entity in datastore using golang - google-app-engine

I'm trying to find an effective example in how to perform updates on appengine datastore with Go. All the examples I've found on the web are very vague and mostly explains concepts and not the "real life". The appengine documentation for go says:
..."Updating an existing entity is a matter of performing another Put() using the same key."
Please can anyone help me i was unable to solve these.

Related

Is there a way to use Ecto with cloud based SQL?

Currently I am making an app where I want to have all the dependancies as orderly as possible. With my app running Elixir on Google's Compute engine, I think, for my (SQL) database, to use the PaaS solution that Google Cloud itself provides.
This being the case, I went looking for an adaptor and unfortunately found none. However, under the impression that SQL is itself a standard, I wonder how hard it might be to use an existing adapter like Ecto.Adapters.Postgres or Ecto.Adapters.SQL with the login information of my platform.
Is this something that is possible, and furthermore what type of protocol is implied by using the predominant adapters? Is it simply a RESTful api or is it something a little more proprietary to postgres?
If you're using Google Cloud SQL (it's unclear from your question) then judging by this documentation and especially this passage:
"administer your relational MySQL databases on Google Cloud Platform"
then you should be able to use the MySQL adapter for Ecto. Unless I'm misunderstanding your question and if I am, then please add some detail to your question so we can give you a better answer.
If you've already researched this option then please provide more detail about what's not working for you.

Google app engine datastore fast writing

while starting to learn the google app engine datastore API I noticed the tutorial said:
"the rate at which you can write to the same entity group is limited to 1 write to the entity group per second". Here
I cant seem to understand how can you store a lot of user's information that needs to be written more than 1 time per second like: a simple app that let a user change a value on their profile or something like a comment or chat app that must write rapidly into the datastore
how can this be achieved? what have I missed here?
if there's any samples or tutorials for a real application with the datastore it can be of great reference to me. (preferably in golang but anything will do)
Thanks!
The key part of the bit you quoted is "entity group". Have you properly understood what that means?
A user updating their own profile is unlikely to happen more than once per second - that would require some very fast typing and clicking. As long as the profiles aren't in the same entity group then there's no reason, say, 10k users can't all update their profiles at the same time. For a chat, storing an entire conversation/room as a single entity would be tricky, but storing each message as its own entity wouldn't hit this limit.
You have not missed anything, it's a way High Replication Datastore (HRD) works. It could be strange at first, but if you read about the benefits of HRD, you may find that it makes a sense.
If it's not suitable for you, you can use native MySQL for GAE.
Also, there is a closed question about this subject.

pros and cons of db and ndb in google app engine

I have seen a little of this in stack overflow but I am wondering if there is any reason to use the DB entity model and what the specific pros and cons of using on or the other are.
I have read the ndb is a little faster and that it helps with caching. They have a good bit of info in the docs but don't really straight out say that ndb is better. At least I haven't found that yet.
As far as I can tell ndb is an evolution of db, kept seperate to maintain compatability.
Have a look at the cheat sheet, it details the main differences
https://docs.google.com/document/d/1AefylbadN456_Z7BZOpZEXDq8cR8LYu7QgI7bt5V0Iw/mobilebasic
But it does not mention the other features such as computed properties.
If you are starting a new project I see no reason not to use ndb and every reason to.
EDIT: Alt link for document: https://docs.google.com/document/d/1AefylbadN456_Z7BZOpZEXDq8cR8LYu7QgI7bt5V0Iw/edit#

What is a good resource for understanding GAE datastore architecture?

Is there a detailed analysis of Google App Engine's datastore architecture somewhere? What I am looking for is a resource that can help me:
Understand why a particular restriction exist in datastore (e.g transactions requiring same entity group)
Build a deeper understanding of storage mechanics that help me mentally visualize efficiency of a particular data model.
GAE documentation have some good individual articles, but I am looking for more detail treatment, a book perhaps.
You could start with presentation from Google I/O:
App Engine Datastore Under The Covers
The presentation on Appstats also gives some insight into how datastore (and RPC calls in general) work, as well as giving some optimization tips.

Learning Google App Engine & BigTable

I have a traditional RDBMS based PHP app that I need to convert over to GAE and would like to properly learn how BigTable works prior to doing this. However, I'd kinda like to do it through sample problems or examples that show the maximal way to think about and utilize a non RDBMS platform such as BigTable...
It seems that this would be the best route to take prior to just jumping in and screwing some things up in a one-to-one conversion that would likely happen by the both feet in first method.
Anyone able to recommend a good starting path that perhaps helped you or something of this nature that will properly initiate someone with App Engine and BigTable?
A good way is to see the sources codes of a good projects running in GAE like jaikuengine and rietveld.
For articles, Google IO 2009 and 2010 and GAE articles offer a good resource.
Also you can learn a Column-oriented Database in Wikipedia and see all other projects like cassandra...
I would recommend having a play with the App Engine Cookbook to see how things work. It has some really good examples and has helped me a lot when trying to understand the DataStore
http://appengine-cookbook.appspot.com/cat/?id=ahJhcHBlbmdpbmUtY29va2Jvb2tyFwsSCENhdGVnb3J5IglEYXRhc3RvcmUM

Resources