官术网_书友最值得收藏!

How it works...

In this recipe, we implement a listener function that consumes upstream events and populates a materialized view that is used by a Backend For Frontend service. This function is a stream processor, such as the one we discussed in the Creating a stream processor recipe in Chapter 1, Getting Started with Cloud-Native. The function performs a filter for the desired events and then transforms the data in a map step to the desired materialized view. The materialized view is optimized to support the requirements of the query needed by the BFF. Only the minimum necessary data is stored, and the optimal database type is used.

In this recipe, the database type is a Cognito dataset. A Cognito dataset is a good choice for a materialized view when network availability is intermittent, and thus an offline-first approach is needed to synchronize data to a user's devices. The data must also be specific to a user so that it can be targeted to the user based on the user's identityId.  Due to the intermittent nature of connectivity, the asOf timestamp is included in the record so that the user can access the latency of the data.

主站蜘蛛池模板: 哈尔滨市| 淮滨县| 仪征市| 天长市| 盖州市| 远安县| 边坝县| 福建省| 泊头市| 女性| 宁乡县| 彰武县| 南汇区| 太康县| 顺昌县| 惠来县| 共和县| 杂多县| 革吉县| 登封市| 新兴县| 芒康县| 炎陵县| 闽清县| 柳河县| 开原市| 卓资县| 石河子市| 南郑县| 林芝县| 灵山县| 枞阳县| 通榆县| 漾濞| 平塘县| 沙田区| 株洲市| 观塘区| 武平县| 贡嘎县| 新巴尔虎右旗|