前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >Should we still build application buffer on top of CDS view

Should we still build application buffer on top of CDS view

作者头像
Jerry Wang
发布2020-03-17 11:09:45
3540
发布2020-03-17 11:09:45
举报

The new implementation of API CRM_PRODUCT_SALES_READ_API in S4 will consume CDS view to get product sales related data from S4 table. There are two approaches: with or without application buffer.

Approach1: directly consume CDS view without buffering in application

The sample code would be:

  • Pros: simple logic, easy to maintain
  • Cons: potential performance loss for a large data volume if API is called multiple times in the same session? At least in CRM WebUI where opportunity and lead application will still be used in codeployment system, it is possible for all those API to be called in the same session repeatedly.

Approach2: add an application layer buffer

Pros: avoid unnecessary CDS view read request Cons: if attributes in buffer comes from different CDS views, the buffer invalidation logic tends to be more complex. Difficult to maintain.

How much performance benefit we can gain from buffer approach

In ER9, I have a test CDS view which is built on MARA consisting of 109.791 entries:

I use two different methods to read data from this CDS view, one with buffer approach and the other one without. In each method, the CDS view is read 100 TIMES with two given product types:

Test result

Approach with buffer is 40~ 50 times faster than the one without buffer. However, this read is done based on a large data volume as test set. In real WebUI use scenario, the data set is far smaller. This performance test needs to be done again based on a kind of test data which is similar as the data used in real world.

“As my understanding, this buffer is independent on the database layer, it’s in the application layer. Is that right?” Answer by Jerry : Yes, it is independent on Database layer. However, it is NOT in application layer as well. We as application developer can NEVER have any control on it. It is on Netweaver system layer, see picture below:

“If my understanding is right, the CDS view buffer can be the substitution of the API buffer?”

Answer by Jerry: No, it depends. We as application developer should still design application layer buffer. One sentence to summarize: table buffer - no matter for normal DDIC table or CDS view - should ONLY be switched on for those whose content are rare to change, and the number of total table entries are not so large - for example configuration table or system table. For application table whose entries are frequently changed and table content are huge, the buffer must be turned off. Otherwise the expensive SAP memory are easily exhausted and system performance is dramatically degraded due to buffer synchronization overhead. Compare the buffer setting below for application table and configuration table:

figure1: buffer switched off for application table

figure2: buffer switched on for configuration table

本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2020-03-13 ,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • Approach1: directly consume CDS view without buffering in application
  • Approach2: add an application layer buffer
  • How much performance benefit we can gain from buffer approach
  • Test result
相关产品与服务
数据库
云数据库为企业提供了完善的关系型数据库、非关系型数据库、分析型数据库和数据库生态工具。您可以通过产品选择和组合搭建,轻松实现高可靠、高可用性、高性能等数据库需求。云数据库服务也可大幅减少您的运维工作量,更专注于业务发展,让企业一站式享受数据上云及分布式架构的技术红利!
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档