I want to use datastore of google in my web app but do not want to host it in google app engine, I want to host it some other machine. So how i can use datastore in such web app ? will it be more economical ?
To store data and files on App Engine, you can use Google Cloud services or any other storage service that is supported by your language and is accessible from your App Engine instance. Third-party databases can be hosted on another cloud provider, hosted on premises, or managed by a third-party vendor.
Cloud Datastore is meant for applications that demand reliability upon the highly available structured data at a fixed scale. You can make use of the Google Cloud Datastore to store & query different types of data that include product catalogs, user profiles, and transactions.
Datastore is a highly scalable NoSQL database for your applications. Datastore automatically handles sharding and replication, providing you with a highly available and durable database that scales automatically to handle your applications' load.
You would need to follow the Accessing the Cloud Datastore API from another platform procedure:
This section shows how to activate and access the Cloud Datastore API from an external application running on a platform outside of Google Cloud.
Enable the Cloud Datastore API for the project. You can enable the API for an existing project, or create a new project and then enable the API. Enable the Cloud Datastore API
To use the Cloud Datastore API, your Cloud project requires an active App Engine application. Open the App Engine dashboard and confirm your Cloud project has an active App Engine app. Open the App Engine dashboard
Create an App Engine app if needed. The app must not be disabled.
Go to the Create service account key page.
Click the drop-down box below Service account, then click New service account.
Enter a name for the service account in Name.
Use the default Service account ID or generate a different one.
Select JSON in Key type.
Click Create.
Upon successful creation, your browser will download the private key. The Cloud Platform Console provides a prompt that displays the private key file name. Note the file name so you can locate it, then click Close to dismiss the prompt.
Your Service Account is the Email address displayed under the Service Account section.
Your Private Key is the file you just downloaded.
At this point all services and authorizations are configured for your project and you can start writing code or exploring the API.
You don't actually need to write code for the GAE app and deploy it, see Is an App Engine instance required for accessing Datastore?
As for being more economical or not (I presume compared to running the app on GAE) - it depends a lot on the app's usage/scale, what the app does and how it does it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With