Firestore and Mysql on Spring Boot. Is it possible? - google-cloud-firestore

I have a problem with Spring Boot application. I want to connect a Firestore and a MySql database in my Spring boot application. I would to know if it is possible. So I'm wondering if someone have an easy example to know this magic. Thanks.

Connection itself shouldn't be any problem. Firestore has well developed API for all popular languages, very simple and convenient to use, please check reference bellow.
You have mentioned MySQL, not sure if you are aware that GCP has also serverless Cloud SQL that can run MySQL for you (documentation).
You can find it here references and quick-starts here:
Google Cloud Firestore: quickstart, How-to and API reference.
Here I found example app tutorial: youtube.
Other interesting stuff: Spring Boot on GCP, Deploying on cloud from docs.spring.io.
You can also deploy your Spring Boot app on App Engine which can give you serverless solution for whole your stack - whole on GCP.

Related

How to deploy the postgresql server in Google cloud

I am trying to deploy my postgresql server to google cloud, like how we deploy in heroku. But i am not finding any tutorial or proper docs to start.
Can any one please help me in this, Thanks!
You can easily migrate a postgres database to Google Cloud SQL.
Basically it involves, creating an SQL instance, a replication using a Compute engine VM. Then seeding, and migrating your data.
The official documentation for this from google is here;
Migrate an on-premises PostgreSQL cluster to Google Cloud
This is a very good post giving a detailed step by step guide for the entire process.
How to migrate PostgreSQL databases to Google Cloud SQL

How to connect Swift to a postgresql database hosted on Google Cloud

I'm new to working with back-end, but have been running into issues trying to get my iOS app to connect to my PostgreSQL DB.
I have developed an app with Swift which is a game that I want to run locally on iOS devices. I have a PostgreSQL DB set up in Google Cloud Platform but I cannot figure out how to get the Swift app to connect to my PostgreSQL DB.
I've read some about using Vapor or Perfect to run the application using Googles App Engine but I'm not sure that is what I want to do since I want the app to run locally but there are a few aspects of my app that I need a global database for.
Would anyone be able to point me in the right direction of how I need to connect my Swift application with Google Cloud's PostgreSQL?
Your question is pretty much very similar to this one.
In short, the correct answer is you shouldn't connect your client side application directly to the database. Instead, you should build a service that can connect to the database, and act as a service between your application. This helps prevent any unauthorized queries to your database and provides better performance. If you wanted to do this on GCP, you could look into something like Google Cloud Functions or Google Cloud App Engine to act as a service.
An alternative would be to use a "Database-as-a-Service" like Cloud Firestore. This is a scalable, pay-as-you-go service with great mobile support.
Yeah sure you need a server, ruby on rails to connect to your Postgres database.
The server will facilitate data back and forth from the Google cloud Postgressql

selecting best way for deploying MongoDB on Cloud Platform?

I am using google cloud platform for my project and planning to use mongodb cloud service.
I am confused in selecting the MongoDB on Cloud Platform.
I had read this link which tells 3 ways through which we can deploy mongodb.
Please help me out for selecting best option.
Recommendation
I have used all three options for deploying MongoDB on the Cloud Platform and believe the Cloud Launcher for MongoDB is by far your best choice.
Justification
I would like to address each of the three deployment options and explain my reasoning.
Cloud Launcher for MongoDB
The Cloud Launcher for MongoDB is what I would recommend. It's much simpler than creating a MongoDB database in any other way, since there are presets and you click through a nice UI. This was the way I created my first MongoDB database and felt pretty confident throughout the setup process.
MongoDB Cloud Manager
The MongoDB Cloud Manager is a more advanced version of the Cloud Launcher for MongoDB. It supports "more complex deployments... ...such as complex replica sets or sharded clusters." You will be able to work your way towards these complex deployments with the Cloud Launcher for MongoDB, without being overwhelmed immediately.
Google Cloud Deployment Manager
The Google Cloud Deployment Manager "lets you automate the setup of [the] MongoDB Cloud Manager." The MongoDB Cloud Manager is already more complicated than the Cloud Launcher for MongoDB, so there is no reason for you to automate deployments at this point.
Documentation Quoted in this Answer

Elasticache using spring aws cloud

I am looking to implement ElastiCache(using memcached) for my spring application. From here I can see that this can be done using spring cloud aws, but I could not find proper steps for doing this anywhere. Can anyone please provide some example implementation or tutorials?
Take a look at Simple Spring Memcached (SSM) project. It provides integration with AWS Elasticache through custom annotations or Spring Cache Abstraction.

how to access Google Cloud Datastore through JDO, JPA or Objectify?

I'm using Google Cloud Datastore and I'm ok with it, but I have faced with an issue: is it possible to access Google Cloud Datastore (not GAE) through JDO, JPA or Objectify?
If yes, how to authenticate and connect them?
The Cloud Datastore API does not currently provide client libraries that support JDO, JPA, or Objectify. However, we are working on porting the App Engine Java client library to work on the Cloud Datastore API, and that should enable JDO/JPA/Objectify as well.
https://github.com/GoogleCloudPlatform/google-cloud-datastore/issues/34