I have a couple of Google App Engine versions in a project, and I use its Datastore. Each version creates a namespace on Datastore, where I have created some entities within a couple of kinds.
Now I've deleted some of the versions, and I want to delete their stuff on Datastore. I've deleted the entities, then the referred kinds had disappeared, but I can't find a way to delete the namespaces.
How can I delete a namespace in Google Cloud Datastore?
Each namespace stores a set of system kinds eg. statistics: https://cloud.google.com/datastore/docs/concepts/stats
Those are reculculated every 48h, and deleted if there are no more user data in that namespace. At that time namespace should disappear from your Datastore as well.
Related
We have a java application and we deployed this on Google App engine. We created around 150 indexes in datastore and which are running fine in production.
but somehow we missed indexes information in datastore-indexes-auto.xml and there is no any file with name datastore-indexes.xml.
Now we want to have datastore-indexes.xml / datastore-indexes-auto.xml with all existing indexes which serving in production now.
How can we do this? I checked appcfg/gcloud commands, there is no any command to import/download the indexes file from app engine application.
Thanks
You could download your deployed app code (How do I download a specific service's source code off of AppEngine?) or check it in StackDriver (similar to Google Cloud DataStore automatic indexing, but looking for the java-specific file(s) instead of index.yaml) and copy/paste the index configs from there.
Place those configs into your app's version-controlled datastore-indexes.xml file (create it if needed) - these will be the manually-maintained indexes. The development server will continue maintain the missing ones automatically in datastore-indexes-auto.xml. The datastore will combine the info from the 2 files at deployment time.
Note that the Datastore indexes are cumulative, they're not automatically deleted if fewer of them are present in newer versions of the xml files, they have to me manually vacuumed/deleted. So check that the index configs recovered with the above method(s) are indeed all of those displayed in the Datastore Indexes page, any missing ones would have to be reconstructed manually from that page info.
As of gcloud 211.0.0 you can list your composite indexes with gcloud beta datastore indexes list
I accidentally deleted a bunch of entities earlier today in Google App Engine and found out later that some of them should not have been deleted. I have the keys for the entities I deleted as well as a lot of information about the entities stored in a secondary database. I was wondering if there was any way to create entities with specific keys in app engine or if there was alternative method of recovering these entities? I am very worried
I was wondering if there was any way to create entities with specific keys in app engine
You can create new entities with those same keys, just set the key property on the instance of the model before you put and it will use that key instead of generating a random one for you.
Also, check if your team has used datastore admin to take snapshots, if so, you may be able to recover them from there:
https://console.cloud.google.com/datastore/settings
I added a new index to my GAE app, but I need to index old entities. Is there any way besides getting and reinserting to create index entries for existing entities?
No, you have to re-save all old entities. The Datastore only updates indexes when an entity is saved.
Google provides tools - gcd for Java and appcfg.py for Python/Go - that can add and remove indexes on your production datastore.
I want to create application with consists of Desktop application and google cloud storage. So, each my client should have separate cloud storage. Does google provide such thing?
More info.
Because I do not know what can offer google app engine i wrote this question.
I need some database hosting for my desktop application. In future I think I will switch to GWT and app engine. I want to sell my application so each my client can't access my other client databases. I was thinking that would be safer if each client will have data in a separate database so I can't do some mistakes in code.
You can separate data in the datastore using namespaces on google app engine:
https://developers.google.com/appengine/docs/java/multitenancy/multitenancy
It's up to you to decide how to implement the namespaces. You can separate them out by your user authentication system.
You can create a folder per client and restrict the folder access to the user (works only with Google Accounts) or your can do the same with buckets, create a bucket per user (which might be an overhead if you have a lot of users).
For database AppEngine datastore has the ability to separate the data by namespaces. this doen't require any user account and its your responsibility to select with which namespace to work with per request.
You can use GAE namespace capability as pointed above by #dragonx without Google authentication.
Use a client name as a namespace identifier (needs to be unique) . How you fetch this client name is upto you. It can be stored in GAE itself if you wish or can be deciphered from the url used specific to a client.
Do have a look at the GAE multitenancy link https://developers.google.com/appengine/docs/java/multitenancy/multitenancy
The example here can be easily adapted to use any string identifier per client.
what is bigtable. Is any authentication require to create table in bigtable.where the data will be store. it is possible to view the table. we can view all the tables in bigtable, which was created by others.
I'll take your several questions one at a time:
Bigtable is the system on which AppEngine's datastore is built. It is effectively a distributed hashtable.
Authentication is required in that you must have a Google Account; you must have signed up for AppEngine; you must have created an application within AppEngine. You application will be able to access the datastore, and if you are logged in to your application's Admin Console, you can use the Datastore Viewer to inspect the contents of your application's datastore.
The data will be stored on Google Servers.
There are no tables, per se, but you can use the Datastore Viewer to view entities that reside in your application's Datastore.
No, you can not ever view the Datastore's contents that were created by other applications. Each application's view of the Datastore is completely siloed and has no connection to that of other AppEngine applications.