Giter VIP home page Giter VIP logo

today-i-learnt-nancy's Introduction

TIL: 26-02-2021

DHCP Protocol is used to assign IP addresses. It is present in router and it is also used in Docker, Kubernetes, AWS and etc.

  • Docker: By default, the container is assigned an IP address for every Docker network it connects to. The IP address is assigned from the pool assigned to the network, so the Docker daemon effectively acts as a DHCP server for each container.

TIL: 07-03-2021

Idempotency: Idempotence is talked about a lot in the context of "RESTful" web services. Basically, if making multiple identical requests has the same effect as making a single request it is idempotency.

TIL: 08-03-2021

Interface vs abstract class in Java

  • When to use what?
  • Interfaces can be used if we want a full implementation and use abstract classes when you want partial pieces for your design.

TIL: 10-03-2021

  • Problem : You are calling resource even when it is not needed which created the side effect like overriding in db.
  • Solution: Can be tackled by using supplier. This was due to incorrect usage of optional (https://www.baeldung.com/java-optional)
  • Optional: orElse() and orElseGet(). orElse() takes concrete value and orElseGet() takes supplier.
  • Lazy Evaluation using supplier: You pass function(lambda) instead of concrete values. Whenever you need the value you call the supplier and it computes and then returns the value.

TIL: 11-03-2021

Came across CGI (common gateway Interface). CGI led to developmemt of WSGI, servlet https://www.geeksforgeeks.org/common-gateway-interface-cgi/

TIL: 15-03-2021

Problem : Port forwarding, concurrent CI was portfowarding to localhost concurrently which led to port already occupied issue.

Solution : With docker-compose override for CI, you will be using the docker virtual namespace only.

  • tail -f /dev/null to run container indefinitely

TIL: 16-03-2021

Retry and Resiliency: Network calls are most likely to fail so putting retry on particular peice of code which is most likely to fail is the apt way.

TIL: 18-03-2021

Database Transaction: A transaction is a unit of work that you want to treat as "a whole." It has to either happen in full or not at all.

ACID = Atomicity, Consistency, Isolation, Durability

TIL: 24-03-2021

I have been recently working around CQRS. Command-Query Responsibility Separation or CQRS is a simple architectural paradigm. It dictates that we should separate our system in two conceptually different parts. There is the command side, also known as the write side, which changes the state of the system via updates, deletes, etc. and the query side or the read side which only queries the state (presenting the information to the user or other modules of the system). Will write a detailed blog on this.

TIL: 10-04-2021

Fan-In vs Fan-out: Fan-in refers to the number of higher-level modules that directly call the module, while fan-out refers to the number of lower-level modules directly called by the module

  • Fan in Example : Collect many tasks from smaller distribution points and combine them to larger tasks i.e courier system

  • One use case I can think of is fan-out write/read.

  • For example, if you tweet and Twitter delivers that to all the subscribers feeds as soon as it is written (fan-out write). Or a feed service that waits until users are actually consuming the feed, at that time it looks for posts that have been written that this user is eligible to read (fan-out read).

How To Harden the Security of Your Production Django Project

https://www.digitalocean.com/community/tutorials/how-to-harden-your-production-django-project

TIL: 13-04-2021

SQLite strives to provide local data storage for individual applications and devices. SQLite is a good fit for use in cellphones, set-top boxes, televisions, game consoles, cameras, watches, kitchen appliances, thermostats, automobiles, machine tools, airplanes, remote sensors, drones, medical devices, and robots: the "internet of things". For device-local storage and testing use SQLite

https://sqlite.org/whentouse.html

TIL: 14-04-2021

TIL: 16-04-2021

TIL: 20-04-2021

SET PASSWORD FOR 'root'@'localhost' = PASSWORD('mypass');
FLUSH PRIVILEGES;

TIL: 22-04-2021

from celery.schedules import crontab
# Other Celery settings
CELERY_BEAT_SCHEDULE = {
    'task-number-one': {
        'task': 'app1.tasks.task_number_one',
        'schedule': crontab(minute=59, hour=23),
        'args': (*args)
    },
    'task-number-two': {
        'task': 'app2.tasks.task_number_two',
        'schedule': crontab(minute=0, hour='*/3,10-19'),
        'args': (*args)
    }
}

TIL: 24/04/2021

  • Use webp instead of png and jpg/jpeg for hosting images in website. It improves the performance.
  • Using webp I reduced download time of my website from 30 sec to 3 sec.
  • Use https://web.dev/measure/ to measure the site performance. It also gives the suggestion for improvement.

TIL: 27/04/2021

TIL: 28/04/2021

  • watch -n 1 curl -vvv 192.168.64.3 Repeats the curl indefintely

TIL: 30/04/2021

  • A Correlation ID, also known as a Transit ID, is a unique identifier value that is attached to requests and messages that allow reference to a particular transaction or event chain
  • Correlation IDs is a very good cocnept if you want to improve your logging and distributing tracing
  • Also there are tools like Zipkin and jaegar that help if you have a correlation ID
  • Jaegar + loki is very helpful in debugging

TIL: 10/05/2021

  • Database normalisation
  • Removal of duplicated data form db
  • It is used for optimising write operation

TIL: 13/05/2021

TIL: 28/05/2021

  • On call learning: Avoid long running tasks in database transaction ( for example file download, computation and etc )
  • It might lock the table

TIL: 5/06/2021

  • API optimisation
  • Serialisation is an expensive process
  • Avoid doing serialisation in between. Try at response level
  • lock mechanism - Instead of depending on db checks use another mechanism locks

TIL: 28/09/2021

TIL: 15/03/2022

  • Long time no see:P (need to be more consistent here)
  • Learnt about various things past few months at zeotap
  • Tech I was involved with -> CDF pipeline, play framework, end-end product delivery
  • I will write in detail about observability in data ingestion

today-i-learnt-nancy's People

Contributors

nancy-chauhan avatar

Watchers

 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.