Appian's data fabric allows you to unify, secure, and optimize data spread across the enterprise. Typically, writing and syncing data in record types is as easy as using one of Appian’s smart services like Write Records, Write to Data Store Entity, and Write to Multiple Data Store Entities. However, when designing autoscaled processes, you may want to avoid using these smart services directly. Synced record types are limited to handling ~1,000 write requests per minute for processes writing data in small batches (1-10 rows).
Trying to sync data above this level of throughput will fail and can cause record type invalidations. When using the Write Record smart service, writes will be throttled when exceeding a certain limit. This means that the nodes will fail and must be manually restarted, but the synced record type will remain available. When using Write to Data Store, failed writes will cause an invalidation, bringing down the impacted record type until a manual full sync is performed.
This guide explains how to design a process that supports writes to data fabric when peak times require more than ~1,000 write requests per minute across all of the applications on your site. This is accomplished through an incremental sync pattern where data is synced into the record types independently from the writes to the source table in large batches enabling up to 200,000 rows to be synced per minute.
Let’s say we have a process model with Autoscale enabled, which receives data over an API call, performs some transformations on the data, and then writes a single record to a synced record type.
Typically, the API is called only 200 to 300 times per minute. However, at peak times, the API is called over 10,000 times in a single minute. At these peak times, the Write Records node fails due to data sync limitations. Upon reaching data sync write throughput limitations, write performance will degrade, leading to request timeouts. Failed requests will return either 'could not obtain a reservation within the time limit' or 'the request has timed out due to the system being busy.'
In order to allow the process model to continue to process data even in times of peak load, we need to implement an independent sync pattern where data is synced in batches rather than one row at a time.
To avoid automatically syncing data to data fabric from the process model, an independent data store or a connected system data source must be created and used in the autoscaled process model to write data. This will allow us to write data only to the source table at first, and sync it in the record type independently.
In the autoscaled process model:
Now, your autoscaled process model will only write to the source table instead of automatically syncing data in the record type.
After re-configuring the autoscaled model, create a separate process model running without autoscale enabled to incrementally sync data the record type from the source table.
To configure incremental sync:
a!queryEntity( entity: cons!JLT_RecordEntity, query: a!query( selection: a!querySelection( columns: { a!queryColumn( field: "id" ) } ), logicalExpression: a!queryLogicalExpression( operator: "AND", filters: { a!queryFilter( field: "modifiedOn", operator: ">", value: ri!lastSyncTime ) }, ignoreFiltersWithEmptyValues: true ), pagingInfo: a!pagingInfo( startIndex: 1, batchSize: 50, sort: a!sortInfo( field: "modifiedOn", ascending: true ) ) ), fetchTotalCount: false )
That’s it! This pattern of ingesting data in larger batches can support syncing up to 200,000 rows per minute in record types across all applications on your site, with data being updated in 5 minutes or less.