首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往

《使用Gin框架构建分布式应用》阅读笔记:p101-p107

《用Gin框架构建分布式应用》学习第7天,p101-p107总结,总计7页。

一、技术总结

1.StatusBadRequest vs StatusInternalServerError

写代码的时候有一个问题,什么时候使用 StatusBadRequest(400错误),什么时候使用 StatusInternalServerError(500错误)?

2.cache(缓存)

使用缓存的直接原因是为了加快查询速度,从而提升用户体验感。所以就在代码中引入了Redis,因为Redis是内存型数据库( in-memory database,使用的是RAM), 而MySQL和MongoDB查询使用的是disk。in-memory只是Redis快的其中一个原因,其它原因未见作者提及。

(1)cache hit(缓存命中)

(2)cache miss(缓存未命中)

二、英语总结

1.metrics

p106, That is why  response time is one of the most important metrics to evaluate when developing a RESTful API.

(1)metric: me-("to measure")。c.衡量标准。

刚开始晃眼一看以为是“矩阵(matrix)”的意思。

2.tremendous

p106,  Let's imagine that we have a tremendous number of recipes in our MongoDB database.

(1)tremere: to tremble/to shake. Tremere is related to the idea of shaking with fear,这是最开始的意思, 因为害怕等而引起的颤抖。

(2)Hyperbolic or intensive sense of "extraordinarily great or good, immense, such as excites astonishment," is attested from 1812, paralleling semantic changes in terrific, terrible, dreadful, awful, etc。随着不断的发展,后面又有多出了Hyperbolic or  intensive sense(夸张的,或者强烈的意思),表示“巨大的,可怕的”。

三、其它

今天没有什么想说的。

四、参考资料

1. 编程

2. 英语

  • 发表于:
  • 原文链接https://page.om.qq.com/page/OZofRVXGUsDyN0NVd85fVZwg0
  • 腾讯「腾讯云开发者社区」是腾讯内容开放平台帐号(企鹅号)传播渠道之一,根据《腾讯内容开放平台服务协议》转载发布内容。
  • 如有侵权,请联系 cloudcommunity@tencent.com 删除。

扫码

添加站长 进交流群

领取专属 10元无门槛券

私享最新 技术干货

扫码加入开发者社群
领券