After installing a HAPI FHIR server, what database to use? - java

I'm new to HAPI FHIR, I created a google cloud compute engine VM, installed java and maven, cloned the hapi-fhir-jpaserver-starter and installed it with :
mvn install
Then runned it to test in my server with :
mvn jetty:run
Now I access it using : http://IP:8080/hapi-fhir-jpaserver
and I get this page :
Now all the resources are empty (patients etc..) , I need to know :
Is this a good server for production ?
What Database the server is actually using and how to access it ?
What type of Database I must set up and how ?
Thanks
EDIT :
I tried to install the hapi server using docker compose, I built the app with mvn clean install and ran the command docker-compose up -d --build but when the installation was finished I get the basic HAPI SERVER (the fresh one) not the version I edited and built.
Any ideas why ?

This s a question of opinion and isn't really an appropriate question to ask on this site. However, there certainly are many systems that do use HAPI in production.
It depends on which server. As per the documentation here, you can either use the 'plain' server and provide your own persistence layer or use the JPA server which uses JPA 2.0 with Derby as the default data store. Details about the database and its structure are defined in the aforementioned documentation
If you're not sure what to do and don't have an existing database you must use, it's probably simplest/wisest to stick with the JPA database as it's already properly configured and works pretty well.

This is an opinion question, so there is not a true right answer.
Having said that, I would stick with "known" setups.
https://smilecdr.com/docs/database_administration/database_design.html
Relationship between smilecdr and hapi
https://smilecdr.com/open-source.html
I am partial to Sql Server or Postgres.
I would not go with Oracle, unless my company is already heavily invested. See image later in this post.
https://docs.oracle.com/cd/B19306_01/server.102/b14200/statements_6014.htm
The command “Create Schema” ‘does not actually create a schema’. #makesPerfectSense But you automatically get a schema when you create a user.
Do what?? I am not a fan of Oracle. Some of it is historical, which is why I think MySql may be the ripped off bandaid.
=========================
2022 UPDATE.
SmileCDR has "discouraged" MySql.
https://smilecdr.com/docs/database_administration/setting_up_mysql.html
Note that as of 2021.11.R01, MySQL is discouraged for production use
due to performance limitations of the database. SmileCDR will continue
to support customers on this database, but if serious performance
issues arise, we will suggest migrating to a more performant database.

Related

How to pack Java Desktop Application made using eclipse with MySQL database with all the Data?

I have made a JAVA Desktop Application using Eclipse and MySQL as a database. I want to use the application in another PC with all my created schema and data. How can I bundle or make an installation file so that it installs mysql with the required schema and the JAR file of my application into another pc?
Note: I know we can use embedded Database like H2, Sqlite but I want it to be done using MySQL only. So no suggestions on using other database for my application.
Not sure how your application architecture but below point or solution could help you.
Solution 1 :
You can create DDL for schema database and the insert data. Once your application successfully install, you just run the script to execute this DDL file. Can be done in automation installation script.
Solution 2 :
You can dump mysql and restore to other PC. No worry about the structure, it completely clone from the original including data. Can be done in automation installation script. Dump mysqlDB link
Solution 3 (not recommended):
You can copy entire mysql data in directory and paste to other machine mysql directory. Based on my experience, never success. But look at this guy link
There is a pro and cons using embedded SQL or centralize SQL. If you stick with this kind of architecture, you should consider use embedded SQL like you mention.

How to debug server code in eclipse on deployed appengine database?

I have a Google AppEngine (Java) project in Eclipse. I want to debug my local code in Eclipse but use the deployed database on AppEngine. Until now I use Remote API with username/password (old way)
This method will be deprecated and I want to use OAuth but when I try to use it, it throws an exception:
java.lang.IllegalStateException: OAuth-based authorization not supported for clients running on App Engine
at com.google.appengine.tools.remoteapi.RemoteApiOptions.getOrCreateHttpTransportForOAuth(RemoteApiOptions.java:359)
at com.google.appengine.tools.remoteapi.RemoteApiOptions.useApplicationDefaultCredential(RemoteApiOptions.java:162)
Everthing is fine when I run a simple Java client app that uses remote api in Eclipse. But if the client is AppEngine development environment in Eclipse, it doesn't work.
How can I debug the server code in eclipse using appengine database?
Bug report: https://code.google.com/p/googleappengine/issues/detail?id=12556
This is expected, as value returned by ApiProxy.getCurrentEnvironment() will not be null, but com.google.appengine.tools.development.LocalHttpRequestEnvironment object. For development server you'll have to use old style (username/password) for now.
According to the documentation, you need to add appengine-remote-api.jar from ${SDK_ROOT}/lib/appengine-remote-api.jar to your WEB-INF/lib directory (or add it to your Maven dependencies) before this will work.
Update: Indeed, it looks like OAuth from App Engine with Remote API has not yet been implemented. I would assume this will change before ClientLogin is fully deprecated, but for now I would recommend opening a feature request on the public issue tracker.
One possible workaround would be to create a regular console application that connects to the Remote API (as per the example in the docs) and can act as a proxy for your App Engine application running on the development server.
In addition to what my colleagues Adam and Nikita previously said, I can officially confirm that the Google Cloud Engineering Team is determined to provide a solution to all reasonable use-cases which are affected by the ClientLogin shutdown before its deadline.
Presumably, the Remote API solution will be available in the upcoming releases 1.9.31/32, although this is just an assumption and there's no ETA for it yet.
As an alternative, you can access Cloud Datastore using Protobufs remotely using service account credentials, which might fit your needs for the moment.
UPDATE 2016/01/21:
The team has extended the ClientLogin shutdown deadline to April 12, 2016.
UPDATE 2016/04/12:
As mentioned before, the fix was properly applied and available in the latest versions of the SDK and gcloud. Remote API can now be used again with OAuth for app-to-app (or devserver-to-app) connection.

java apps with mysql database

I have prepared an application that is a small demo of Student information manipulation. I have stored information related to students in a MySQL DB. Now my application is working 100% on my computer. But I want that work everywhere without depending on Database! I mean I just want "WHEREVER MY .JAR FILE GOES, DATABASE SHOULD ALSO GO ALONG WITH THAT INSIDE .JAR FILE "
So anyone who is using my application or trying it, they can realize exact result of this application.
How can I make this possible? Please someone help me.
For that I have done the following things:
I have installed MySQL database on my computer.
I have created a database on that MySQL server
I have created some tables in the database with a lots of data.. this data is to be used in my whole application, even for login.
Now I want to deliver this application to various clients but my clients are not technical persons and I don't want to give instructions to each of my client to do the above four steps.
How can I integrate some functionality into my app so that they can use my database, Tables and Data automatically .
It would be much better if the code can install the MySQL database automatically from the setup file attached with the application.
How the applications available in the market manage information
Have you thought of using another database engine?
MySQL requires the server to be installed and configured, and it is a huge task to be done by an automatic installer.
What about using for example SQLite http://www.sqlite.org/ or Apache Derby http://db.apache.org/derby/. Both of them work by creating a file in your working dir, you could setup the database and populate data at install time
I have two suggestions for you:
A. Use SQLite instead of MySQL. SQLite is an embeddable database engine and does exactly what you need. You can simply copy the .sqlite file where all the information is stored and distribute it with your JAR file. Given that you've already written you app to use MySQL, this could mean making a few changes to your code.
There is a good SQLite jdbc driver at:
https://bitbucket.org/xerial/sqlite-jdbc
I've used it before, though not extensively.
B. Use a portable installation of MySQL. If you are using Windows these are available on the MYSQL page, look for the downloads marked "ZIP Archive" instead of "MSI Installer". These versions are portable in that they do not require an installation process, just unzip the file, and start the service. Your clients need to know how to start it up, of course. Perhaps you could create a shortcut for that.
Of course, the idea of MySQL being a network server is so that everyone in the enterprise works with the same data, by connecting to the same server. If your clients will use this application in various computers in the same company, you should consider having a single MySQL Server installed, and making the clients connect to that.
Hope this helps!

CloudBees Runtime Classpath

I just read the CloudBees whitepaper "CloudBees Advantages: A Guide for Java Developers". In it there is a sentence that reads:
The database is simply available as a JNDI resource as soon as it is deployed – there is no need to chase down JDBC drivers, connection strings and configure JNDI.
So I assume that means I don't need to include a MySQL JDBC driver in my WAR's WEB-INF/lib directory, as apparently CloudBees provides it to the classpath at run time, yes.
This also prompts a few other questions:
What version of the MySQL JDBC driver (and which type) is provided by CloudBees?
Does the same apply for the Cloudant CouchDB service, or drivers/dependencies used by other service partners?
Are there any other libs that CloudBees makes available to the runtime classpath for its clients?
Thanks in advance!
Cloudbees currently provided version 5.1.16 of the MySQL JDBC driver with the jboss stack, and 5.1.15 with tomcat6 and any other stacks. Unfortunately, this information isn't documented anywhere publicly. Caleb Tennis, one of their developers, informed me of this via their IRC channel, #cloudbees.
Regarding Cloudant, it's more or less just CouchDB, so to connect you can use these libraries from the CouchDB wiki.
Alternatively, CouchDB amounts to a REST API, so it might be easier to use a straight HTTP library to make requests and parse responses. Whatever you're most comfortable with, really :D
As for what other libraries Cloudbees makes available to the runtime path, more from Caleb Tennis:
Other than mysql, there are no "guaranteed" runtime libraries - you will need to put them into your war or other package for deployment.

Should I implement source control for j2ee application server configuration files?

For a typical J2EE web application, the datasource connection settings are stored as part of the application server configuration.
Is there a way to version control these configuration details? I want more control on the datasource and other application server config changes.
What is the standard practice for doing this?
Tracking configuration changes to your application server through version control is a good thing to ask for. However, It does imply that all changes are done via scripting, instead of the administrative web interface. I recommend
http://www.ibm.com/developerworks/java/library/j-ap01139/index.html?ca=drs-
as a good background information article on this topic.
Update: Just recently, part 2 has been published here: http://www.ibm.com/developerworks/java/library/j-ap02109/index.html?ca=drs-
When working with WebSphere we found the best approach was to script the deployment and place the script under version control plus the response files for each of the target environments.
Websphere canbe tricky as the directory structure is a mess of files - often there appears to be duplicates and it's hard to figure which is the magic file you need to backup / restore . The question of how to go about this should not detract from the need to do it. - which is a definite yes.
Our (Spring) apps have a hardcoded jndi name in the spring config file. That way, the same ear can be deployed to dev, qa and prod environments, and you don't have to worry about database connection details.
The app server admins ensure that a datasource is registered against that jndi name, with the connection details as appropriate on each environment.
But how does this let me manage changes to datasource configurations in the application servers. Here's a scenario:
DBAs change the connection password of the database server.
Webspehere/Weblogic administrator makes corresponding changes to server configuration through administrator console.
The above change is not version controlled so there is no clean way of knowing the history of such changes.
The problem is not about how the application should be configured but about how the configuration changes should be version controlled. Perhaps it sounds like an overkill for simple projects but for some projects, controlling changes like these really becomes a problem.
Any time you ask yourself "should X be in version control" the default answer is "yes".
For a more refined answer, ask yourself this: is the file created by a person (like a source file or a document) or is it generated by another program (like an object file or a distribution PDF)?
File that are created, and/or maintained, by a human should be under configuration control.
We are always using version control for our app server settings. It's a tool called WLST (weblogic scripting tool) which is part of the weblogic server distribution. The domain configuration is stored within a Jython script, which can easily be executed via command line and therefore integrates superb with our build tool maven.
Creating a preconfigured running weblogic domain only needs to execute a maven goal. All those annoying problems of misconfigured jdbc connections or wrong jms destination parameters are gone. You will always have a appserver configuration which matches the source code at a given time. You will never need to remember which app server setting must be applied for this specific version of the project you are working on.
I really recommend this.
I also would like to know, if there are similar solutions for other application server available. As far as i know there is a way for glassfish via ant. How this can be achieved for JBoss?

Categories