# EhrBase: Implementation with remote databases available? **Category:** [Platform](https://discourse.openehr.org/c/platform-implem/7) **Created:** 2023-02-15 14:20 UTC **Views:** 725 **Replies:** 10 **URL:** https://discourse.openehr.org/t/ehrbase-implementation-with-remote-databases-available/3576 --- ## Post #1 by @maxwell_flitton Hey I'm looking to implement the openEHR server. From what I understand it's a docker image that I can deploy on something like a Kuberentes cluster. However, after reading through the documentation I can't see how to define the database URL. Is there a way in which I can point to an RDS on AWS or Cloud SQL for Google cloud for instance? I'd like to have snapshots and I don't want to trust persistent data to a Docker container. All we need is that compute instance to go and everything will be wiped. --- ## Post #2 by @ian.mcnicoll @Paulmiller is this something that NES have looked at? @birger.haarbrandt - any experience? --- ## Post #3 by @Seref It's a Spring Boot app. See this docker compose file: https://github.com/ehrbase/ehrbase/blob/develop/docker-compose.yml see that db url on line 13? point that to your RDS instance and the spring boot app should run against it. Getting the db up and running on RDS is some manual work for you to do, but if you want to be pragmatic, get the postgres image running. take a backup and restore to RDS. that'd be my first attempt for shotgun surgery. You'll have to re-create the config in the db image on RDS to do it properly though. Ehrbase was using Flyway the last time I checked, so I cannot see how you can avoid some code exploration. --- ## Post #4 by @Paulmiller I will ask! Beyond my ken... --- ## Post #5 by @Paulmiller Our team recommend @Seref 's reply above! --- ## Post #6 by @ian.mcnicoll That would be 'Ken' then? :wink: --- ## Post #7 by @robert-hunter-nes Just to add to what Seref has already said. The alternative to taking a backup from the postgres image is to use the provided SQL scripts [here](https://github.com/ehrbase/ehrbase/tree/develop/base/db-setup). IIRC you will need to * run [createdb.sql](https://github.com/ehrbase/ehrbase/blob/develop/base/db-setup/createdb.sql) first to create the database * then run up the EHRbase application pointing to that DB so that the flyway migrations will run and create all the necessary tables etc * lastly run the [migrate_to_cloud_db_setup.sql](https://github.com/ehrbase/ehrbase/blob/develop/base/db-setup/migrate_to_cloud_db_setup.sql) to ensure you have the necessary triggers created. --- ## Post #8 by @maxwell_flitton Thanks for these answers they are very helpful. Will start working on this. Also, is there an option for using surrealDB? Or is it only PostgreSQL that we can use? --- ## Post #9 by @Seref [quote="maxwell_flitton, post:8, topic:3576"] Also, is there an option for using surrealDB? Or is it only PostgreSQL that we can use? [/quote] Not for EhrBase (the particular implementation we're talking about here) as far as I know. Implementing the persistence of data for openEHR (or for any representation of clinical data for that matter) in a performant and robust way is very, very hard. That's why there are not many persistence systems to choose from. (just don't listen to that voice at the back of your head that says "surely it cannot be **that** hard" when you read this) --- ## Post #10 by @ian.mcnicoll My understanding is that there is an EhrBase roadmap to allow other SQLdbs to be used as long as they support the emerging SQL JSON handling standard. --- ## Post #11 by @erik.sundvall Partly off topic, but: could [Cockroach DB](https://github.com/cockroachdb/cockroach) be used as (potentially very distributed and fault tolerant) backend for EHRbase? "CockroachDB supports the [PostgreSQL wire protocol](https://www.postgresql.org/docs/current/protocol.html) and the majority of PostgreSQL syntax". See https://www.cockroachlabs.com/docs/stable/postgresql-compatibility.html for details - are any of the listed as "not yet supported" features needed for EHRbase to run? --- **Canonical:** https://discourse.openehr.org/t/ehrbase-implementation-with-remote-databases-available/3576 **Original content:** https://discourse.openehr.org/t/ehrbase-implementation-with-remote-databases-available/3576