Skip to content

Instantly share code, notes, and snippets.

View rjyala-godaddy's full-sized avatar
🐢
Slow

Rahul Jyala rjyala-godaddy

🐢
Slow
View GitHub Profile
@rjyala-godaddy
rjyala-godaddy / Trees are Everywhere
Last active October 22, 2024 15:28
Trees are Everywhere
Trees are not just limited and useful to solving your LeetCode questions, but they form the crux of most databases.
Depending on the indexes you have created or the queries you fire, the database engine loads (or keeps data pre-loaded) in the right variant of the tree and executes the query. Some of the variants that are commonly found across databases are
1. B-tree - range queries and equality searches on sorted data
2. B+ tree - range queries over large datasets based on disk
3. R-tree - spatial and multidimensional range queries
4. T-tree - range queries with a high locality of reference
5. Trie - prefix queries and auto-complete searches
6. Suffix tree - substring queries and sequence matching
SELECT slot_name,
pg_size_pretty(pg_wal_lsn_diff(pg_current_wal_lsn(), restart_lsn)) as replicationSlotLag,
pg_size_pretty(pg_wal_lsn_diff(pg_current_wal_lsn(), confirmed_flush_lsn)) as confirmedLag,
active
FROM pg_replication_slots
getting the lag
@rjyala-godaddy
rjyala-godaddy / system_design.txt
Last active July 12, 2023 07:39
Most Wanted System Design Questions
1. Design a simple URL shortening service.
2. Design a basic chat application.
3. Design a file storage system.
4. Design a simple social media platform.
5. Design a simple search engine.
6. Design a simple e-commerce website.
7. Design a basic ride-sharing system.
8. Design a basic video streaming service.
9. Design a simple recommendation system.
10. Design a basic food delivery app.
Check the java version:
java -version
Check all the JDK installed on your Mac:
/usr/libexec/java_home -V
Update the version:
export JAVA_HOME=`/usr/libexec/java_home -v 1.8`
@rjyala-godaddy
rjyala-godaddy / notes.txt
Last active January 19, 2023 13:18
Cloudinary Notes
Basics:
he URL format for Cloudinary is as follows:
https://res.cloudinary.com/<your_cloud_name>/<resource_type>/<type_parameter>/<version>/<file_name>
https://res.cloudinary.com/<cloud_name>/<asset_type>/<delivery_type>/<transformations>/<version>/<public_id_full_path>.<extension>
* <your_cloud_name> is your unique Cloudinary cloud name.
* <resource_type> is the type of resource, such as image or video.
* <type_parameter> is an optional parameter that specifies how the resource should be delivered, such as 'upload' or 'private'.
* <version> is an optional parameter that allows you to specify a specific version of the resource.
* <file_name> is the name of the file you want to access, including the file extension.
@rjyala-godaddy
rjyala-godaddy / PostgreSQL_index_naming.rst
Created December 26, 2022 07:35 — forked from popravich/PostgreSQL_index_naming.rst
PostgreSQL index naming convention to remember

The standard names for indexes in PostgreSQL are:

{tablename}_{columnname(s)}_{suffix}

where the suffix is one of the following:

  • pkey for a Primary Key constraint;
  • key for a Unique constraint;
  • excl for an Exclusion constraint;
  • idx for any other kind of index;