> For the complete documentation index, see [llms.txt](https://docs.bdb.ai/bdb-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.bdb.ai/bdb-documentation/data-pipeline/getting-started/homepage/creating-pipeline/events-kafka-and-db-sync.md).

# Events \[Kafka and DB Sync]

### Creating a Kafka Event

* Navigate to the [*<mark style="color:blue;">**Pipeline Editor**</mark>*](/bdb-documentation/data-pipeline/getting-started/pipeline-workflow-editor.md) page.                        &#x20;
* Click the ***Toggle Event Panel*** <img src="/files/lcbrhUR3alAfJmzyVJk6" alt="" data-size="line">icon from the header.

![](/files/Mon8UgNxA3vtUNnUr8NK)

* The Events Panel appears, and the Toggle Event Panel icon gets changed as <img src="/files/H6uwsxKx5kyTTCpaFz01" alt="" data-size="line">suggesting that the event panel is displayed.
* Click the ***Add New Event*** icon from the Event Panel.

![](/files/iR6vb8EF1Vwrbqpa6Ukr)

* The ***New Event*** window opens.

&#x20;     ![](/files/1EdaxOwaX3Z7HHnYkfiH)

* Provide a name for the new Event.
* Select Event Duration: Select an option from the below-given options.

&#x20;   **\* Short (4 hours)**

&#x20;   **\* Medium (8 hours)**

&#x20;   **\* Long (48 hours)**

&#x20;   **\* Full Day (24 hours)**

&#x20;   **\* Long (48 hours)**

&#x20;   **\* Week (168 hours)**

{% hint style="info" %}
*<mark style="color:green;">Please Note</mark>: The event data gets erased after 7 days if no duration option is selected from the available options. The Offsets expire as well.*
{% endhint %}

* Provide No. of Partitions (1-10).
* No. of Outputs: The user can define the number of outputs using this field.
* Checkmark the '**Is Failover'** option to enable the Failover Event.
* Select a Pipeline using the drop-down menu if you have selected the ‘**Is Shared**?’ option.
* Click the ***Add Event*** option.

![](/files/UI0ZnBrT3fvQycc14sl2)

* A notification message appears.
* The newly created Event gets added to the ***Private*** tab in the Events panel.

![](/files/qFgmm8EzRbrEsKq0prcn)

### **Updating a Kafka Event**

The user can use the below-given steps to update a Kafka Event.

* Drag the created Event component to the Pipeline Editor canvas.

![Drop the Event from the event panel. ](/files/ebChH2hBuHkFiYfk2kzX)

* Click the dragged Event component to open the **Basic Info** configuration field&#x73;**.**
* The user can edit the following information (except No. of Partition and Event Duration):
* Event Name: Modify the event name.
* No. of Outputs: Set the number of outputs (the maximum allowed number of outputs are 3).
* ‘Is Failover?’: Enable this option to create a failover event.
* Select Pipeline: Select one pipeline or multiple pipelines using the drop-down list.
* Click the ***Save Event*** icon to save the changes.

![Basic Info of the created event.](/files/Dh3yh9fjg08Rc1CCa9ah)

* The user gets a notification message stating that the pipeline update is a success.
* The targeted Event component gets updated.

![](/files/t7N7bX1lgFXKOnLz0MmR)

### **Connecting Event to a Component**

* Drag a (reader) component to the canvas.
* Configure the parameters of the dragged reader.

![Drag the Event from the Events Panel.](/files/vygV7nedAC9ZYLVEwbtp)

* Drag the Event from the Events Panel.
* Connect the dragged reader component as the input connection to the dragged Event.

![](/files/hszJrwpT2zxtJKQJbJl0)

* Click the ***Update Pipeline*** icon to save the pipeline workflow.

### Creating a DB Sync Event

* Navigate to the Pipeline Editor page.                        &#x20;
* Click the **Toggle Event Panel** <img src="/files/lcbrhUR3alAfJmzyVJk6" alt="" data-size="line"> icon from the header.
* The Events Panel appears, and the Toggle Event Panel icon gets changed as <img src="/files/H6uwsxKx5kyTTCpaFz01" alt="" data-size="line">, suggesting that the event panel is displayed.
* Click on the ***DB Sync*** tab. Click on the ***Add New DB Sync*** icon from the Event Panel.

&#x20;     ![](/files/6Ojk0aJyNJvjir2ryU3s)

* The **Create Data Sync** window opens.
  * Provide a display name for the new DB Sync.
  * Select Connection id: \[pre- defined by the user in the settings page]
  * Click the ***Save*** option.

&#x20;         ![](/files/TNO3L6TYyO9rkk2FaFLM)

* Drag and drop ***DB Sync Event*** to the workflow editor.
* Click on the dragged Data Sync component.    &#x20;

<figure><img src="/files/XjapK4s05PaIfYVal7Lu" alt=""><figcaption></figcaption></figure>

* &#x20;The ***Basic Information*** tab appears with the following fields:

  * **Table name**: Specify table name.
  * **Driver**: this field will be pre-selected.
  * **Primary Key**: This field is optional.
  * **Save Mode**: select anyone save mode from the drop-down.              &#x20;
  * Click on the ***Save*** ***Data Sync*** icon to save the DB Sync information. &#x20;

  <figure><img src="/files/aIZQxlgKbCgIZ7rjy54y" alt=""><figcaption></figcaption></figure>
* Connect the dragged ***DB Sync*** ***Event*** to the reader component as displayed below:

&#x20;    ![](/files/uNDWgY12RqZi3LnTELQ2)

{% hint style="success" %}
&#x20;**N*****ote:** In Save mode, we have two options.*

&#x20; *i. Append*

&#x20;*ii. Upsert: One extra field will be displayed for **upsert save mode** i.e.: **Composite Key.***
{% endhint %}
