ASUS Router Firmware Upgrade Notification

I have written this pice of code to let me know when there is a new firmware upgrade of my router. This should work on most of the ASUS Routers. I’ve tested only on RT-AX86U. I’ve scheduled this from my PC to run once a day. I’m using Pushover to get the notifications on my … Read more

Locking in DynamoDB

DynamoDB, as a NoSQL database, does not employ traditional locking mechanisms like row-level locking found in relational databases. Instead, it utilizes optimistic concurrency control to manage concurrent data access and ensure data consistency. Optimistic Concurrency Control (OCC) In optimistic concurrency control, DynamoDB assumes that concurrent updates to the same item are unlikely to conflict. It … Read more

SQL Joins

There are four main types of joins in SQL: In addition to these four main types of joins, there are also a few other types of joins, such as: The type of join that you use will depend on the specific requirements of your query. For example, if you want to find all customers who … Read more

What is the difference between Optimistic and Pessimistic locking

Optimistic and pessimistic locking are two different concurrency control mechanisms used in databases and multi-user systems to handle concurrent access to shared resources, such as database records, files, or data structures. Both mechanisms aim to prevent conflicts and maintain data consistency when multiple users or processes attempt to access and modify the same resource simultaneously. … Read more

Duplicate MySQL Indexes

In MySQL, a primary key is a unique identifier for each row in a table. It ensures that each record is uniquely identifiable and helps in enforcing data integrity. When you create a primary key on a column, MySQL automatically creates an index on that column to optimize the search and retrieval of data. Indexes … Read more

Database Normalization

Normalization is the process of organizing data in a database in a way that minimizes redundancy and dependency, and thus improves data integrity. There are several levels of normalization, each of which has its own set of rules. To normalize a MySQL database, you can use the following steps: Once you have normalized your database, … Read more

Top 5 tips for Database Performance

Optimising the performance of a relational database is crucial for ensuring efficient and responsive applications. Here are my top five checks you should focus on to improve the performance of your relational database: Bonus Tip: Caching: Implement caching mechanisms to store frequently accessed data in-memory. Caching can reduce the number of database queries and significantly … Read more

How much memory does my Python code use? Memory Profiler!

Memory Profiler is an open-source module that uses the psutil module, to monitor the memory consumption of Python functions. It performs a line-by-line memory consumption analysis. Installation: Install Memory Profiler from PyPl using: pip install -U memory_profiler After you have configured memory_profiler, you can use a decorator to track the memory consumption of the function. The @profile decorator can … Read more

Python – How long does my code take to run?

Recently, I wanted to do some performance of my code. The following is what I’ve used to get some performance timing. The following is the code I’ve used. Run the code with the following: As we can see, the code took 8.3 seconds to run and the following is a breakdown of each module which … Read more