The Citadel Architecture at AppSignal

栏目: IT技术 · 发布时间: 4年前

内容简介:DHH just coined the term “Citadel,” which finally gives us an excellent way to reference how we approach tech at AppSignal. We said, “Hey, this is us! Our thing has a name now”.To explain how AppSignal uses the Citadel pattern, we’ll share a bit on how our

DHH just coined the term “Citadel,” which finally gives us an excellent way to reference how we approach tech at AppSignal. We said, “Hey, this is us! Our thing has a name now”.

In addition to the Majestic Monolith, someone should write up the pattern of The Citadel: A single Majestic Monolith captures the majority mass of the app, with a few auxiliary outpost apps for highly specialized and divergent needs.

— DHH (@dhh) April 7, 2020

To explain how AppSignal uses the Citadel pattern, we’ll share a bit on how our system works.

Monolith

The application you interact with is a monolithic Rails app, with parts of the front-end written in React. The backend is entirely written in Ruby and talks to a few databases (we split out data from different customers to separate clusters for scaling reasons). This Rails app also handles a bunch of other tasks such as sending out alerts to external services.

When we started this Rails app processed incoming data from our monitoring agent as well, we foresaw that data ingestion would turn out to be a bottleneck. So we added a Sinatra app running on a subdomain that ingested data and created Sidekiq jobs that were processed by the Rails app.

Growing Pains

This architecture worked well for years. As our business grew, it became clear that the specific task of processing incoming data from the agents was going to need special treatment. When you’re monitoring billions and billions of requests, you run into hard limits. The main limiting factor wasn’t so much that Ruby is slow (we all know that it is not :wink:), but that the way we had architected things caused too much locking in our databases.

An Outpost

We looked at several possibilities and then decided Kafka was the best fit for our situation. We had some experience with Rust and thought that its speed and reliability would be a very good fit for this system. We rewrote our data ingestion and processing system in Rust, using Kafka as a combination of queue and storage system.

We only moved the incoming data processing part of the Rails app to this outpost service. The rest of the systems works well in the form of a monolithic app. We understand it deeply, and we like keeping things simple. The monolith still handles most of the logic and interacts with Kafka heavily. Our wish to keep our monolith led to us writing a Kafka gem , so the main app can communicate with the outpost easily.

If you want to learn more about how Kafka works at AppSignal check out the Railsconf talk I gave about this.

Life at the Citadel

This brings us to the current situation where we are very happy in our citadel. As DHH said:

A single Majestic Monolith captures the majority mass of the app with a few auxiliary outpost apps for highly specialized and divergent needs.

In our case, we have a single outpost service for our highly specialized needs. If there were a RailsConf this year, we would have given DHH some extra stroopwafels as appreciation for giving it a name. :cookie:

PS. If you’re still wondering: “Why would they use this pattern? What does their app do?” check out our all-in-one APM product that monitors 1 trillion ( 1 000 000 000 000) requests per year.


以上所述就是小编给大家介绍的《The Citadel Architecture at AppSignal》,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对 码农网 的支持!

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

逻辑的引擎

逻辑的引擎

[美] 马丁·戴维斯 / 张卜天 / 湖南科学技术出版社 / 2005-5 / 20.00元

本书介绍了现代计算机背后的那些基本概念和发展这些概念的人,描写了莱布尼茨、布尔、费雷格、康托尔、希尔伯特、哥德尔、图灵等天才的生活和工作,讲述了数学家们如何在成果付诸应用之前很久就已经提出了其背后的思想。博达著作权代理有限公司授权出版据美国W.W.Norton公司2000年版本译出。2007年第二版亦使用同一ISBN。一起来看看 《逻辑的引擎》 这本书的介绍吧!

CSS 压缩/解压工具
CSS 压缩/解压工具

在线压缩/解压 CSS 代码

RGB CMYK 转换工具
RGB CMYK 转换工具

RGB CMYK 互转工具

HEX HSV 转换工具
HEX HSV 转换工具

HEX HSV 互换工具