With the API Gateway working, you can now remove unauthenticated access to the Cloud Run services by revoking the roles/run.invoker role from allUsers from the Cloud Run service. This is because the API Gateway has the roles/run.invoker role to call the Cloud Run service on your behalf. This will also be the case for the […]
Sending Events to Pub/Sub – Profile Service with Pub/Sub and Firestore
Google Pub/Sub is a robust, fully managed service that enables real-time messaging between applications. However, when integrating Pub/Sub into your Spring applications, you might not want to deal with the specifics of the Pub/Sub API directly. This is where the Spring Cloud GCP library comes into play. Spring Cloud GCP provides a channel adapter for […]
Google Firestore – Profile Service with Pub/Sub and Firestore
Firestore is a NoSQL document database that is built for automatic scaling, high performance, and ease of application development. Given the small amounts of data you’ll be storing for each user profile, Firestore is an excellent choice for your needs. Its serverless nature allows it to scale automatically according to demand, making it highly available […]
Requirements – Profile Service with Pub/Sub and Firestore
This chapter delves into the creation of a cloud native, event-driven microservice: the profile service. This profile service will build and continuously update user profiles based on changing facts from the fact service. The architecture will employ Google Pub/Sub for event notifications, Firestore as a serverless database to store user profiles, and Cloud Run for […]
Evaluation – Fact Service with Spring Boot, Cloud Run, and Cloud SQL
Now let’s look at how the solution will scale and how much it will cost. How Will This Solution Scale? This solution is designed with scalability in mind. First, the service itself has been designed to handle vertical scaling. This means that each instance’s capacity can be increased by augmenting memory and CPU resources. This […]
Creating a Secret in Secret Manager – Fact Service with Spring Boot, Cloud Run, and Cloud SQL
Before establishing a connection between the Cloud Run service and the Cloud SQL database, it’s necessary to create a secret in Secret Manager to safely store the database user’s password. Secret Manager is a secure and convenient solution provided by Google Cloud for managing sensitive information like passwords, API keys, and other secrets. It ensures […]
Implementation – Fact Service with Spring Boot, Cloud Run, and Cloud SQL
Let’s get hands-on and implement this project. Creating a New Spring Boot Project To create a new Spring Boot project, you can use the Spring Initializr. This is a web application that allows you to create a new Spring Boot project with several initial dependencies. You will use the following dependencies: This is a great […]
Identity Platform – Fact Service with Spring Boot, Cloud Run, and Cloud SQL
In this service, a fact is made up by relating a person to a skill via a level of interest or proficiency. A skill is represented by a Stack Overflow tag you retrieved in Chapter 5 and made searchable in Chapter 6. However, you need a way of capturing the person it is associated with, […]
Solution – Fact Service with Spring Boot, Cloud Run, and Cloud SQL
When choosing how to implement this requirement, you need to answer several questions: Where to run the compute? For this service, you have a long-running process, so it is not suitable for Cloud Functions. You will be using Java and Spring Boot in a container, so the startup time will be several seconds when using […]
How Much Will This Solution Cost? – Skill Service with Cloud Run
Now let’s look at how much the solution will cost. Cloud Run is charged based on three factors: CPU and memory per 100 ms of execution For example, 1 vCPU and 512 MB of memory for 1 second could be an execution unit. If you assigned 2 vCPUs and 1 GB of memory to a […]