Spring-core concepts of underlying architecture

Spring underlying core components BeanDefinition BeanDefinition represents Bean definition. There are many attributes used to describe the characteristics of Bean: class, indicating the Bean type scope, indicating Bean scope, singleton or prototype, etc. lazyInit: indicates whether the Bean is lazy loaded initMethodName: Indicates the method to be executed when the Bean is initialized. destroyMethodName: Indicates […]

Generative AI – application architecture and solutions based on large models

This article explores the process of building language model (LLM)-based applications using document loaders, embeddings, vector stores, and hint templates. Due to its ability to generate coherent and contextual text, LLM is becoming increasingly popular in natural language processing tasks. This article discusses the importance of LLM, compares fine-tuning and context injection methods, introduces LangChain, […]

Spring Security: overall architecture

Filter Spring Security is implemented based on Sevlet Filter. The following is a diagram of an Http request starting from the client and interacting with the Servlet: When the client sends a request to the application, the container will create a FilterChain, which contains multiple Filter and Servlet >. These Filter and Servlet are used […]

Multi-level cache in microservice architecture should be designed like this!

Thisisacommunitythatmaybeusefultoyou One-to-onecommunication/interviewbrochure/resumeoptimization/jobsearchquestions,welcometojointhe”YudaoRapidDevelopmentPlatform“KnowledgePlanet.ThefollowingissomeinformationprovidedbyPlanet: “ProjectPractice(Video)”:Learnfrombooks,“practice”frompastevents “InternetHighFrequencyInterviewQuestions”:Studyingwithyourresume,springblossoms “ArchitecturexSystemDesign”:Overcomingdifficultiesandmasteringhigh-frequencyinterviewscenarioquestions “AdvancingJavaLearningGuide”:systematiclearning,themainstreamtechnologystackoftheInternet “Must-readJavaSourceCodeColumn”:Knowwhatitisandwhyitisso Thisisanopensourceprojectthatmaybeusefultoyou DomesticStarisa100,000+opensourceproject.Thefront-endincludesmanagementbackend+WeChatapplet,andtheback-endsupportsmonomerandmicroservicearchitecture. FunctionscoverRBACpermissions,SaaSmulti-tenancy,datapermissions,mall,payment,workflow,large-screenreports,WeChatpublicaccount,etc.: Bootaddress:https://gitee.com/zhijiantianya/ruoyi-vue-pro Cloudaddress:https://gitee.com/zhijiantianya/yudao-cloud Videotutorial:https://doc.iocoder.cn Source:Internet Multi-levelcachedesigninmicroservicearchitecture clientcache Applicationlayercaching CDNContentDeliveryNetwork Nginxcachemanagement Servicelayercaching In-processcache Distributedcacheservice Ensurecacheconsistency summary Todaywewilltalkaboutthetopicofcachingandseehowtodesignaneffectivemulti-levelcachearchitectureinamicroserviceenvironment.Itmainlyinvolvesthreeaspects: Client-sidecachingforwebapplications; Applicationlayerstaticresourcecaching; Servicelayermulti-levelcaching. First,let’sexplainthemulti-levelcachedesignofmicroservicearchitecture. Multi-levelcachedesigninmicroservicearchitecture Whenitcomestocaching,everysoftwareengineermustbefamiliarwithit.Itisthemostdirectwaytoimproveperformanceincurrentarchitecturedesign.Herewegiveanexample: Rediscache AssumethattheapplicationstoresrawdatainaMySQLdatabase.Asweallknow,theMySQLdatabasestoresdataontheharddisktopreventlossduetopowerfailure.However,duetothephysicaldesignoftheharddisk,eventhebest-performingenterprise-classSSDharddiskisanorderofmagnitudeworsethantheIOlevelofhigh-speeddevicessuchasmemory.Internetapplicationsrepresentedbye-commercecompaniessuchasTaobaoandJD.comaretypicalscenariosof”morereadingandlesswriting”.Therefore,weneedtoseparatethereadingandwritingofdatainthedesign.Whendataisloaded,itisdirectlyplacedonthediskforprocessing,whilemorethan90%ofthedatareadingoperationsareextractedfromthein-memoryNoSQLdatabaserepresentedbyRedis,andthehighthroughputofthememoryisusedtocompletethedataextractioninstantly.TheroleofRedishereiswhatweoftensaycache. Ofcourse,cachingisnotjustaformofreplacingharddiskswithmemory.Inadistributedarchitecture,cachinghasitsowndesignateachlayer.Let’sexplainitthroughthemulti-levelcachearchitecturediagramofthismicroserviceasthemainline. OverviewofXcachemulti-levelcachearchitecture Thisdiagramcontainsfourlayersfromtoptobottom:Client,applicationlayer,servicelayeranddatalayer. Backendmanagementsystem+userappletimplementedbasedonSpringBoot+MyBatisPlus+Vue&Element,supportingRBACdynamicpermissions,multi-tenancy,datapermissions,workflow,three-partylogin,payment,SMS,mallandotherfunctions Projectaddress:https://github.com/YunaiV/ruoyi-vue-pro Videotutorial:https://doc.iocoder.cn/video/ Clientcache TheXmallclientisabrowser.Atthebrowserlevel,wemainlycachestaticresourcessuchasimages,CSS,JS,andfontsinHTML. browsercache Let’staketheBaiduLogoimageasanexample.BaiducontrolsthevalidityperiodofthestaticimagethroughtheExpiresresponseheaderinHTTP.Expiresrepresentsexpirationtime.ThecurrentBaiduLogoexpirationtimeisFebruary8,2031,9:26:31.Duringthisperiodoftime,thebrowserwillcachetheimagelocallyasafile.Whenyouvisitagain,youwillseetheprompt”fromdiskcache”.Atthistime,thebrowserwillnolongermakeanactualrequesttotheserverandwillreaditdirectlyfromthelocalcomputer.Getcachedimages.BysettingExpiresonthebrowserside,thebandwidthlosscausedbyrepeatedrequestsforstaticresourcescanbegreatlyreduced.Thisisabasicandimportantsettinginhigh-concurrencywebapplications. Backendmanagementsystem+userappletimplementedbasedonSpringCloudAlibaba+Gateway+Nacos+RocketMQ+Vue&Element,supportingRBACdynamicpermissions,multi-tenancy,datapermissions,workflow,three-partylogin,payment,SMS,mallandotherfunctions Projectaddress:https://github.com/YunaiV/yudao-cloud Videotutorial:https://doc.iocoder.cn/video/ Applicationlayercache SowhereisExpiresset?Forthebrowser,itisjustaclientandisonlyresponsibleforreadingtheExpiresresponseheader.Expiresmustbesetattheapplicationlayer,thatis,CDNandNginx. CDNContentDeliveryNetwork ThefullnameofCDNisContentDeliveryNetwork,whichisthecontentdistributionnetwork.ItisthemaintechnicalmeansforthedistributionofstaticresourcesontheInternet. CDNContentDeliveryNetwork Chinaisavastcountry,withthousandsofkilometersfromBeijingtoShanghai.IfalargenumberofShanghaiuserswanttoaccesstheresourcesofserversinBeijingthousandsofmilesawayatthesametime,suchalongcommunicationwillinevitablybringhighdelaysandmoreuncontrollablefactorsaffectingdatatransmission.IfthereissomemechanismthatallowsstaticfilesinBeijingtobecachedonserversinShanghai,Shanghaiuserscanautomaticallyaccessthenearestservertoobtainresources.Thiscangreatlyreducenetworklatencyandimprovesystemavailability.ThedistributedcachingtechnologyjustmentionedistheCDN(contentdistributionnetwork)weoftenmention. Forwide-areaInternetapplications,CDNisalmostanecessaryinfrastructure,whicheffectivelysolvestheproblemsofconcentratedbandwidthoccupationanddatadistribution.Staticresourcessuchasimages,audioandvideo,CSS,andJSinwebpagescanbeobtainedfromthenearestCDNserver. ThecoreofCDNtechnologyis”smartDNS”.SmartDNSwillautomaticallydeterminethenearestaccessCDNnodebasedontheuser’sIPaddress.Let’stakethefollowingfigureasanexample: CDNexecutionprocess […]

A fully automated white hat vulnerability scanner

DarkAngel is a fully automated white hat vulnerability scanner that can monitor hackers and bugcrowd assets, generate vulnerability reports, screenshot vulnerability URLs, and send message notifications. Currently supported features: Hacker asset monitoring; Swarm asset monitoring; Add user-defined assets; Subdomain scanning; website crawler Website fingerprinting; vulnerability scanning; Automatic screenshot of vulnerability URL; Automatically generate vulnerability reports; […]

Help understand: diversity, interleaving, SFFT, additive Gaussian white noise

Variety Diversity is a technique used in wireless communications to increase signal reliability and reduce the effects of fading. The core idea is to improve communication quality through multiple independent or nearly independent signal replication. Because each signal replica experiences a different propagation path or condition, they may not all be affected by fading at […]

Lane line detection using deformable convolution based on ResNet18 architecture

Below is a PyTorch code example of a keypoint-based lane detection network using deformable convolution. This code example is based on the ResNet18 architecture and can be modified according to the actual situation. First, you need to import the necessary libraries and modules: import torch import torch.nn as nn import torch.nn.functional as F from torch.nn.modules.utils […]

Binutils new target architecture porting guide

Binutils new target architecture porting guide Binutils file organization structure Main functional areas and data structures Binary file description opcodes include binutils gas ld Build and test Building the binutils tool Test binutils tool document Although the binutils project already has a 100 page internal guide, this article is written primarily for those who want […]

Application of C++ prefix sum algorithm: minimum white bricks covered with carpet Principle source code test case

Basic knowledge points involved in this article C++ algorithm: principles, source code and test cases of prefix sum, prefix product, prefix XOR including course videos Title You are given a binary string floor whose index starts from 0, which represents the color of the bricks on the floor. floor[i] = 0’ means that the color […]