Too Much Overhead with Firestore and Spring Boot JPA repository - spring-boot

I'm working on my own personal project of a JIRA-like ticket tracker that I can use for my own projects. I've decided to use the GCP stack and have a Vue.js frontend hosted on firebase and a Spring Boot App Engine backend.
I was originally thinking of having a firestore with the project, and this is where I will keep track of the tickets. I was then going through the firestore on the App Engine start and setting up a JPA repository with all tickets currently in there. Any creation or modification of tickets will go from the frontend UI -> spring boot repo -> update the firestore. I have created an Entity/Class called Ticket which is what I am using to store all the data for each document from firestore and is what is being kept in the repo, and plan to make REST API calls to the backend in order to create new tickets/modify current ones.
My question is as I was building out this last section it seems actually like having this spring boot repo may be too much overhead and data being passed around, slowing down the application (or even just pure duplicate code). Is it better to just use pure Firestore and modify the data directly there, or am I on the right track and actually this Spring Boot repo should be kept in?

Related

Which datastore (database) should be used for Spring-boot REST API application with AZURE

There are may blog available around this but still not getting exactly what is needed.
I am trying to write a REST API with Spring Boot and store data in database. Here the database structure may change (new tables can get introduced or some existing names may get renamed).
Which DB can be used so that there would be minimal code changes needed both at java side and DB side.
What could be a best design approach in this scenario considering technology stack as Spring Boot and Azure
Please visualize about your persistent storage? Why Azure Only? Refine question.
e.g. H2 database with Spring Boot is the most memory efficient.
see Lightest Database to be packed with an application
About Minimal code changes - I'd go with one of the ORM - JPA(or Hibernate). So will only need to maintain #Entity class on java side.
Don't forget - minimal changes still need to be addressed at database & Java side.

How to automatically create DynamoDB table on application startup using Spring Data DynamoDB?

I am using spring-data-dynamodb Spring Data extension to integrate AWS DynamDB with Spring Boot 2.0. I was able to make it work.
My question is, is there a way that the table is automatically created on application startup if it doesn't already exists, similar to what Hiberate offers via hibernate.hbm2ddl.auto ?. Right now, I have to create the table manually or in the application using the AWS DynamoDB sdk. Many Thanks.
Right now there is no such feature but there is an open feature request: https://github.com/derjust/spring-data-dynamodb/issues/17 (which I'm actually working on these days)
Note: I'm the maintainer of this GitHub project.

Microservice project structure using Spring boot and Spring Cloud

I am trying to convert a normal monolithic web application into microservices structure using Spring Boot and Spring Cloud. I am actually trying to create Angular 2 front-end application and calls these my developed microservices in the cloud. And I am already started to break the modules into independent process's structure for microservice architecture.
Here my doubt is that, when designing the flow of control and microservice structure architecture, can I use only one single Spring Boot project using different controller for this entire web application back end process?
Somewhere I found that when I am reading develop all microservices using 2 different Spring Boot project. I am new to Spring and Spring Cloud. Is it possible to create all services in single project by using different modules?
Actually, it doesn't matter to package all those services into ONE project. But in micro-service's opinion, you should separate them into many independent projects. There are several questions you can ask yourself before transforming original architecture.
Is your application critical? Can user be tolerant of downtime while you must re-deploying whole package for updating only one service?
If there is no any dependency between services, why you want to put them together? Isn't it hard to develop or maintain?
Is the usage rate of each service the same? Maybe you can isolate those services and deploy them which are often to be invoked to a strong server.
Try to read this article Adopting Microservices at Netflix: Lessons for Architectural Design to understand the best practices for designing a microservices architecture. And for developing with Spring Cloud, you can also read this post Spring Cloud Netflix to know which components you should use in your architecture.
Currently I am working on microservices too, according my experience we have designed microservices as step below,
Maven
You should create the project with different project. But actually you can separate your project to submodule. So you will be easy to manage your project, the submodule you can use with other project too.
Build the Jar Library put your local repository. it can save your time, you have just find the same component or your functionality then build the jar file put in your local repository , so every project that use this function call point to download this repository, you don't have to write many project same same.
So finally I would like you to create different springboot project, but just create submodule and build local repository.
By creating your modules in different projects you create a more flexible solution.
You could even use different languages and technologies in a service in particular. E.g. one of your services could be NodeJS and the rest Java/Spring.

When to use default Spring Data REST behavior?

I recently worked on a project which uses Spring Data REST with Spring Boot. While it is GREAT to harness the power of Spring Data REST and build a powerful web service in no time, I have come to regret one thing: how tightly coupled the "presentation" layer (JSON returns) is to the underlying data structure.
Sure, I have used Projections and ResourceProcessors to manipulate the JSON, but that still does not completely sever ties with the database structure.
I want to introduce Controllers to the project, to integrate some of the "old" ways of building a web service in Spring. But how should I draw the line? I don't want to eradicate Spring Data REST from my project.
I am sure many of you have faced similar decisions, so any advice would be most appreciated!

Spring 4 vs Grails - Open Source Plugins

I have used spring 3 but not sure what is the equivalent of a grails plugin. And now need to suggest a stack for a new app. Looking at grails it seems to be great for making data base models and has a lot of plugins. but it seems its more expensive at runtime.
So my question is that is there a equal or better repo of spring for every little thing you can need like facebook login or other social actions, ajax upload, joda etc or is this what we call a dependency and some code from a blog/ stack?
Is there any repo of small reusable code like we have on grails plug ins for regular spring mvc projects?
I know that your question is about pure spring alternatives, but I would honestly recommend just using Grails. I've done projects in both stacks. If you want to get rid of the configuration headaches and get started quickly on a new project while staying within the Spring stack, it is the way to go. It is a great framework and some of my employers have many production Grails applications supporting thousands of customers.
You can also upgrade to Grails 3 when it comes out next year and take advantage of the leaner code they provide in it due to Spring Boot!
You may need to check into Spring Boot. It does not provide a full stack framework, but it is hiding much of the extra coding you may need to do for a spring application. There are some new projects that enable you to get the benefits of spring boot. Check the below projects:
1- http://jhipster.github.io/ , use it if you need to make SPA with AngularJS also have commands to generate Entities for you using Yeoman
2- http://lightadmin.org/ , use it if you want to create CRUD pages based on Spring Data Entities
For both, you may have to use Spring Data and maybe even Spring Data REST. These may be helpful too.

Resources