Friday, November 24, 2017

system design approach

hibernate

  • n+1 read problem
  • problem of granularity
  • domain model
  • coarse grained class vs fine grained class

rdbms issues

  • index
  • materialized view
  • query optimization
  • how to read query execution plan?
  • joins esp hash
  • performance tuning
  • partitioning
  • pre-joined indexes
  • buffer
  • latching problem
  • filter in join
  • join order
  • algebra
  • statistics
  • graph theory
  •  

Thursday, November 23, 2017

performance

  • use memcache or redis to cache the following
    • city/state/country
    • zipcode
    • qualication types
    • job types

Representing address

Wednesday, November 22, 2017

Spring Boot doubts

  • disabling embedded tomcat server
    • can we disable it 
    • how to configure it?
  • how to know the server being used ie pivotal or embedded tomcat or outside tomcat?
  • how to monitor ports which are being used?
  • use the following command at command prompt to show the port number in use
  • netstat -anp | find "port 8080"  is not working
  •  

debugging a spring boot application

  • indepth knowledge of build tool like maven and gradle
  • indepth knowledge of logging
  • indepth knowledge of server ie tomcat etc
  • indepth knowledge of browser 
  • indepth knowledge of  cache and how to clean it and disabling it

STS issues

  • terminating unresponsive applications

user interface

  • horizontal navigational footer menu
    • it should be displayed in the middle one  below the other when screen size is reduced
    • ie it should be responsive

Tuesday, November 21, 2017

Web design graphics

Spring security lessons

  • css and image files were not getting loaded because i had overridden the configure method of
 WebSecurityConfigurerAdapter class as follows:
  •  @Override
        public void configure(final WebSecurity web) throws Exception {
          
           web.ignoring().antMatchers("/");
                       
        }
  • The above was not loading the css and images. the reason is yet to be known.
  • So when i entered the authentication password css and image files are getting loaded as desired.
  • @Override
        protected void configure(final HttpSecurity http) throws Exception {
        http
            .csrf().disable()
            .authorizeRequests()
                .antMatchers("/","/css/**","/images/**").permitAll();
  • }   
  • the above solved the problem to bypass the security for home page,css and image.
  • we also need to override the following method of webconfigurerAdapter class to serve the static resources ie we need to add the resource locations through the following commands:
  • @Override
        public void addResourceHandlers(final ResourceHandlerRegistry registry) {
          //registry.addResourceHandler("/resources/**").addResourceLocations("/", "/resources/");
           
      registry.addResourceHandler("/css/**").addResourceLocations("classpath:/static/css/");
      registry.addResourceHandler("/images/**").addResourceLocations("classpath:/static/images/");
      registry.addResourceHandler("/js/**").addResourceLocations("classpath:/static/js/");
     
           
         }

Being a Writer

Friday, November 10, 2017

hello spring boot with css and image

following is the hello spring boot example on github. This example does not use any database and neither spring security has been used.
hello spring boot with static resources

Thursday, November 9, 2017

github errors

  • dealing-with-non-fast-forward-errors
  •  when we create a repository and then add a readme file to it then while pushing to it generates the error. I have not worked on its solution instead I created a new repository and did not add readme. then performed the following steps
    • goto to the root of the project folder ( check its properties by right clicking n it)
    • git init
    • git remote add origin https://github.com/javaiskool/springexamples.git
    • i got the error:
    • fatal: remote origin already exists.
    •  i removed the error by using the following command
    •  git remote rm origin
    •  then
    • git remote add origin https://github.com/javaiskool/springexamples.git
    • git add .
    • git commit -a -m "initial commit"
    • git push -u origin --all
    • after that i created a readme.md file and described the example.
    • As the repository is public username and password were not asked

Wednesday, November 8, 2017

thymeleaf

e-commerce

  • order  vs orderline
    • order has the details of customer,orderid,orderdate
    • orderline has the details about the order ie all the products that particular order contains ie same sone order can have multiple quantities of multiple products.
    • see the example

spring problems

spring boot

 
  •  spring application can be found under debug menu in sts and hence it can be terminated here 
  •  if unable to create spring boot project inside STS 3.8.4 then goto start.spring.io
  • there Spring Initializer
  •  click  switch to full version
  •  choose the required dependencies
  • download the zip
  • unzip it
  • open it in STS as new maven project
  •  tutorial-spring-boot-application-development-using-sts.html
  •  

Sunday, November 5, 2017

aws

  • separate-aws-production-and-development-accounts
  •  separate aws accounts for
    • production(consolidated billing)
    • developer
    • QA
    • billing
  • for consolidated billing we need to create the organization and the creator of the organization is the owner of the organization and can control the services of the other linked accounts.
  • for this the owner need to add account through the email or account id. if the invitee accepts the invitation then services of this account can be controlled by the organization owner.
  • details is as follows:
  • If you accept the invitation, the administrator of the organization can attach policy-based controls to your AWS account. The organization administrator can control which AWS services and APIs are allowed in this account for business reasons such as security or budgetary controls. These controls can include preventing this account from leaving the organization.