Brian Heise
1 min readSep 29, 2021

--

Hello Suman! Thanks for your comment.

CAP can definitely be configured to persist data permanently. For development purposes the CAP framework comes pre-configured with an SQLite database so devs can get started with work right away without needed to set up a DB at all. However, as a result the app loses all data when its restarted.

If you deploy it to Business Technology Platform using a HANA Cloud database, though, the data will persist. Check out this documentation for more information about how to deploy to BTP and set up the HANA database instance.

Once you have a HANA cloud instance set up, if you configure your CAP project correctly, then you can link to that HANA cloud instance from your local development environment and thus have access to persisted data between restarts. This blog post talks about how to do that.

**edit**

It looks like you can configure the SQLite database to persist data using the settings described here:

https://cap.cloud.sap/docs/java/development/#file-based-storage

Also, as of the most recent release of CAP, SQLite has been replaced by H2 as the default database, so the current blog series is a little out of date. I'll have to go back and update it.

--

--

Brian Heise
Brian Heise

Written by Brian Heise

Full Stack web developer employed at Liferay Japan

No responses yet