Skip to content

Commit 67104f8

Browse files
committed
More polishing applied to database guides overview
1 parent c567eb8 commit 67104f8

File tree

1 file changed

+23
-27
lines changed

1 file changed

+23
-27
lines changed

guides/databases/index.md

Lines changed: 23 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,56 @@
1-
---
2-
uacp: Linked from https://help.sap.com/products/BTP/65de2977205c403bbc107264b8eccf4b/e4a7559baf9f4e4394302442745edcd9.html
3-
---
4-
51

62
# CAP-level Database Integration
73

8-
CAP application developers [focus on their domain](../../get-started/features#focus-on-domain), while CAP takes care of all aspects of database integration. This includes translating CDS models to native persistence models, schema evolution, deployment, as well as runtime querying – all of that in a database-agnostic way. [SQLite](./sqlite) <sup>1</sup> in-memory databases are automatically used in [inner-loop development](../../get-started/features#fast-inner-loops), while in production, [SAP HANA](./hana) <sup>2</sup> is used by default.
4+
CAP application developers [focus on their domain](../../get-started/features#focus-on-domain), while CAP takes care of all aspects of database integration. This includes translating CDS models to native persistence models, schema evolution, deployment, as well as runtime querying – all of that in a database-agnostic way. [SQLite](./sqlite) <sup>1</sup> in-memory databases are automatically used in inner-loop development, while in production, [SAP HANA](./hana) <sup>2</sup> is used by default.
95
{.abstract}
106

11-
> _<sup>1</sup> or [H2](./h2) in case of Java_.\
7+
> _<sup>1</sup> or [H2](./h2) in case of CAP Java-based projects_.\
128
> _<sup>2</sup> or [PostgreSQL](./postgres) in edge cases_.
139
1410

15-
### Served Out of the Box
16-
17-
When you launch a CAP server, for example with `cds watch`, an in-memory database service is automatically boostrapped, as indicated by such log output:
11+
### Best Practices, Served Out of the Box
1812

19-
```log
20-
[cds] - connect to db > sqlite { url: ':memory:' }
21-
> init from bookshop/db/data/sap.capire.bookshop-Authors.csv
22-
> init from bookshop/db/data/sap.capire.bookshop-Books.csv
23-
> init from bookshop/db/data/sap.capire.bookshop-Books.texts.csv
24-
> init from bookshop/db/data/sap.capire.bookshop-Genres.csv
25-
/> successfully deployed to in-memory database.
26-
```
13+
> [!tip] Served Out of the Box
14+
> The CAP framework handles all compilation to DDL automatically, for example when you run `cds watch` or `cds deploy`. You typically don't need to worry about the details unless you want to inspect or customize the generated DDL statements. The guides in this section explain how things work under the hood. If you are on a fast track, you can safely skip them to great extent.
2715
28-
The illustration below shows what happens behind the scenes:
16+
The illustration below shows what happens automatically under the hood:
2917

30-
- CDS models are compiled to native DDL
18+
- CDS models are compiled to database-native SQL/DDL
3119
- which get deployed to the configured database, and
32-
- initial data from CSV files is loaded into the database tables.
20+
- initial data from CSV files is loaded into the database tables
21+
- CQL queries from CAP services are served automatically.
3322

3423
![Architecture diagram showing CAP database integration flow. Initial data in CSV files and CDS models in CDL and CQL format are compiled to native SQL and DDL statements, which are then deployed to a database. CAP Services query the database using CQL. Four database types are shown as supported options: SAP HANA, SQLite, H2, and PostgreSQL, all connecting to the central database component.](assets/overview.drawio.svg)
3524

36-
> [!tip] Everything Served Out of the Box
37-
> The CAP framework handles all compilation to DDL automatically, for example when you run `cds watch` or `cds deploy`. You typically don't need to worry about the details unless you want to inspect or customize the generated DDL statements. The guides in this section explain how things work under the hood. If you are on a fast track, you can safely skip them to great extent.
25+
> [!tip] Following the Calesi Pattern
26+
> The implementations of the CAP database layers follow the design principles of CAP-level Service Integration:
27+
> - Database Services are CAP services themselves, which...
28+
> - allows applications to extend them using standard CAP APIs
29+
> - provide database-agnostic interfaces to applications
30+
> - provide mocks for local development out of the box
31+
32+
> [!tip] Promoting Fast Inner-Loop Development
33+
> Through the ability to easily swap production-grade databases like SAP HANA with SQLite or H2 in-memory databases during development, without any changes to CDS models nor implementations, we greatly promote inner-loop development with fast turnaround cycles, as well as speeding up test pipelines and minimize TCD.
3834
3935

4036
### Database-independent Guides
4137

4238
The following guides explain the details of CAP-level database integration, which are mostly database-agnostic, and apply to all supported databases:
4339

4440
[CDL Compiled to DDL](cdl-to-ddl.md)
45-
: How CDS models in CDL format are compiled to native DDL statements for different databases.
41+
: How database-agnostic CDS models in CDL format are compiled to native DDL statements for different databases.
4642

4743
[CQL Compiled to SQL](cql-to-sql.md)
48-
: How CDS queries in CQL format are compiled to native SQL statements for different databases.
44+
: How database-agnostic CDS queries in CQL format are compiled to native SQL statements for different databases.
4945

5046
[Adding Initial Data](initial-data.md)
51-
: How to add initial data to the database using CSV files.
47+
: How to provide initial data and test data using CSV files, which are loaded into the database automatically.
5248

5349
[Schema Evolution](schema-evolution.md)
54-
: How to manage schema changes and evolution in the database.
50+
: How to manage schema changes with appropriate schema evolution strategies for development and production.
5551

5652
[Performance Guide](performance.md)
57-
: How to optimize database performance and tuning.
53+
: Pointing out performance considerations, and common pitfalls.
5854

5955

6056
### Database-specific Guides

0 commit comments

Comments
 (0)