In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
In fact, I should have written this blog a long time ago. I have been saying that I am busy with my work and have no time. In fact, there will always be time squeeze. Maybe it is because I am lazy. From November 2013 to now, I am not very good at writing a technical blog, because I am not very good at language expression and literary talent, and I don't know what I am writing every time I write a blog. As a technician who has been involved in Worktile development from the very beginning, let's briefly talk about the technical architecture of Worktile.
Worktile has been liked by many users since its launch. We are gratified that it is a happy thing that our products have been recognized by users. Many users from IT often ask some technical questions about Worktile on the official group or Zhihu:
What kind of architecture does Worktile adopt?
What technologies are used at the front and back end of Worktile?
...
An overview of the overall architecture of Worktile
Worktile is an enterprise collaborative office software, so it is destined to be a single-page application (SPA) from the beginning, because after using SPA, users can have the same experience (speed and fluency) as they operate native client programs on the browser. For developers, the front and rear ends are separated, the server side only provides RESTful API services, and mobile integration is also very convenient. For more information, please see the sketch below.
Front end
Angular.js (client MV*)
Bootstrap (CSS base library and some Javascript components)
UI Bootstrap (Angular.js version of Bootstrap)
JQuery (replaces jqLite in Angular.js and serves as the base class library for other third-party jQuery plug-ins)
The server of Worktile basically only provides API data services and will not render HTML. The front-end code will be packaged and compressed into a js file using Grunt tools before release.
Angular.js
Since it is a SPA program, the front end must choose a MVC (or MVVM) framework. There are many front-end MVC frameworks, and we were hesitant to choose at that time, because we had only used Knockoutjs briefly before.
In fact, we were eager for a framework to do this:
Data can be bound in both directions (or only one way)
Front-end routing function
A template language that is easy to learn
In the end, we chose Angular.js, and the details of the choice will not be described one by one. (we have also answered the question about Angular.js on Zhihu before: what are the advantages and disadvantages of Angular.js in practical application? ), it has been almost 2 years since I started using it, and it turns out that there is nothing wrong with the original choice. Angular.js is really suitable for Worktile.
Bootstrap and jQuery
Choose Bootstrap is mainly to use its basic CSS function, on the basis of it is very tolerant to write a standard style code, of course, we also need to use some of the Javascrip component features, because the native Bootstrap is based on jQuery, in order to be able to use it well in Angular.js, we introduced UI Bootstrap, about jQuery you are all familiar with, we use a lot of third-party plug-ins are jQuery, so also introduced.
The above is just a list of the Javascript frameworks and class libraries that Worktile mainly uses, and the real class libraries are much more than those listed above. Such as calendar library ui-calendar, underscorejs and so on.
Server side
Node.js
Redis
MongoDB
Node.js
The server is built on Node.js, and our server-side MVC framework uses Expressjs. At the beginning, it was Express 3.x version, but now it has been upgraded to 4.x. Expressjs provides Route and template engine functions. Because our server basically only provides data services, we basically do not use the server template engine (only layout and some configuration items need to be used when outputting to the interface).
Node.js is chosen because it is simple, suitable for highly concurrent Web services, and our developers are proficient in using it. I have answered the pros and cons of Node.js on Zhihu: what are the advantages and disadvantages of using Node.js?
Redis
The login status of Worktile users, some temporary data and part of the business data cache are all stored in Redis, and the Node Redis module is used to connect Node.js and Redis.
MongoDB
Worktile is not a highly physical system or traditional business intelligence application, so MongoDB is very suitable for high performance, convenient clustering, storage in BSON structure and perfect integration with Node.js.
Instead of using native drivers between Worktile's data layer and MongoDB, mongoosejs is used, which is similar to the ORM framework on Java or C#. Mongoose can be used to define data Schema and read operation MongoDB.
Push service
As mentioned earlier, Worktile is a SPA program. After users log in to the system, basically all operations do not need to refresh the browser. Because it is a collaborative office software, other users' multi-data operations need to be updated in real time, so the client must maintain a long connection with the server to exchange data. Our real-time push service is written in Erlang language. Those who are interested can check out: https://worktile.com/tech/basic/worktile-real-time-notice
Erlang was adopted because our developers have experience in this area, and Erlang is well suited for this highly concurrent real-time push service.
If you are familiar with Node.js, you must know Sockiet.IO, our initial real-time push is actually using Sockiet.IO, and later, due to the increase in traffic, the original Sockiet.IO is based on the Worktile Web site, not a separate service, so it is completely rewritten with Erlang when refactoring.
In fact, these two technologies are very good, which one you choose mainly depends on what you are good at.
File Preview Service
Anyone who has used Worktile must know that uploading some files in the system, such as word, excel, txt, pdf, ppt, etc., can be previewed online. The preview of files such as txt and pdf is actually easy. Txt can read the contents of the file directly. Pdf can be easily done by using the preview provided by the browser or using some Js class libraries, but for Ofiice files, it is not possible to read them directly. So we built a set of Ofiice preview service, which is mainly based on Microsoft's Office Web App service.
Box file service
All the files in Worktile are stored on Aliyun's OSS. In order to do some permission authentication and security issues, we transfer through a Box service, and all files are uploaded and downloaded through the Box service. Thanks to @ Shaun Xu, the father of Box on the fifth floor, he wrote such a good Box service.
The above is a brief introduction to all the technologies and architectures used by Worktile.
The number of users of Worktile has also increased rapidly since it was launched, so the number of Web servers has changed from one to multiple, the database from a single instance to the current cluster, and so on. The server structure diagram of Worktile is as follows:
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.