November 19, 2018

View and Materialized View

standard view means SQLs, it’s composed by SQLs join some tables or function calls, etc, it hides low level implements, just give you a composed model, but if you have a large data set view, it could slow down your database performance as it should execute SQLs when you query it. materialized view records result until you refresh it, so it’s better for cache, performance.

November 7, 2018

Business Logic Code

业务逻辑代码很模糊,感觉什么都算业务逻辑,比如某个字段为空时抛出异常,时间范围大于N时执行方法A,否则执行方法B(如下代码) Read more

November 2, 2018

Async Report Download Pattern

后台有个报表产生数据较大,查询较长时间段的数据可能会让后端进程block不能处理其他请求,本来后台网站就没多少流量,所以并没有开很多后端进程。 Read more

November 1, 2018

Periodic Job Pattern

There is a kind of work, periodically query data and send them to remote API or save to file, e.g. every night, query yesterday purchase data and send them to vendor’s report service. Read more

October 7, 2018

Static Resource Cache Policy

前后端分离越来越明显,整个前端都可独立运行,为了让前端运行得更快,将静态资源放CDN是一个经济的选择,尽量让静态资源缓存却是一个更好的方法,因为CDN再快,也快不过放在缓存中的数据(当然,CDN也会用缓存)。 Read more

Powered by Hugo & Kiss.