Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions build.sh

This file was deleted.

4 changes: 0 additions & 4 deletions netlify.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,2 @@
[[integrations]]
name = "snooty-cache-plugin"

[build]
publish = "snooty/public"
command = ". ./build.sh"
4 changes: 2 additions & 2 deletions source/activity.txt
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ Apps log the following event types:
- :ref:`Schema <logs-schema>`, including any events related to
changes to an application's schema.

- :ref:`Trigger <logs-trigger>`, including Database Triggers,
Authentication Triggers, and Scheduled Triggers.
- :ref:`Trigger <logs-trigger>`, including Database Triggers and
Scheduled Triggers.

Error Logs
~~~~~~~~~~
Expand Down
6 changes: 3 additions & 3 deletions source/deprecation.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ Hosting and GraphQL From App Services page <migrate-hosting-graphql>`.
Triggers Are Not Deprecated
----------------------------

Triggers are not deprecated. This service will continue to be available. App
Services Functions will also continue to be available to use with Triggers.
Triggers are not deprecated. This service continues to be available in the
Atlas UI. Functions also continue to be available to use with Triggers.

Atlas Data API and HTTPS Endpoints Are Deprecated
-------------------------------------------------
Expand Down Expand Up @@ -85,7 +85,7 @@ the chosen alternative solution.
Functions
~~~~~~~~~

Functions will continue to be available within the context of Triggers. Use
Functions continue to be available within the context of Triggers. Use
cases where a function was being directly accessed through a Device SDK are
impacted and must migrate to a different solution.

Expand Down
2 changes: 1 addition & 1 deletion source/functions/handle-errors.txt
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ by using recursion in error-handling blocks.
Use Database Triggers to Retry
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

You can also retry Functions by using a :ref:`Database Trigger <database-trigger>` to execute retries and a MongoDB collection to track previously-failed executions.
You can also retry Functions by using a `Database trigger <https://www.mongodb.com/docs/atlas/atlas-ui/triggers/database-triggers/>`__ to execute retries and a MongoDB collection to track previously-failed executions.

On a high-level, this process includes the following components:

Expand Down
9 changes: 4 additions & 5 deletions source/introduction.txt
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,7 @@ Serverless:

Dynamic and responsive:
- React to data changes in MongoDB Atlas, process data from HTTPS endpoints,
or run Atlas Functions on a schedule with
Atlas Triggers.
or run Atlas Functions on a schedule with Atlas Triggers.
- Get up and running quickly for free, then scale according to the demands of your application.
- Pay for and receive only the exact amount of compute you need at any given time
with usage-based pricing. Usage under a certain amount per day is always free.
Expand Down Expand Up @@ -214,9 +213,9 @@ services to do things like:

- Use Sync to synchronize data between mobile clients and the linked
MongoDB Atlas collection.
- Host a Todo web app using :ref:`Atlas Device SDK for Web <web-intro>`
- Manage event-driven :ref:`Database Triggers <database-trigger>`
to update views in a separate collection
- Host a Todo web app using :ref:`Atlas Device SDK for Web <web-intro>`.
- Manage event-driven `Database triggers <https://www.mongodb.com/docs/atlas/atlas-ui/triggers/database-triggers/>`__ to update
views in a separate collection.

Template apps are working apps you can run and change to experiment with
App Services. These apps are a good choice for developers who prefer to learn by
Expand Down
2 changes: 1 addition & 1 deletion source/mongodb.txt
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ code and can access a change event for detailed information about the
change that caused it to run.

To learn more about how triggers work and how to define your own, see
:ref:`Database Triggers <database-trigger>`.
`Database triggers <https://www.mongodb.com/docs/atlas/atlas-ui/triggers/database-triggers/>`__.

.. important::

Expand Down
2 changes: 1 addition & 1 deletion source/mongodb/preimages.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Document Preimages
Overview
--------

Every :ref:`database trigger <database-trigger>` execution has a related
Every `database trigger <https://www.mongodb.com/docs/atlas/atlas-ui/triggers/database-triggers/>`__ execution has a related
change event. You can configure these change events to include
**document preimages**. A preimage is a snapshot of a document *before*
a change.
Expand Down
2 changes: 1 addition & 1 deletion source/reference/service-limitations.txt
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ the limitations for each cluster size:
.. note::

App Services opens a single change stream on each collection that is
associated with a :ref:`Database Trigger <database-trigger>` or
associated with a `Database trigger <https://www.mongodb.com/docs/atlas/atlas-ui/triggers/database-triggers/>`__ or
:ref:`Device Sync <sync>` operation.

.. important:: Usage Recommendation
Expand Down
2 changes: 1 addition & 1 deletion source/reference/template-apps.txt
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ to the ``--template`` flag of the :ref:`appservices-apps-create` and

* - ``triggers``
- Manage Database Views
- Event-driven :ref:`Database Trigger <database-trigger>` template to update a view in a separate collection.
- Event-driven `Database trigger <https://www.mongodb.com/docs/atlas/atlas-ui/triggers/database-triggers/>`__ template to update a view in a separate collection.
- None

* - ``web.mql.todo``
Expand Down
144 changes: 7 additions & 137 deletions source/triggers.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,145 +8,15 @@ Atlas Triggers
.. meta::
:description: Use Atlas Triggers to execute application and database logic in response to events or schedules.

.. toctree::
:titlesonly:
:caption: Triggers
:hidden:

Database Triggers </triggers/database-triggers>
Authentication Triggers </triggers/authentication-triggers>
Scheduled Triggers </triggers/scheduled-triggers>
Disable a Trigger </triggers/disable>
Send Trigger Events to AWS EventBridge </triggers/aws-eventbridge>
Triggers Code Examples <https://github.com/mongodb/atlas-app-services-examples/tree/main/triggers-examples>
Atlas Triggers are part of the Atlas database tools. There are 2 trigger types:

.. contents:: On this page
:local:
:backlinks: none
:depth: 2
:class: singlecol
- `Database triggers <https://www.mongodb.com/docs/atlas/atlas-ui/triggers/database-triggers/>`__,
which respond to document-level, collection-level, or database-level changes.

Atlas Triggers execute application and database logic. Triggers
can respond to events or use pre-defined schedules.
- `Scheduled triggers <https://www.mongodb.com/docs/atlas/atlas-ui/triggers/scheduled-triggers/>`__,
which execute functions according to a pre-defined schedule.

Triggers listen for events of a configured type. Each Trigger links to a
specific :doc:`Atlas Function </functions>`.
When a Trigger observes an event that matches your
configuration, it *"fires"*. The Trigger passes this event object as the
argument to its linked Function.
For more information on creating and managing Triggers, see
`Triggers <https://www.mongodb.com/docs/atlas/atlas-ui/triggers/>`__.

A Trigger might fire on:

- A specific *operation type* in a given Collection.
- An authentication event, such as user creation or deletion.
- A scheduled time.

App Services keeps track of the latest execution time for each
Trigger and guarantees that each event is processed at least once.

.. _trigger-types:

Trigger Types
-------------

App Services supports three types of triggers:

- :doc:`Database triggers </triggers/database-triggers>`
respond to document insert, changes, or deletion. You can configure
Database Triggers for each linked MongoDB collection.

- :doc:`Authentication triggers </triggers/authentication-triggers>`
respond to user creation, login, or deletion.

- :doc:`Scheduled triggers </triggers/scheduled-triggers>`
execute functions according to a pre-defined schedule.

.. _trigger-limitations:

Limitations
-----------

Atlas Function Constraints Apply
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Triggers invoke Atlas Functions. This means they have the same
constraints as all Atlas Functions.

:ref:`Learn more about Atlas Function constraints.<function-constraints>`

.. _event_processing_throughput:

Event Processing Throughput
~~~~~~~~~~~~~~~~~~~~~~~~~~~

Triggers process events when capacity becomes available. A Trigger's
capacity is determined by its event ordering configuration:

- Ordered triggers process events from the change stream one at a time
in sequence. The next event begins processing only after the previous
event finishes processing.

- Unordered triggers can process multiple events concurrently, up to
10,000 at once by default. If your Trigger data source is an M10+
Atlas cluster, you can configure individual unordered triggers to
exceed the 10,000 concurrent event threshold. To learn more, see
:ref:`Maximum Throughput Triggers <triggers-maximum-throughput>`.

Trigger capacity is not a direct measure of throughput or a guaranteed
execution rate. Instead, it is a threshold for the maximum number of
events that a Trigger can process at one time. In practice, the rate at
which a Trigger can process events depends on the Trigger function's run
time logic and the number of events that it receives in a given
timeframe.

To increase the throughput of a Trigger, you can try to:

- Optimize the Trigger function's run time behavior. For example, you
might reduce the number of network calls that you make.

- Reduce the size of each event object with the Trigger's
:ref:`projection filter <trigger-project-expression>`. For the best
performance, limit the size of each change event to 2KB or less.

- Use a match filter to reduce the number of events that the Trigger
processes. For example, you might want to do something only if a
specific field changed. Instead of matching every update event and
checking if the field changed in your Function code, you can use the
Trigger's match filter to fire only if the field is included in the
event's ``updateDescription.updatedFields`` object.

Number of Triggers Cannot Exceed Available Change Streams
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

App Services limits the total number of Database Triggers. The size of your
Atlas cluster drives this limit.

Each Atlas cluster tier has a maximum number of supported change
streams. A Database Trigger requires its own change stream. Other App Services
also use change streams, such as Atlas Device Sync. Database Triggers
may not exceed the number of available change streams.

:ref:`Learn more about the number of supported change streams for Atlas tiers.
<mongodb-service-limitations-change-streams>`

.. _trigger-diagnose-duplicate-events:

Diagnose Duplicate Events
-------------------------

During normal Trigger operation, Triggers do not send duplicate events.
However, when some failure or error conditions occur, Triggers may deliver
duplicate events. You may see a duplicate Trigger event when:

- A server responsible for processing and tracking events experiences a
failure. This failure prevents the server from recording its progress in a
durable or long-term storage system, making it "forget" it has processed
some of the latest events.
- Using unordered processing where events 1 through 10 are sent simultaneously.
If event 9 fails and leads to Trigger suspension, events like event 10 might
get processed again when the system resumes from event 9. This can lead to
duplicates, as the system doesn't strictly follow the sequence of events and
may reprocess already-handled events.

If you notice duplicate Trigger events, check the :ref:`logs` for suspended
Triggers or server failures.
Loading
Loading