IT技术精华 http://it.taocms.org/ 聚合国内IT技术精华文章,分享IT技术精华,帮助IT从业人士成长 2019-04-20 IT技术精华 14576 十大常用软件架构模式简介 大型的企业级系统是如何设计的呢?想必大家都曾经有过这样的疑惑。大型软件开发前,我们必须选择一种合适的架构,它既要提供我们想要的功能,质量也要过关。因此,在应用不同的架构之前,我们有必要熟悉一下这些架构。

什么是架构模式?

根据维基百科,

针对软件架构中给定上下文的常见问题,架构模式是一种通用的、可复用的解决方案。它与软件设计模式相似,但范围更广。

在这篇文章中,我将简要地说明一下10种常用的架构模式,以及它们的用法和利弊。

  1. 分层模式
  2. 客户端 – 服务端模式(cs模式)
  3. 主从模式
  4. 管道过滤器模式
  5. 代理模式
  6. 点对点模式
  7. 事件总线模式
  8. 模型-视图-控制器模式(MVC模式)
  9. 黑板模式
  10. 解释器模式

1. 分层模式

这种模式可用于构建能分解成多组子任务的程序,每个子任务处在特定的抽象级别中。每一层为更高一层提供服务。

以下是最常见的通用信息系统中的4个层次。

  • 表示层(亦称为 UI层)
  • 应用层(亦称为 服务层)
  • 业务逻辑层(亦称为 领域层)
  • 数据访问层(亦称为 持久层)

用法

  • 通用桌面应用
  • 电子商务web应用

分层模式

2. 客户端-服务端模式

该模式包含一个服务端和多个客户端。服务端组件给多个客户端组件提供服务。客户端向服务端请求服务,服务端提供相关的服务。此外,服务端会持续监听客户端的请求。

用法

  • 在线应用,例如电子邮件、文件共享和存储。

客户端-服务端模式

3. 主从模式

该模式包含两部分;主和从。主组件给相同的从属组件分配工作,并根据从 从属组件 中返回的结果计算最终结果.

用法

  • 主服务器是权威来源,从属数据库与其进行同步。
  • 在计算机系统中,外围设备连接到总线中(主驱动和从属驱动)。

主从模式

4. 管道过滤模式

该模式可用于构建生成和处理数据流的系统。每个处理步骤包含在一个过滤组件中。待处理的数据通过管道传递。这些管道可用于数据缓存或同步。

用法

  • 编译器。连续的过滤器执行词法分析,解析,语意分析,和代码生成。
  • 生物信息学中的工作流。

管道过滤模式

5. 代理模式

该模式用于构建伴有解耦组件的分布式系统。这些组件通过远程服务调用来和彼此互动。代理组件负责协调组件之间的通信。

服务器将其功能(服务和特性)发布到代理。客户端从代理请求服务,代理根据注册表把客户端重定向到合适的服务。

用法

代理模式

6. 点对点模式

在该模式中,相同的组件被称为对等组件。对等体既可以作为客户端,请求其他对等体的服务,也可以作为服务端,为其他对等体提供服务。一个对等体可以作为客户端、或者服务端、或者兼任两者,它能随着时间动态变更自己的角色。

用法

点对点模式

7. 事件总线模式

该模式主要处理事件,并且有4个主要组件:事件源,事件监听者,事件通道和事件总线。事件源发布消息到事件总线上的特定通道。监听者订阅特定通道。如果监听者订阅的通道有消息发布,那么监听者就会得到通知。

用法

  • 安卓开发
  • 通知服务

事件总线模式

8. 模型-视图-控制器模式(MVC模式)

该模式亦被称为MVC模式,它将交互式应用分成3个部分,

  1. 模型 – 包含核心功能和数据
  2. 视图 – 给用户展示信息(可能不止一个视图)
  3. 控制器 – 处理用户的输入 这样做的目的是将 信息的内部表示信息呈现给用户并且从用户获取的方式 分离开。这样能解耦组件并且有效重用代码。

用法

  • 主要编程语言的万维网应用的体系结构。
  • web框架,例如DjangoRails

MVC模式

9. 黑板模式

该模式可用于没有已知确定性解决方案策略的问题。黑板模式由3个主要组件组成。

  • 黑板 – 一块结构化的全局内存,包含解决方案空间的对象。
  • 知识源 – 具有各自代表性的专业模块。
  • 控制组件 – 选择,配置和执行模块。 所有组件都可以访问黑板。组件可能会生产添加进黑板的新数据对象。组件在黑板上寻找特定类型的数据,并且可能利用已有的知识源,通过模式匹配的方式来寻找数据。

用法

  • 语音识别
  • 车辆识别和追踪
  • 蛋白质结构识别
  • 海纳信号解析

黑板模式

10. 解释器模式

该模式用于设计 用来解释专用语言写成的程序 的组件。它主要指明如何评估程序的行,即用特定语言编写的语句或表达式。基本想法是为语言的每个符号设置一个类。

用法

  • 数据库查询语言,例如SQL。
  • 计算机语言用来描述通讯协议。

解释器模式

架构模式的优劣比较

下面的图表总结了各种架构模式的优劣。

各种架构模式

名字 优势 劣势
分层模式 低层级的组件能被不同的高层级组件调用。可以清晰地定义层级,所以层级化更容易标准化。当在层级内改动时不会影响到其他层级 不是普遍适用的。在某种情况下,某些层级可能会被跳过
客户端-服务端模式 能很好地对客户端请求的服务进行建模 请求被分到服务端的不同的线程中处理。因为不同的客户端有不同的展示形式,进程间通讯会导致额外开销。
主从模式 准确性 – 服务被代理到具有不同实现的从属组件中执行 从属组件彼此隔离:之间没有共享状态。主从通讯的延迟在某些场景下是个问题,例如实时系统。这种模式只可以被用来解决能被分解的问题。
管道过滤模式 并行处理。当输出和输出都是流数据,过滤器一旦收到数据便开始计算。易于增加过滤器,系统扩展性好。过滤器可以复用。可以通过已有过滤器的重新组合来构建不同的管道 效率会受限于最慢的过滤处理器。把数据从一个过滤器转移到另一个中时,存在数据转换的开销。
代理模式 允许对象动态变化,增加、减少和迁移,并且对象分布对开发者是透明的。 需要服务描述标准化。
点对点模式 支持分布式计算。对于任意失败节点的高健壮性。取决于资源和计算效率的高拓展性。 由于各个节点是自愿合作的,服务质量无法保证。安全性很难保证。性能取决于节点数量。
事件总线模式 易于新增发布者、订阅者和连接。该模式对于高分布式应用很奏效。 该模式的可拓展性可能是个问题,因为所有消息都通过同一个事件总线传输。
模型-视图-控制器模式 相同的模型可以轻松拥有多个视图,可以在运行时建立连接和断开连接。 复杂度增加。可能导致用户操作的许多不必要的更新。
黑板模式 易于新增应用。易于扩展数据空间的结构。 很难修改数据空间的结构,因为会影响所有应用。可能需要同步和访问控制。
解释器模式 有可能实现高度动态行为。有利于终端用户的可编程性。提高灵活性,因为易于替换解释代码。 因为解释语言的执行速度一般比编译语言慢,所以性能可能是个问题。

十大常用软件架构模式简介,首发于文章 - 伯乐在线


立即购买:淘宝网]]>
IT技术精华 2019-04-19 04:04:06
14575 FEX 技术周刊 - 2019/04/15 业界会议

Google Cloud Next ’19
https://cloud.withgoogle.com/next/
https://www.geekpark.net/news/240349

深阅读

Code caching for JavaScript developers
https://v8.dev/blog/code-caching-for-devs
In this blog post, we offer a few pieces of advice for JS developers who want to make the best use of code caching to improve the startup of their websites. This advice focuses on the implementation of caching in Chrome/V8, but most of it is likely transferable to other browsers’ code caching implementations too.

jQuery 3.4.0 Released
https://blog.jquery.com/2019/04/10/jquery-3-4-0-released/
So many of us owe so much to jQuery that I just have to feature any of its key updates (even if you might not need it). 3.4 is focused on bug fixes and performance improvements, but we’re told a serious overhaul is on the way for jQuery 4.0. 另附:jQuery Terminal Emulator - web based terminal.

Design patterns in modern JavaScript development
https://levelup.gitconnected.com/design-patterns-in-modern-javascript-development-ec84d8be06ca
Thoughts on effective communication in the design of software projects.

Ryan Dahl. Deno, a new way to JavaScript. JS Fest 2019 Spring
https://www.youtube.com/watch?v=z6JRlx5NC9E
From async-await to ArrayBuffers, the JavaScript language has changes significantly in the decade since Node.js was designed. Deno takes advantage of these developments and incorporate lessons learned in the development of Node to provide a new JavaScript platform built on V8 and Rust. This talk will teach the audience how to get started with Deno.

Reasons Why JavaScript is Omnipresent in Modern Development
https://snipcart.com/blog/why-javascript-benefits
Therefor , I want to use this post to answer these questions: What is JavaScript? Why is it so important? Why we use JavaScript? (or JS benefits)? What’s coming for JS? Even for experienced developers, it’s nice to stop for a second and remember where the tools you’re using are coming from and why you’re using them.

在阿里云做前端
https://zhuanlan.zhihu.com/p/61127760
前端是个资源型角色,在认知里对业务的理解深度不够,加上通常负责业务领域很广,比较难有积累和沉淀。如果你问一个毕业10年的JAVA老司机,他跟你谈的一定是大流量下的分布式架构,而前端可能还是昨天茶余饭后讨论vue和react,或者是angular谁更强。如何突破,如何提供业务更多价值,前端们一直在苦苦探寻。网上很多文章,给人启发,但每个人面对的环境,负责的业务不同,不一定都适用。结合自己过去几年在阿里云的前端经验,也做个总结。

前端核心代码保护技术面面观
https://zhuanlan.zhihu.com/p/61651310
本文首先适当回顾目前流行的前端核心代码保护的相关技术思路及简要的实现,后具体讲述一种更为安全可靠的前端核心代码保护的思路(SecurityWorker)供大家借鉴以及改进。当然,作者并非专业的前端安全从业者,对部分技术安全性的理解可能稍显片面及不足,欢迎留言一起探讨。

阿里毕玄:我在系统设计上犯过的 14 个错
https://mp.weixin.qq.com/s?__biz=MzIxMzEzMjM5NQ==&mid=2651031744&idx=1&sn=3cf979f5c111d1553d47aa122a66a825
在上篇《架构师画像》的文章中提到了自己在系统设计上犯过的一些错,觉得还挺有意义的,这篇文章就来回顾下自己近八年来所做的一些系统设计,看看犯的一些比较大的血淋淋的错误(很多都是推倒重来),这八年来主要做了三个基础技术产品,三个横跨三年的大的技术项目(其中有两个还在进行中),发现大的错误基本集中在前面几年,从这个点看起来能比较自豪的说在最近的几年在系统设计的掌控上确实比以前成熟了很多。

写了十几年代码,我为什么还没有被拿去“祭天”?
https://mp.weixin.qq.com/s/9TnZy6LKTNCQJb-8n9y-6w
十几年来,我一直坚持在编码岗位,经历了普通开发人员、TL、MDE、MDEL、SDM(云化团队)、Committer、软件专家等各种岗位。然而我却深知,不算大牛的我,从事编码这个“高危”职业十几年而没有被拿去“祭天”,依靠的是一个程序员的自我修养——扎实的基础软件能力、如履薄冰的工作态度、对技术孜孜不倦的追求。

Native image lazy-loading for the web!
https://addyosmani.com/blog/lazy-loading/
In this post, we’ll look at the new loading attribute which brings native <img> and <iframe> lazy-loading to the web!.

Digging Into The Display Property: The Two Values Of Display
https://www.smashingmagazine.com/2019/04/display-two-value/
We talk a lot about Flexbox and CSS Grid Layout, but these layout methods are essentially values of the CSS display property, a workhorse of a property that doesn’t get a lot of attention. Rachel Andrew takes a better look in a short series.

Javascript vs. CSS – More control means more responsibility
https://christianheilmann.com/2019/04/11/javascript-vs-css-more-control-means-more-responsibility-video-interview/
A few weeks ago I was in Paris, France to visit Prismic and they interviewed me about the JavaScript vs. CSS debate. In 10 minutes we covered a lot :).

JSON as configuration files: please don’t
https://arp242.net/weblog/json_as_configuration_files-_please_dont
I’ve recently witnessed the rather disturbing trend of using JSON for configuration files. Please don’t. Ever. Not even once. It’s a really bad idea. It’s just not what JSON was designed to do, and consequently not what it’s good at. JSON is intended to be a “lightweight data-interchange format”, and claims that it is “easy for humans to read and write” and “easy for machines to parse and generate”.

When To Use TypeScript - A Detailed Guide Through Common Scenariosr
https://khalilstemmler.com/articles/when-to-use-typescript-guide/
Strap yourself in. In this guide, we compare when it’s absolutely vital to be using TypeScript, the strictly-typed programming language, and when it makes sense to stick to vanilla JavaScript. 另附:Learn more programming languages, even if you won’t use them.

Don’t trust the locals: investigating the prevalence of persistent client-side cross-site scripting in the wild
https://blog.acolyer.org/2019/04/10/dont-trust-the-locals-investigating-the-prevalence-of-persistent-client-side-cross-site-scripting-in-the-wild/
In an analysis of the top 5000 Alexa domains, 21% of sites that make use of data originating from storage were found to contain vulnerabilities, of which at least 70% were directly exploitable using the models described in this paper. 另附:How bad can it git? Characterizing secret leakage in public GitHub repositories

Aroma: Using machine learning for code recommendation
https://code.fb.com/developer-tools/aroma/
Thousands of engineers write the code to create our apps, which serve billions of people worldwide. This is no trivial task—our services have grown so diverse and complex that the codebase contains millions of lines of code that intersect with a wide variety of different systems, from messaging to image rendering. To simplify and speed the process of writing code that will make an impact on so many systems, engineers often want a way to find how someone else has handled a similar task. We created Aroma, a code-to-code search and recommendation tool that uses machine learning (ML) to make the process of gaining insights from big codebases much easier.

How eBay Governs its Big Data Fabric
https://www.ebayinc.com/stories/blogs/tech/how-ebay-governs-its-big-data-fabric/
At eBay, nearly everything we do is based on data. We deal with structured, unstructured, and semi-structured data, where Hadoop, as a big data platform, has provided key technology features. Keeping pace with the speed of innovation while continuing to help data consumers easily find and consume the data they need guides our architecture and investment in building out eBay’s Big Data Fabric.

Org-Mode Is One of the Most Reasonable Markup Languages to Use for Text
https://karl-voit.at/2017/09/23/orgmode-as-markup-only/
This is about Org-mode syntax and its advantages even when used outside of Emacs. You can type Org-mode in vim, notepad.exe, Atom, Notepad++, and all other text editors out there. And in my opinion it does have advantages compared to the other, common lightweight markup standards such as Markdown, AsciiDoc, Wikitext or reStructuredText.

新鲜货

Launching the Front-End Tooling Survey 2019
https://medium.freecodecamp.org/launching-the-front-end-tooling-survey-2019-4cb2b72f0b42
How have our front-end tooling habits changed since last year’s results? React and Vue.js made large gains across all of these areas. In fact, in a change from the previous set of results, React was considered the most essential tool in this category for the first time — knocking jQuery off the top spot–with almost a third of respondents replying as such (28.47%). 附:The Stack Overflow Developer Survey 2019 Results .

Front-end Developer Handbook 2019
https://frontendmasters.com/books/front-end-handbook/2019/
This is a guide that everyone can use to learn about the practice of front-end development. It broadly outlines and discusses the practice of front-end engineering: how to learn it and what tools are used when practicing it in 2019. It is specifically written with the intention of being a professional resource for potential and currently practicing front-end developers to equip themselves with learning materials and development tools. Secondarily, it can be used by managers, CTOs, instructors, and head hunters to gain insights into the practice of front-end development. 另附:前端九部 - 入门者手册2019

Launching a YouTube dataset of user-generated content
https://youtube-eng.googleblog.com/2019/04/launching-youtube-dataset-of-user.html
We are excited to launch a large-scale dataset of public user-generated content (UGC) videos uploaded to YouTube under a Creative Commons license. This dataset is intended to aid the advancement of research on video compression and quality evaluation. We created this dataset to help baseline research efforts, as well as foster algorithmic development. We hope that this dataset will help the industry better comprehend UGC quality and tackle UGC challenges at scale.

Statement from npm
https://medium.com/@npmjs/statement-from-npm-9bdf4eae05a9
In bringing on a new leader to the role of Chief Executive Officer at npm, Inc., we were all aware of the rapid changes we would have to make in order to set the company up for long term success. Our mission is to sustainably support the npm registry and our open source tools so that they live on forever. That depends on our ability to embrace a changing environment. 附:Nice People Matter? NPM may stand for Not Politely Managed – job cuts leave staff soreIntroducing the Node.js Enterprise Focus GroupThe OpenJS Foundation is Official! Now What?.

Microsoft Edge preview builds: The next step in our OSS journey
https://blogs.windows.com/windowsexperience/2019/04/08/microsoft-edge-preview-builds-the-next-step-in-our-oss-journey/
We’re embarking on the next step in this journey – our first Canary and Developer builds are ready for download on Windows 10 PCs. Canary builds are preview builds that will be updated daily, while Developer builds are preview builds that will be updated weekly. Beta builds will come online in the future. Support for Mac and all supported versions of Windows will also come over time. 附:Edge Goes Chromium: What Does it Mean for Front-End Developers?.

Twitter Emoji (Twemoji)
https://github.com/twitter/twemoji
A simple library that provides standard Unicode emoji support across all platforms. Twemoji v12.0 adheres to the Unicode 12.0 spec and supports the Emoji 12.0 spec. The Twemoji library offers support for 3,071 emojis.

react-redux v7.0
https://github.com/reduxjs/react-redux/releases/tag/v7.0.1
React-Redux version 7 resolves the performance issues that were reported with version 6, and lays the groundwork for us to design and ship a public useRedux()-type Hooks API in a later 7.x release. The major change for this release is that connect is now implemented using Hooks internally. Because of this, we now require a minimum React version of 16.8.4 or higher.

reactstrap
https://github.com/reactstrap/reactstrap
Simple React Bootstrap 4 components.

MDX 1.0 Released: Seamlessly Write JSX in Markdown
https://mdxjs.com/blog/v1/
MDX is an authorable format that lets you seamlessly write JSX in your Markdown documents. You can import components, such as interactive charts or alerts, and embed them within your content. This makes writing long-form content with components a blast.

pm2 3.5.0 Released
https://github.com/Unitech/pm2/releases/tag/3.5.0
Node.js Production Process Manager with a built-in Load Balancer. 另附:Forever 1.0 - A simple CLI tool for ensuring that a given script runs continuously.

EdgeDB 1.0 Alpha 1
https://edgedb.com/blog/edgedb-1-0-alpha-1/
The next generation database. EdgeDB combines the simplicity of a NoSQL database with relational model’s powerful querying, strictness, consistency, and performance. EdgeDB is an open-source object-relational database that bakes in support for working with semi-structured data in an attempt at bringing the simplicity of NoSQL to the relational world. PostgreSQL is used under the hood with Edge’s own SQL-esque query language (EdgeQL) compiled to SQL behind the scenes, and this post is a great introduction to EdgeQL and how it works from a developer’s perspective.

Netlify
https://www.netlify.com/docs/
Build, deploy, and manage modern web projects. An all-in-one workflow that combines global deployment, continuous integration, and automatic HTTPS. And that’s just the beginning.

Hugo 0.55.0: The early Easter Egg Edition!
https://gohugo.io/news/0.55.0-relnotes/
Faster, virtualized Output Formats, revised shortcodes, new return keyword, and much more… 另附:Docusaurus · Easy to Maintain Open Source Documentation Websites.

Elasticsearch 7.0.0 released
https://www.elastic.co/blog/elasticsearch-7-0-0-released
Elasticsearch 7.0.0 has something for everyone. At Elastic, we constantly talk about speed, scale, and relevance: it’s in our source code. Elasticsearch 7.0 goes to exemplify this, as it’s the fastest, safest, most resilient, easiest to use version of Elasticsearch ever, and it comes with a boatload of enhancements and new feature.

Announcing Rust 1.34.0
https://blog.rust-lang.org/2019/04/11/Rust-1.34.0.html
he Rust team is happy to announce a new version of Rust, 1.34.0. Rust is a programming language that is empowering everyone to build reliable and efficient software.The largest feature in this release is the introduction of alternative cargo registries.

Announcing Building Git
https://blog.jcoglan.com/2019/04/08/announcing-building-git/
Building Git is a deep dive into the internals of the Git version control system. By rebuilding it in a high-level programming language, we explore the computer science behind this widely used tool. In the process, we gain a deeper understanding of Git itself as well as covering a wide array of broadly applicable programming topics.

设计

Monotype launches the first redesign in 35 years of the world’s most ubiquitous font, Helvetica
https://www.creativeboom.com/resources/monotype-launches-the-first-redesign-in-35-years-of-the-worlds-most-ubiquitous-font-helvetica/
Consisting of 48 fonts and three optical sizes, the typeface has been produced from size-specific drawings and with size-specific spacing and is the first redesign in 35 years of what many argue is the world’s most ubiquitous font, Helvetica. Every character has been redrawn and refit, and a host of useful alternates have been added to help brands meet modern-day branding challenges.

Accessibility Before Aesthetics
https://blog.marvelapp.com/accessibility-before-aesthetics/
It’s time we start addressing accessibility before aesthetics in our design processes to create meaningful products for our diversified societies and cultures. Before diving into the why, how and what of it, let’s revisit the definitions of these terms to set the context.

The lifecycle of a redesign: Making Reddit more welcoming
https://www.invisionapp.com/inside-design/reddit-redesign/
“We could’ve taken the approach of the designer as a magician—‘Ta-da! Here it is!’” says Zavani. “But we’ve seen other site re-designs that are so extravagant or so far from reality that they never actually become a reality. At the end of the day, we wanted to make sure that people use Reddit the way they’ve always used Reddit, because it’s a magical, weird, and wonderful place.”

全面掌握设计系统中「颜色规范」的建立方法
https://www.uisdc.com/establish-color-standard-for-design-system
本文基于目前两大设计体系:安卓端的谷歌设计规范和iOS人机交互指南对颜色的定义和规范,参考了部分 Ant Design 的色板生成原理,为大家带来「米庄APP」设计系统颜色规范的建立过程。

Secrets to a Successful Designer
立即购买:淘宝网]]> IT技术精华 2019-04-16 04:04:07 14574 FEX 技术周刊 - 2019/04/08 深阅读

Domain-Oriented Observability
https://martinfowler.com/articles/domain-oriented-observability.html
Observability in our software systems has always been valuable and has become even more so in this era of cloud and microservices. However, the observability we add to our systems tends to be rather low level and technical in nature, and too often it seems to require littering our codebase with crufty, verbose calls to various logging, instrumentation, and analytics frameworks. This article describes a pattern that cleans up this mess and allows us to add business-relevant observability in a clean, testable way.

The 2019 IPFS Roadmap
https://blog.ipfs.io/78-ipfs-2019-roadmap/
To ground our thinking about the next year, we first had to zoom out to the core mission of the IPFS project in the long-term. We take on many efforts and support many groups in our open source community, but it is all driven by the aim to make the internet more accessible, empowering, and useful for many years to come.

Distributed Application Architecture for Edge-Based Service Delivery
https://thenewstack.io/distributed-application-architecture-for-edge-based-service-delivery/
We have seen the revolution in software application development after containers arrived and CI/CD was started to adapt by IT firms. Now, as the focus of many enterprises and technology vendors started to shift to edge, a new architecture may evolve as distributed applications have a different environment with a different type of latency requirement. Managing such distributed applications that cross-platform boundaries are one of the most complex challenges facing the industry at this time. A goal of services in the edge-based environment should be to have the right application development environment in place for faster innovation for end consumers.

Web Components will replace your frontend framework
https://www.dannymoerkerke.com/blog/web-components-will-replace-your-frontend-framework
Create your own custom HTML tags that inherit all properties of the HTML elements they extend and which you can use in any supporting browser by simply importing a script. All HTML, CSS and JavaScript defined inside the component is fully scoped to the component itself. The component will show up as a single HTML tag in your browser’s dev tools with its styling and behaviour fully encapsulated, no workarounds, frameworks or transpiling needed. Let’s take a look at the main features of Web Components. 另附:Aurelia Unveils Its Web Components Plugin.

How We Used WebAssembly To Speed Up Our Web App By 20X
https://www.smashingmagazine.com/2019/04/webassembly-speed-web-app/
In this article, we explore how we can speed up web applications by replacing slow JavaScript calculations with compiled WebAssembly.

中国第五届CSS大会演讲资料
https://www.yuque.com/cssconf/5th
中国第五届CSS大会演讲资料,包括演讲PPT及视频。还有演讲嘉宾的个人介绍及演讲主题介绍。

2019年Node趋势解读:大前端如何与Node结合
https://mp.weixin.qq.com/s?__biz=MzUxMzcxMzE5Ng==&mid=2247490877&idx=1&sn=e1cdc6be87238eec9c5d0148c6b44b10
根据 ModuleCounts.com 的数据,Node 的包注册中心 NPM 每天会增加 507 个包,相比下一名要多 4 倍多。2018 年 Stack Overflow 调查也有类似的结果,JavaScript 是使用最广泛的语言,Node.js 是使用最广泛的框架。本节我会主要分享一些跟 Node.js 结合比较密切的点:首先介绍一下 API 演进与 GraphQL,然后讲一下 SSR 如何结合 API 落地,构建出具有 Node.js 特色的服务,然后再简要介绍下 Node.js 的新特性、新书等,最后聊聊我对Deno 的一点看法。

无代码编程
https://mp.weixin.qq.com/s/eKvSxOvSyEZEr3BLloCXdw
无代码/低代码是一种创建应用的方法,它可以让开发人员使用最少的编码知识,来快速开发应用程序。它可以在图形界面中,使用可视化建模的方式,来组装和配置应用程序。开发人员可以直接跳过所有的基础架构,只关注于使用代码来实现业务逻辑。

软件架构的10个常见模式
https://mp.weixin.qq.com/s/2QM2vTjevpKeZ5jy3Ss95g
什么是架构模式?根据维基百科:架构模式是针对特定软件架构场景常见问题的通用、可重用解决方案。架构模式类似于软件设计模式,但范围更广。本文将简要解释10种常见架构模式及其用法、优缺点。

为什么 Node 是小菜前端团队的核心技术栈
https://juejin.im/post/5ca321f76fb9a05e5d09bb8a
这篇文章向大家介绍下小菜前端的基建在一步步走过来的过程中,NodeJS 是如何使用的及扮演了哪些角色,它对于工程师个人,团队能力,公司研发效率,业务支撑,技术的探索与突破等等到底有什么实际的意义,以及为什么是它而不是 Python/C++/PHP/Java 成为了前端团队的核心技术栈。

我们能从 InteliJ IDEA 中学到什么?
https://linux.cn/article-10686-1.html
阅读本文,您将了解到心流与人体工效的重要性,并使自己变得更强大,文章将从以下几点展开:InteliJ IDEA 当前的市场情况与表现;IntelliJ IDEA 成功的原因;IntelliJ IDEA 在 IDE 设计器领域胜出的两个关键点;IntelliJ IDEA 对现实工作的启示;

You probably don’t need that hip web framework
https://char.gd/blog/2019/you-dont-need-that-hipster-web-framework
Every year, there’s something new to learn and play with in the web development world that’s considered something you must use: React, Vue, GraphQL, Docker, whatever it might be. And, every year I mess around with these new things and find myself stuck, regretting even trying to use them when I could have just launched something. The obsession with finding better frameworks is killing ideas before they reach the world, and nobody’s really talking about it.

Pure JavaScript Functions as a Replacement for Lodash
https://blog.bitsrc.io/you-dont-need-lodash-or-how-i-started-loving-javascript-functions-3f45791fa6cd
A brief overview of pure replacement functions over Lodash/Underscore.js.

Make it hard to screw up driven development
https://css-tricks.com/make-it-hard-to-screw-up-driven-development/
Developers say things like, “I’m just going to do this quick and dirty first,” because it’s taken as fact that if you code anything quickly, it not only will be prone to mistakes, but that you’ll be deliberately not honoring established conventions and skipping tasks that make for more solid code. There is probably no practical way to make it impossible to write sloppy, bad code, but it is fascinating to consider how tooling has evolved to make it harder. Let’s get all Poka-yoke on development.

Getting creative with the Console API!
https://areknawo.com/getting-creative-with-the-console-api/
Debugging in JavaScript has always been inseparably connected with the Console API, which is most of the time used only through console.log(). But, did you know that it doesn’t have to be this way? Hasn’t console.log() already bored you with its monolithic output? Do you want to make your logs better, to make them prettier?
立即购买:淘宝网]]> IT技术精华 2019-04-08 16:04:16 14573 FEX 技术周刊 - 2019/04/01 业界大会

中国第五届CSS大会
https://css.w3ctech.com/
期待会议资料。

深阅读

Responsible JavaScript: Part I
https://alistapart.com/article/responsible-javascript-part-1
By the numbers, JavaScript is a performance liability. If the trend persists, the median page will be shipping at least 400 KB of it before too long, and that’s merely what’s transferred. Like other text-based resources, JavaScript is almost always served compressed—but that might be the only thing we’re getting consistently right in its delivery.

Blazingly fast parsing, part 1: optimizing the scanner
https://v8.dev/blog/scanner
To run a JavaScript program, the source text needs to be processed so V8 can understand it. V8 starts out by parsing the source into an abstract syntax tree (AST), a set of objects that represent the program structure. That AST gets compiled to bytecode by Ignition. The performance of these parse + compile phases is important: V8 cannot run code before compilation is done. In this series of blog posts, we focus on parsing, and the work done in V8 to ship a blazingly fast parser.

A Future Without Webpack
https://www.pikapkg.com/blog/pika-web-a-future-without-webpack
How @pika/web installs npm packages that run natively in the browser, for a faster and less complex web app.

The Future of Cross-Platform is Native
https://hackernoon.com/the-future-of-cross-platform-is-native-13cc66bf1c00
This is the 2nd post in a 2 post series. Post 1: “Cross-Platform? We Don’t Say That Around Here Anymore”. 另附:NativeScript 5.3.

百度App网络深度优化:DNS 和连接优化
https://mp.weixin.qq.com/s?__biz=MzUxMzcxMzE5Ng==&mid=2247490822&idx=1&sn=8610ca7454655d59d948afb952003750
网络优化是客户端几大技术方向中公认的一个深度领域,百度 App 也不例外,今天,我们在这里向大家介绍百度 App 网络深度优化的实践经验,内容主要包括 DNS 优化和连接优化,希望对大家在网络方向的学习和实践有所帮助。另附:腾讯对抗腾讯阿里巴巴重磅发布120页PPT,深度诠释国家“智能+”战略

腾讯 - 产业互联网 ——构建智能+时代数字生态新图景
http://tisi.org/5072
随着云计算等企业级技术应用的发展普及,产业互联网实际已经在各行各业展开实践。广度上不仅覆盖服务业、工业和农业,还从商业扩展到公益和政府,整个社会走向全面互联;深度上从营销服务、生产研发到运营管理,互联渗透到组织内部的各个环节。数据信息由此实现从消费端到供给端的高效流通,数字产业与传统产业相互协同带动,推助中国经济迈向高质量发展新阶段。

中国互联网公司开源项目调查报告
https://mp.weixin.qq.com/s?__biz=MjM5MDE0Mjc4MA==&mid=2651014704&idx=1&sn=6620ef984165b918a1e239ab67624732
近年来,开源技术得到越来越多的重视,微软收购 GitHub、IBM 收购红帽,都表明了开源的价值。国内公司也越来越多的参与开源,加入开源基金会 / 贡献开源项目。但是,它们到底做得如何呢?为此 InfoQ 统计了国内在 GitHub 上较活跃的 7 家一线互联网公司的 50 多个账号的 2800 多个项目,为大家呈现一部分答案。

计算广告系统算法与架构综述
https://mp.weixin.qq.com/s?__biz=MjM5ODkzMzMwMQ==&mid=2650409451&idx=1&sn=38c225b5d084558a09240ba2cffd0570
我们当今身处一个被广告包围的时代,无论是走在马路上、收看电视剧、或者是玩手机游戏,都能看见形形色色的广告。作为IT从业者,自然想对广告产业背后的产品、技术一探究竟,正如刘鹏博士在其《计算广告》一书中所说的“不论你在做一款用户产品还是商业产品,不深入了解在线 广告,就不太可能全面地了解互联网业务”,因此本文也希望能带领读者从产品、技术以及整个生态的角度深入浅出的了解计算广告。

配置化页面渲染系统设计和实践
https://mp.weixin.qq.com/s/nwC7-ATCCUBS11Gb7FtbgA
随着大数据、监控系统、分析系统等概念逐渐在各大小公司中普及后,开发一个前端系统以展示和控制的需求则变得十分常见,所以我们也不例外。在开始着手开发之前,事实上我们已经考察甚至长时间使用过一些不同类型的类似系统,如监控报表系统 Grafana、数据分析系统 Zeppline、Metabase、Superset 等等。我们不难发现这些的设计思路都有一个共同的特点:卡片式页面结构。

Building Spotify’s New Web Player
https://labs.spotify.com/2019/03/25/building-spotifys-new-web-player/
The purpose of this post is to tell the story of the new Spotify web player. How and why it came to be. We will focus on what the steps were that led to a complete rewrite and how the lessons learned influenced the experience and the tech decisions of the new web player for desktop browsers.

How To Align Things In CSS
https://www.smashingmagazine.com/2019/03/css-alignment/
There are a few ways to align elements in CSS. In this article, Rachel Andrew explains what they are with some tips to help you remember which to use and why.

CSS Houdini Could Change the Way We Write and Manage CSS
https://css-tricks.com/css-houdini-could-change-the-way-we-write-and-manage-css/
One way I’ve been able to do that is to use it as a way to avoid reinventing the wheel. We’ll go over that in this post while comparing it with methods we currently use in JavaScript and CSS.

how YOU visualized it
http://www.storytellingwithdata.com/blog/2019/3/25/how-you-visualized-this
We sought to see how people varied in answering specific questions about the same dataset. Data was sourced from AidData in partnership with Enrico Bertini, Associate Professor at NYU, who will be undertaking some data visualization research based on this challenge.

Visualizing memorization in RNNs
https://distill.pub/2019/memorization-in-rnns/
This article presents a qualitative visualization method for comparing recurrent units with regards to memorization and contextual understanding. The method is applied to the three recurrent units mentioned above: Nested LSTMs, LSTMs, and GRUs.

Was MongoDB Ever the Right Choice?
https://www.simplethread.com/was-mongodb-ever-the-right-choice/
MongoDB has become a much more mature product. So what happened? Did all of the hate truly come from mistakes made in the early implementation/marketing of MongoDB? Or is the problem that people are blaming MongoDB for their own lack of efforts when evaluating if it was a good fit?

How Heroku Expects the Unexpectable
https://blog.heroku.com/bug-bounties-black-swans
There’s obviously more to security than humans, technology, and vendors with all of their implementations and expertise. At Heroku we believe that security is a byproduct of excellence in engineering. All too often, software is written solely with the happy path in mind, and security assurances of that software has it’s own dangerous assumptions. A mature security program should challenge assumptions of security controls, move to testing continuous, and prepare for the unexpectable.

Building and Scaling Data Lineage at Netflix to Improve Data Infrastructure Reliability, and Efficiency
https://medium.com/netflix-techblog/building-and-scaling-data-lineage-at-netflix-to-improve-data-infrastructure-reliability-and-1a52526a7977
In the rest of this blog, we will a) touch on the complexity of Netflix cloud landscape, b) discuss lineage design goals, ingestion architecture and the corresponding data model, c) share the challenges we faced and the learnings we picked up along the way, and d) close it out with “what’s next” on this journey.

White Paper: The Journey to DevOps
https://blog.scottlogic.com/2019/03/25/the-journey-to-devops.html
DevOps methodology is currently at the peak of its popularity. Despite this popularity, DevOps adoption is still a challenging undertaking, especially when the unique challenges of public sector organisations are taken into account.

Go - A Key Language in Enterprise Application Development?
https://www.infoq.com/presentations/go-lang-design
Aarti Parikh goes over the Go language design and talks about why Go matters in the age of multicores and cloud-native computing.

on internal engineering practices at amazon
https://jatins.gitlab.io/me/amazon-internal-tools/
A company that’s innovating how rest of the companies work, doesn’t innovate internally.

The Illustrated Word2vec
https://jalammar.github.io/illustrated-word2vec/
In this post, we’ll go over the concept of embedding, and the mechanics of generating embeddings with word2vec. But let’s start with an example to get familiar with using vectors to represent things. Did you know that a list of five numbers (a vector) can represent so much about your personality?

新鲜货

React v16.8.5
https://github.com/facebook/react/releases/tag/v16.8.5
另附:React - v7.0.0 beta.

Standardizing WASI: A system interface to run WebAssembly outside the web
https://hacks.mozilla.org/2019/03/standardizing-wasi-a-webassembly-system-interface/
We announce the start of a new standardization effort — WASI, the WebAssembly system interface. 另附:Announcing Lucet: Fastly’s native WebAssembly compiler and runtime.

Introducing the JetStream 2 Benchmark Suite
https://webkit.org/blog/8685/introducing-the-jetstream-2-benchmark-suite/
JetStream 2 combines a variety of JavaScript and WebAssembly benchmarks, covering an array of advanced workloads and programming techniques, and reports a single score that balances them using a geometric mean. JetStream 2 rewards browsers that start up quickly, execute code quickly, and run smoothly. Optimizing the overall performance of our JavaScript engine has always been a high priority for the WebKit team.

996.icu
https://github.com/996icu/996.ICU
https://996.icu/#/zh_CN
https://www.zhihu.com/topic/20064332/hot
https://mp.weixin.qq.com/s?__biz=MzA4MzE1MzQ3MA==&mid=2450141684&idx=1&sn=2d71d1177e84d9d891e7973ebc7a42c0
然,人在江湖,身不由己…

Swift 5 Released!
https://swift.org/blog/swift-5-released/
Swift 5 is a major milestone in the evolution of the language.

Elasticsearch 6.7.0 released
https://www.elastic.co/blog/elasticsearch-6-7-0-released
CCR (Cross Cluster Replication) is now GA! SQL, including JDBC and ODBC drivers, is now GA! ILM (Index Lifecycle Management) is now GA!

Computer Networks: A Systems Approach
https://book.systemsapproach.org/
This site contains source text for Computer Networks: A Systems Approach, now available under terms of the Creative Commons (CC BY 4.0) license.

Untrusted
https://alexnisnevich.github.io/untrusted/
A user javascript adventure game.

Lucet
https://github.com/fastly/lucet
Lucet is a native WebAssembly compiler and runtime. It is designed to safely execute untrusted WebAssembly programs inside your application.

Majestic
https://github.com/Raathigesh/majestic/
Zero config GUI for Jest.

Tone.js
https://github.com/Tonejs/Tone.js
A Web Audio framework for making interactive music in the browser.

Cube.js
https://github.com/statsbotco/cube.js
Cube.js is an open source modular framework to build analytical web applications. It is primarily used to build internal business intelligence tools or to add customer-facing analytics to an existing application.

Vibe – React Dashboard Kit
https://vibe.nicedash.com/
Vibe is a beautiful React.js dashboard build with Bootstrap 4 and comes with lots of custom templates and components. It uses Sass which allows you to quickly change global colors and styles.

CSSeffectsSnippets
https://github.com/emilkowalski/css-effects-snippets
A collection of CSS effects made with Vue.js. 另附:Useful Vue Admin Templates for 2019.

Cross platform GUI in Go based on Material Design
https://github.com/fyne-io/fyne
Fyne is an easy to use UI toolkit and app API written in Go. We use OpenGL (through the go-gl and go-glfw projects) to provide cross platform graphics. The 1.0 release is now out and we encourage feedback and requests for the next major release :).

Sonic
https://github.com/valeriansaliou/sonic
Sonic is a fast, lightweight and schema-less search backend. It ingests search texts and identifier tuples that can then be queried against in a microsecond’s time. Sonic can be used as a simple alternative to super-heavy and full-featured search backends such as Elasticsearch in some use-cases. It is capable of normalizing natural language search queries, auto-completing a search query and providing the most relevant results for a query. Sonic is an identifier index, rather than a document index; when queried, it returns IDs that can then be used to refer to the matched documents in an external database.

设计

Editable, royalty-free SVG illustrations
https://gallery.manypixels.co/
Discover royalty-free illustrations to power up your projects. Use them in a commercial or non-commercial way for your landing pages, blog posts, email newsletters, social media graphics and more!

Yes, AI Will Replace Designers
https://medium.com/microsoft-design/yes-ai-will-replace-designers-9d90c6e34502
But here are 3 ways we can work with AI for future success.

Exploring the Reasons for Design Thinking Criticism
https://www.toptal.com/designers/product-design/design-thinking-criticism
Design thinking has been called revolutionary, a “failed experiment,” and a set of buzzwords. While contradictory, these statements shed light on the increasing criticism of design thinking.

放置类AR体验框架和设计建议 (上篇)
http://aiid.baidu.com/1060/
AR的场景多种多样,其中在手机设备的AR体验中,有一种基本且常见的场景:通过手机摄像头,用户在环境中放置虚拟物体(模型),用户与它有一些具体的互动操作,如移动、旋转等。我们将这类场景统一称为放置类AR场景:基放置对象可以是一扇虚拟场景的任意门,用户可走入门中互动;也可以是一件家居商品,用户可预览商品是否与室内环境搭配等。针对不同的放置对象和场景,设计侧重点也会有所不同。于真实环境放置虚拟模型,并与模型进行交互的AR场景。

产品及其它

Mathigon
https://mathigon.org/
Mathigon is part interactive textbook and part virtual personal tutor. Using cutting-edge technology and an innovative new curriculum, we want to make learning mathematics more active, personalised and fun. Our innovative new content format makes mathematics more interactive than ever before. At every step students have to actively participate, explore, and discover new ideas. Unlike videos and other textbooks, students don’t just consume information: they engage through problem solving, reasoning and creativity.

81岁自学编程,半年时间开发上架一款APP
https://new.qq.com/omn/20190327/20190327A0L7MH.html
60 岁开始自学计算机,81 岁开始自学 Swift,83 岁高龄成为全球年龄最大的独立开发者,仅用半年时间就成功开发并上线了一款 iOS 应用,这位名叫若宫雅子的 83 岁高龄开发者的故事告诉我们:年龄从来都不是问题。

如果员工是老油条,那他的老板也是
https://mp.weixin.qq.com/s?__biz=MzU2NzA3NDE3Mw==&mid=2247484027&idx=1&sn=6a8209d998bacde5fd45a9ad0230ec63
每个公司的愿景和使命都很重要,在我眼里最重要的还是公司的价值观和文化。很多人认为文化是非常虚的东西,没有什么必要,但我认为这完全是错的。公司的愿景和使命会一直变化,但是公司的文化和价值观从成立的第一天就要定下来一直不变,要天天讲、月月讲,重复强调、一直秉承下去。

张小龙:笨是一种人品
https://mp.weixin.qq.com/s?__biz=MzU1MzQ0MzA2Mw==&mid=2247483756&idx=1&sn=684ae544d7c62d0df10662d831f26d18
很多时候,笨并不是智力不及,而是选择不运用智力——如果你懂这句话,就知道:笨是一种人品。

– THE END –


立即购买:淘宝网]]>
IT技术精华 2019-04-01 16:04:07
14572 cygwin下gcc编译碰到的两个编译出错问题解决 使用 cygwin 下gcc编译一个项目,出现如下问题:
1. 某个文件编译出错提示

/tmp/ccgeynfy.s: 致命错误:can’t write 1284 bytes to section .text of out/CSMgrBase.o because: ‘文件过大’

解决方法,给gcc编译命令添加参数 -Wa,-mbig-obj 解决问题

2. 前一个问题解决后,继续编译出现错误提示

…. string table overflow at offset 10000033

这里 找到解决方法, 给gcc编译命令添加 -O2 或 -O1 优化指令解决问题


立即购买:淘宝网]]>
IT技术精华 2019-03-31 11:03:04
14571 游戏服务器h2engine架构优化和跨平台设计

H2engine的GitHub星星不知不觉已经破百了,也没有特意推广过,但是慢慢的关注的人越来越多。因为事情多,好久没有写东西了,前一段时间有了一些想法,把h2engine又更新了一下,感觉h2engine又向前迈了一大步。本文记录一下最近的心得体会,以及做出的相应修改。

关于RPC

H2engine的rpc部分使用的是原来fflib的ffrpc组件,ffrpc设计的比较强大,但是因为h2engie的架构特点,ffrpc的一些功能用不到,很多网友都询问我关于rpc部分的设计问题,我仔细思考后觉得确实可以把h2engine的rpc部分进行简化,这样对于使用者而言更容易理解。
先看一下h2engine的架构:

  • H2engine设计的为单gate,单服环境内linux下一个gate完全能够满足性能要求,Apache/nigx都是一个进程不是吗?单gate让分布式的结构大大简化。我们知道一般单服架构都有个loginserver,现在可以省略了,因为单gate,每个服直接配置gate地址。
  • H2engine为多进程架构,但是h2engine限定了采用伪分布式的设计,虽然gate和gameserver通过网络通信,但是限定了gate和gameserver在一台机器上。虽然gate和gameserver放在不同机器上也可以通信,但是我们从现实运营的情况出发,很少运维会把gate和gameserver放不同机器上,一般有的时候一台机器上甚至有多个服。所以伪分布式是既能满足需求又能大大简化架构的一个设计。
  • 采用伪分布式设计后,gameserver之间就可以利用共享内存了,全局的数据比如排行榜、行会、好友、组队等,这些模块都是分布式进程中最费时费力容易出错的,但是在h2engine里变得逻辑清晰,直接操作全局内存就可以了,全同步。
  • Rpc模块进行了简化,其实rpc通信分三种,gate调用gameserver接口,gameserver调用gate接口,和gameserver与gameserver之间调用,发现没,所有架构内rpc都需要通过gate,而且h2engine是单gate伪分布式(127.0.0.1速度飞起),那么整个rpc结构就变得非常清晰简单,感兴趣的可以看下gate的broker文件和rpc文件。这两个文件一个是gate端中转,一个是请求端封装,非常简洁。
  • 网络层进行了升级,原来socket是裸的指针,很多网友还是表达了不知道什么时候应该调用safedelete的问题,所以还是改成了智能指针,不需要关系socket什么时候释放。另外socket的私有数据进行了泛型封装,可以存入任何私有数据类型。
    共享内存的简单示意:

关于跨平台

2engine一直是只支持linux下编译,Windows的移植一直没有时间弄,虽然行业内大部分服务器都是跑linux的,但是如果可以Windows下可以开发调试,那对于提高平常的开发效率来说将会大有裨益。
2engine由于一开始是在linux下gcc下开发的,那么在Windows下也用gcc,那么需要修改的跨平台代码将会非常少,本着这个思路,h2engine成功移植到了Windows,并且改动的非常少。

  • Windows下的虽然有mingw直接包含了gcc环境,但是想用上cmake等编译工具还是挺麻烦的,所以我找了一个集成mingw且算得上比较流行的一个Windows IDE:CodeBlocks。见了一个CodeBlocks的项目,想要在Windows下运行只要下载一个CodeBlocks,然后双击工程文件就可以了。
  • 编译h2engine需要依赖openssl、curl、mysql、lua、python2.7,依赖文件都放到windependency文件夹里,包括运行的dll。
  • H2workerlua在Windows下用的lua5.1
  • H2workerpython在Windows下用的python2.7

关于C sharp

H2engine的c#版本正在紧锣密鼓的开发中,大家拭目以待。
相关连接

  1. 文档 http://h2cloud.org
  2. 源码 https://github.com/fanchy/h2engine

立即购买:淘宝网]]>
IT技术精华 2019-03-31 00:03:04