joeCarf commented on issue #49:
URL: 
https://github.com/apache/rocketmq-schema-registry/issues/49#issuecomment-1370587302

   > The client obtains the schema through `schemaRegistryClient`. It is 
necessary to consider adding schema cache on the client side, to avoid too much 
remote requests for serialization or deserialization.
   > 
   > Cache needs to be designed with reasonable key-value struct and expiration 
mechanism.
   
   hi, @MatrixHB 我最近在设计客户端缓存,同时也参考了kafka schema registry的实现,但在过程中遇到了一点问题想和您讨论一下 
:
   
   1. 在使用过程中哪些函数的使用频率更高,还是说对于client中的所有函数都需要进行缓存呢
   2. 
我理解缓存主要应用于getschema的各个函数中,但由于查询的入参组合种类很多,我可能不得不对于每种组合都进行缓存。例如对于getSchemaByRecordId函数,缓存的key需要设置为SubjectAndId;而在getSchemaBySubjectAndVersion中,缓存的key则需要为SubjectAndVersion,因此就需要两个map来进行分别存储。这种方法的缺点在于会存在一些重复的value,占用的空间更多,因此想和您讨论一下是否有更好的解决方法。
   3. 
由于客户端中的getschema方法需要的返回值都是GetSchemaResponse类型,因此我的缓存value也保存这个类型的值。这样的优点在于能够直接返回缓存中的value,但是缺点在于占用更多的空间,并且在register的过程中可能无法更新缓存(因为数据无法拼接成一个GetSchemaResponse)。我暂时没有想到更好的办法


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to