# Integrated Database and Web Server

Let's deepen into technical details in order to understand how two layers, application and database, are physically merged into one.\
We can say that database and application server are represented by two parallel running processes. In the picture they are presented as ScDATA and ScCODE respectively. Inbound and outbound traffic towards those processes is initially handled by Gateway process.

![](https://blobscdn.gitbook.com/v0/b/gitbook-28427.appspot.com/o/assets%2Fstarcounter%2F-KtlXIfH9-aKypOu9PcB%2F-KtlXLIx1NBxEuqS_zbR%2FConnects.gif?alt=media\&token=d9ecfe43-57b9-401b-b63b-ede9027a43f3)

Distinction of depicted processes:

1. **ScNETWORKGATEWAY** represents a Gateway for network traffic, delivering requests to execute and sending responses back (read more [here](/2.3.2/guides/network/network-gateway.md));
2. **ScCODE** represents Codehost as a run-space for all the applications operating on the same Database;
3. **ScDATA** represents Database and manages database memory handling for Codehost activity.

Communication between processes is organized through the shared memory. This allows processes to efficiently exchange messages, preserving processes isolation, security and consistency.

## Codehost Isolation

Gateway and Codehost processes operate on one shared memory segment, while Database and Codehost on another, meaning that Gateway has no direct access to Database process - it can only communicate with the Codehost.

This is done for multiple reasons:

* Failure/restart of the Codehost process does not affect the Database.
* Developers can iterate application versions and update those without Database process restart (only Codehost is restarted and being reconnected to Database);
* Database is isolated from networking process therefore it is impossible to affect the Database directly through Gateway.
* In the future, each application will have their own Codehost processes to ensure app independence and overall system stability.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.starcounter.io/2.3.2/starcounter/integrated-database-and-web-server.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
