I try to write a small web application with a restfull frontend to manage a little amount of data (round about 30 datasets). I want to create a PDF file from the datasets (using iText, but this is not the Problem). I search now a small database, which I can embed in my application an which persists the data somewhere on my Harddisc (if possible no Client / Server database), but I find no example / tutorial for this. All tutorial I found using a database in in-Memory mode, which is not what I need. Is there somewhere a nice tutorial helping me? Which database would you sugest to use in my Situation?
Thanks for your help and
Kind regards,
Andreas Grund
You can use H2, HSQL and Derby databases for embedded database. For example h2 database datasource-url like below :
jdbc:h2:~/Desktop/Database/test;DB_CLOSE_ON_EXIT=FALSE;
And in spring boot you can easily do it ,if you read this document Spring Boot-Embedded Databases
Related
I have written a spring batch solution which currently uses the embedded H2 in-memory database.
The read and write operations uses SOLR Cloud API calls.
Ideally, we dont want to introduce an proper relational database as a job repo database, for the read-write batch operation.
I read that H2 in-memory databases are best used for Dev and Test in spring batch.
Does anyone have experience of using this H2 database in spring batch on a proper live environment dealing with millions of records in the batch processing, but batch job will ran only once a day at most?
If H2 is not stable for prod, I might have to ditch spring batch OMG, or anyother alternatives?
Open to any ideas or references.
Thanks in advance.
H2 is a light-weight Java database, as you mentioned yourself, that it is ideal for dev testing !
When considering production, you might be missing on lot of features which a RDBMS , NoSQL databases provide!
For e.g. Replication, memory and performance optimizations etc.
If frequent reads and writes are concerned and you don't want RDBMS, you may choose MongoDB or Couchbase to manipulate records , they are fast too !
So considering Millions of records, I don't think H2 would be a good choice for production databases
A similar article might throw some light & help you decide !
Are there any reasons why h2 database shouldn't be used in production?
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.
I am very new to Kafka, I'm doing a PoC (my first Kafka app) and was curious to know if anyone has come across or worked on a custom JDBC Source Connector that uses a stored procedure to export data from Oracle into Kafka?
I know this could be considered an open-ended question by the SO community but thanks for your patience and I'd appreciate any feedback.
Thank you!
Some background:
I already have stored procedures in Oracle which are used by an existing Spring app to extract and load data in a new DB (for a new version of an existing enterprise application).
The table structure in the new database is different than that of the old.
The Spring app (which uses Spring JDBC and works with Stored Procedures, Row Mappers etc.) was developed as a PoC to check connectivity, integration and to load data in the new DB.
Now that it works, we're trying to introduce Kafka that would actually store the data and then load it into the new DB. The JDBC Sink Connector would be developed later.
I am looking for an example (using Java, Maven, Spring) that would help me in getting started towards building a custom connector. Most of the example/docs show curl examples which doesn't fit my existing app. I maybe missing something here.
There is way that we can call SP though source connector property - query: call sp here by creating temp table and insert data
we currently have a REST Api and it is connecting to Oracle, through Hibernate.
We are contemplating the idea of experimenting using MongoDB as a the database, and I was wondering if people could share their experience.
Obviously it won't be a simple switch. The way we persist and retrieve needs to change. Hibernate might no longer be required.
Is the best practice to design such that the Documents are stored as the Api response should be; it no transformation required?
Thanks for sharing your experience.
Cheers
Kris
I am trying to integrate a simple Enterprise App to a data source(xml file for now) using Apache Service Mix(ASM) ESB. Basically I need to have the ESB pick up content from the xml file and populate corresponding tables in a H2 database(which my app is linked to). I am not sure as to which features of ASM I should be using for the same. If someone could give me a high level idea as to how I should be going about the same I would be very grateful. I have looked at documentation from Fuse ESB and also the ASM documentation but at this point I am totally confused.
Thanks in advance.
Since ServiceMix uses Camel for such work, my first suggestion is to take a look at Apache Camel for it.
For you're example a simple route would look like this:
from("file:location_of_file").unmarshal(registered-jaxB-structure)
.split(simple("probably_your_entities")).to("jdbc:dataSource?sql_insert");
You read your incoming file from the *location_of_file* unmarshall it since it's a XML file to your object-structure with jaxb. After that you probably need to iterate over the entities inside your xml file which is best be done with a split. Now your structure is most likely in a way you can use either for storing with jpa, sql or jdbc.