Posts

A Conversation That Changed How I Think About Backend Systems - Part I

Image
Me: I think our API servers will be the first thing to break if we get a million users. Him: Why do you think that? Me: Because… more users means more requests. The APIs will get overloaded, right? He smiled. Not the “you’re wrong” smile — the wait and think one. “Are the APIs really doing the work?” Him: When an API receives a request, what does it actually do most of the time? I paused. Me: It… validates input, runs business logic, calls the database, and returns a response. Him: Exactly. Now tell me — which part takes the longest? That’s when it clicked. Me: Waiting on the database. Him: Good. So if an API is slow, is it really the API that’s slow? The first bottleneck appears In large systems, API servers rarely struggle because of computation. They struggle because they wait . They wait for: Database queries Cache misses External services Network I/O At scale, waiting is more dangerous than working . “The database is the fragile one” Me: So the database is the real bottleneck? ...

Python Literals: Understanding the Building Blocks of Python Programming

 Python is a high-level programming language that is widely used for web development, data analysis, and artificial intelligence. One of the fundamental building blocks of Python programming like many other programming languages is literals, which are fixed values used to represent data in a program. In this article, we will discuss what literals are and how they are used in Python. What are Python Literals? Literals in Python are fixed values that can be used to represent data in a program. They can be numbers, strings, booleans, or special objects that represent complex data structures, such as lists, tuples, sets, and dictionaries. Literals are used to create objects that have a fixed value and cannot be changed during the execution of the program. Types of Python Literals Numeric Literals: Numeric literals in Python can be either integers or floating-point numbers. Integer literals are written as a sequence of decimal digits, while floating-point literals are written with a dec...

Sending Emails from Python Django using your gmail account

Image
Normally applications need to send the verification code or welcome messages to the registering user for their application using emails.  Sending email is not hard in if we are developing the backend of the application using Python or Python framework like Django.  As the first step we need to configure our gmail account to allow us to send email using code without login in to gmail and sending manually.  Login to your gmail account  Click on the profile icon shown in the top right corner of the browser window in gmail Click on "Manage your Google Account" button like shown in the below image. Choose Security tab in the screen shown after the above step Scroll down to see the section "Signing in to Google" section Enable two step verification there by giving your mobile number or some other method of verification.  Once clicked on Get Started button on the popup ti will ask you to login again. Once the above step finished you can see a new item in the "Signing ...

Setup Google Analytics with React JS web application - Part 1

Image
We need to navigate to the analytics page of Google first using the link  https://analytics.google.com . If we are new to google analytics (ga) we will see a welcome screen like the below image. Once click on the "Start measuring" button it will show an account setup screen where we need to enter any name for "Account name" field then tick on "Google products and services" option if needed and click on "Next" button. The Property setup window will show where you have to enter any value which represents your web application. After entering a name click on "Next" button. It will ask for some details about the business like which category the business belongs to and the business size and some other data. Once fill it click on the Create button shown bottom part of the screen. Once click on Create button it will pop up a message where we need to accept the terms of service. There might be more than one check box that needs to be ticked. Scr...

create-react-app inside a already created folder

Image
 Once we create a GitHub repository and cloned it into the local machine for development. We can use the same repository to hold the react app. If we are using  create-react-app  most of the time we use it with a project name which will be the folder name for the react project. In this case we use something like  create-react-app my-app  here the folder named my-app will be created and will hold the react project. Anyhow If we wanted to create a react project inside the cloned repository from GitHub or already named directory we could do it using  create-react-app .  command (notice the '.'). It will create put all the react code inside already created or cloned folder.

Append text to a file in Laravel

Image
In Laravel some time you want to add error logging or some other text information related to your code running status in a file. I'm going to show how you can achieve that First you need to use the inbuilt File class inside your controller, for that include the below line on the controller above your class definition (Refer the below picture) use File; Once you include the above line now you can call the function from the File class, the function we need for appending the text to a file is append() function. This function will append any text you are providing to the end of the already created file, or if the file is not available it will create a file in the name you provide and append the text to it. Next thing is we need to pass two parameters to this function, first parameter is storage location with file name and the second one is the text you want to append (Refer the belo picture) In the above picture I'm using a function in the place of storage location and file...

CakePHP for newbies Part 1

Image
Hi Guys, I have learnt some thing today about CakePHP and I'm using it for my new web based application, I would like to share some thing with you, I would like to give some of basic practicality issue without diving into theory because you can find the theory in the below official link. http://book.cakephp.org/3.0/en/index.html Before installing CakePHP framework we need to install local servers if we are using our own PC in the development, I would like to install WAMP server as my local server Before installing WAMP server in windows machine first install the Visual C++ Redistributable for Visual Studio from the below link http://www.microsoft.com/en-us/download/details.aspx?id=30679 After that you can download and install WAMP server from the below link. http://www.wampserver.com/en/ Once the installation finishes you can run the WAMP server but in windows 10 it will conflict with the locally running windows www service therefor the icon of the WAMP server looks...