Git Product home page Git Product logo

urls's Introduction

URLS

Build and start

make run

PHP Container - build db

Run in host

make in-php
php bin/console doctrine:migrations:migrate --env=dev -vvv --no-interaction

MySQL Container - load data

Run in host

make in-db
cd /var/lib/mysql-files
mysql -h database -uroot -ppassword urls

Inside MySQL

USE urls;
LOAD DATA INFILE '/var/lib/mysql-files/alexa-domains.txt'
    INTO TABLE domain_list
    FIELDS TERMINATED BY ','
    ENCLOSED BY '"'
    LINES TERMINATED BY '\n'
    (domain);

Generate 1 mil urls (back in php container)

Wait about 5 mins

php bin/console urls:generate --env=dev -vvv

How to use

Inside PHP container run:

php bin/console urls:check --env=dev -vvv

If you want to add a new url:

php bin/console urls:add --env=dev -vvv

Context

  • URLS can be 2048 characters long

  • the overall domain name, including subdomain + actual domain name + TLD, can be 253 characters long

  • pathname can be 2048 - 253 - 7 (worst case scenario http://) = 1788 characters long, worst case scenario

  • parameter can be 2048 - 253 - 7 - 3 (?, =, and 1 min character for parameter val) = 1785 characters long, worst case scenario

  • https://stackoverflow.com/questions/10552665/names-and-maximum-lengths-of-the-parts-of-a-url

  • 3072 bytes can fit 768 characters, worst case scenario

Implementation

  • in webpage, the domain will have a max length of 253 characters and the pathname will have a max length of 1788 characters
  • there is an index on the domain column
  • there is a index prefix length of 768 on the domain column
  • the webpage_parameter has a column parameter with a max length of 1785 characters and a index prefix length of 768
  • the val column from webpage_parameter doesn't really matter. based on further requirements it can even be taken out

urls's People

Contributors

adrianistrate avatar

Watchers

 avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.