I already deploy my application with eclipse and built in database (generated from AssestDB of the application). I want now to manage the application and deploy it with IBM bluemix PaaS, to manage Mobile Data.
What is the best DB I must use when coding before deploy into Bluemix?
If you want to configure your local test environment in order to minimize migration problems when deploying your application on Bluemix, you should replicate the target environment on your local one, as much as possible.
If you are planning to use the Mobile Data service on Bluemix please consider that it is built on Cloudant NOSQL Database, and it offers a further layer of abstraction that allows you to directly persist objects (if you are familiar with the concepts of class, object etc..).
You could also directly connect from a local application to a DB service instance running on Bluemix.
Related
I'm new to GCP and currently, I try to deploy all my applications on their services.
For an application in a single container I use CloudRun which I already really like.
Now I want to deploy an application that uses Angular in the frontend and spring in the backend and a SQL-DB (Postgres). Every part of this is in its own separated container.
Should I use for this purpose although CloudRun or does GCP have more suitable services I should consider to use if I want to host a scalable and serverless Application? So is there such a thing as the best practice for Frontend-backend architecture applications on GCP?
I recommend you to use these services:
Cloud SQL to host the database. It's managed for you and efficient
Cloud Run for the business tier (the spring application).
Be careful, with spring the cold start can take several seconds. I wrote an article on this (the article is quite old and the perf are now better on Cloud Run, but the latency on the first request exists (and take 5 - 7s for an hello world container)). Add several CPU (4 is a good number) to speed up the cold start or use the --min-instance parameter for this (or other solution that you can find in one of my articles)
For the front end, I recommend you to host the static files on Cloud Storage.
To serve this on internet, put a Load Balancer in front of this
Create a serverless network endpoint group (NEG) for Cloud Run service
Create a Cloud Storage backend to serve the static files.
Use the domain that you want and serve it in SSL
Optionally, use CDN to cache your static files.
CloudRun runs stateless containers. It doesn't make a distinction between frontend and backend, or worker jobs.
You can run your frontend, backend, admin code base as Cloud Run service.
Next to these you setup Cloud SQL for your operational database, and connect the Cloud Run services with the Cloud SQL connector so they are able to use for read/write queries.
I have a web application hosted on Heroku that uses PostgreSQL. I want to make a React Native application that can access that database.
How can I do that?
A typical architecture would be to add an API to your web application and have your React Native application talk to the API. I'm not sure how much obfuscation is provided by React Native, but generally speaking client-side code shouldn't contain sensitive information like database credentials.
I wouldn't recommend having multiple applications talk directly to the database, regardless of technology.
Having said that, Heroku does have some guidelines about how to access your database from outside of Heroku. Briefly,
don't hard-code your database credentials since they could change at any time
instead, use heroku config:get DATABASE_URL to retrieve the credentials from your Heroku application
This is commonly used with graphical database clients, for example.
How to register a database server like a "PostgreSQL" or any other sql database with eureka server and use it in spring boot micro service?
In order to register Postgres, Elastic Search, etc. or in-house non-JVM services you would have to implement the Sidecar pattern, a companion application to the main services that serves has a mediator between the main service and Eureka, for instance.
To do so using Docker it's a little bit tricky because it's a suggested practice for a Docker container to run just one process but using a Sidecar along with the main service you would have to either run two process or make changes / provide implementation in the Sidecar application to support the Sidecar and Postgres to run in different Docker containers.
I recently blogged about this exact topic at Microservices Sidecar pattern implementation using Postgres, Spring Cloud Netflix and Docker.
I decided to run both, the Sidecar app and Postgres in the same container but I might follow up on this in the future.
You need to write a simple microservice, which has access to the database and expose endpoints to the repositories.
For services that are non-Java based, you have a choice of implementing the client part of eureka in the language of the service [1]
You cannot register a PostgresSQL Database as a service to Eureka directly.
EDIT: Since every microservice serves a specific concern, it should has its own data store. If you centralize the data store, it becomes your bottleneck and you limit the scalability of the microservices using the data store.
I am planning to move different service to Swisscom Application Cloud, but I have a problem on database access.
My setup is a web application and a local service sharing the same database, unfortunately the local service can't be moved to the cloud at the moment, there is a way for my local service to access the database in the cloud?
I think using the service connector in production is not a good idea
I know the best solution would be to avoid direct access to the database from the local service and expose REST API from the web application but that's out of budget
You are right: External service access to database services running in the cloud is not possible and the service connector is not suitable for permanent use.
This is by design: The services in the marketplace are meant to be used by the apps running there - the apps themselves should expose their functionality over HTTPS preferably. We'd like to avoid allowing external access to the databases; this would open the door for a lot of external (legacy) apps with a complete different set of requirements.
So the solution that fits the architecture best is indeed your suggestion: Expose the data needed for the legacy service as part of the apps' Web API.
Since that is out of question, it might make sense to host the database outside of the cloud (i.e. where the local service runs or on some 3rd party provider) and connect your app in the cloud to this externally running database.
I am currently developing a php application hosted in my server. I want to store the database data in a more secure place rather than my own server. Can I use google app engine only to store and retrieve data without creating a java or python app? If thats possible how can I access data? Using a special service or I can directly connect to db like connecting to a mysql server and execute sql commands lik select, insert etc?
Storing your data on App Engine will not magically grant you extra security. If an attacker compromises your server, they will be able to compromise the interface you have to your datastore and do whatever they wish.
A much better approach would be to learn best-practices for secure web development, and endeavour to ensure your app will not be compromised.
They have a module called remote_api, but it has some restrictions. Check it out:
http://code.google.com/intl/fi-FI/appengine/articles/remote_api.html
There is no direct way to access datastore in App engine. I assume you use mysql or other relational database for your php application. But app engine provide a schemaless object datastore. In that case you need some java or python app for preparing data to store in datastore. Check below links as well.
http://code.google.com/appengine/docs/java/datastore/
https://stackoverflow.com/questions/1466420/google-app-engine-external-database