Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Case Analysis of Storm interview questions

2025-03-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article introduces the relevant knowledge of "case study of Storm interview questions". In the operation of actual cases, many people will encounter such a dilemma. Next, let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

1. Demand analysis

On the event promotion day (for example, double 11), the platform requires that some sales information of that day be displayed in real time. We calculate the statistics from three dimensions:

Platform operation and maintenance point of view statistical indicators: total sales of the platform, the number of orders issued by the platform, the number of goods sold on the platform.

Statistical indicators from the perspective of commodity sales: the total sales volume of each commodity, the number of buyers of each commodity, and the sales quantity of each commodity.

Statistical indicators from the perspective of store sales: total sales per store, the number of buyers per store, the number of sales per store.

2. Determine the data source

Data source: data generated by order system and payment system.

3. Determine the collection scheme.

The data generated by the order system and the payment system are transferred to kafka through ActiveMQ, and Storm integrates kafka to obtain the data. (note: why use ActiveMQ? On the one hand, transaction support is needed in the e-commerce business system, which can only be realized by a more rigorous jms system, so we consider using ActiveMQ. On the other hand, kafka directly reads the database, which will affect the speed of the database. Therefore, the data of the order system falls to the database through the ActiveMQ middleware, and kafka takes the data from the ActiveMQ middleware, which can avoid the problem of reading the database directly. )

4. Determine the storage

We accumulate the data processed by Storm through Redis and store it in Redis.

5. Data calculation

Write Storm code: Storm is integrated with kafka to get the data, and each piece of data information is counted and stored in Redis by using the command incrBy in Redis.

6. Show

You can write a timer, regularly go to Redis to get the result data, and display it on the web interface.

7. Storm log monitoring and alarm system

8. Demand analysis

To achieve the function of log monitoring in the project, you need to achieve real-time alarm of log monitoring. For example, if any exception occurs in the system and any alarm rules are triggered, you can inform the relevant system manager by SMS or email in real time.

9. Determine the data source

Log information generated by each business system (such as order system, commodity management system, user system).

10. Determine the collection scheme

The log data is collected into kafka through flume, and Storm is integrated with kafka to obtain data.

11. Determine the storage

The data that triggers the alarm rule is stored in the MySQL database.

12. Data calculation

By customizing the flume interceptor, add an appId to the log data generated by different systems as a unique identification (different systems have different alarm rules and responsible persons, so we need to add a unique identification here to facilitate us to find the corresponding rules and responsible persons).

Storm code writing steps:

(1) get the data in kafka.

(2) set a timer to regularly read the alarm rules in the MySQL database (we can modify the alarm rules in the database at any time, so we need to use a timer to read them to ensure that they are the latest rules).

(3) match the obtained data with the alarm rules to get the alarm data information that matches successfully.

(4) send the alarm information to the corresponding person in charge by email or SMS (the information of the corresponding person is obtained from the MySQL database).

(5) finally, the warning information is stored in our MySQL database (it is convenient to query the exception record later).

This is the end of the case study of Storm interview questions. Thank you for your reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

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.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report