How does a database handle pagination?

How does a database handle pagination?

AI Dashboard is available on the Web, Apple, Google, and Microsoft, PRO version

How does a database handle pagination?

How does a database handle pagination?

It doesn’t. First, a database is a collection of related data, so I assume you mean DBMS or database language.

Second, pagination is generally a function of the front-end and/or middleware, not the database layer.

But some database languages provide helpful facilities that aide in implementing pagination. For example, many SQL dialects provide LIMIT and OFFSET clauses that can be used to emit up to n rows starting at a given row number. I.e., a “page” of rows. If the query results are sorted via ORDER BY and are generally unchanged between successive invocations, then that can be used to implement pagination.

That may not be the most efficient or effective implementation, though.

Get 20% off Google Google Workspace (Google Meet) Standard Plan with  the following codes: 96DRHDRA9J7GTN6
Get 20% off Google Workspace (Google Meet)  Business Plan (AMERICAS) with  the following codes:  C37HCAQRVR7JTFK Get 20% off Google Workspace (Google Meet) Business Plan (AMERICAS): M9HNXHX3WC9H7YE (Email us for more codes)

Active Anti-Aging Eye Gel, Reduces Dark Circles, Puffy Eyes, Crow's Feet and Fine Lines & Wrinkles, Packed with Hyaluronic Acid & Age Defying Botanicals

How does a database handle pagination?

So how do you propose pagination should be done?

On context of web apps , let’s say there are 100 mn users. One cannot dump all the users in response.

Cache database query results in the middleware layer using Redis or similar and serve out pages of rows from that.

What if you have 30, 000 rows plus, do you fetch all of that from the database and cache in Redis?

I feel the most efficient solution is still offset and limit. It doesn’t make sense to use a database and then end up putting all of your data in Redis especially data that changes a lot. Redis is not for storing all of your data.


AI Unraveled: Demystifying Frequently Asked Questions on Artificial Intelligence (OpenAI, ChatGPT, Google Bard, Generative AI, Discriminative AI, xAI, LLMs, GPUs, Machine Learning, NLP, Promp Engineering)

If you have large data set, you should use offset and limit, getting only what is needed from the database into main memory (and maybe caching those in Redis) at any point in time is very efficient.

With 30,000 rows in a table, if offset/limit is the only viable or appropriate restriction, then that’s sometimes the way to go.

More often, there’s a much better way of restricting 30,000 rows via some search criteria that significantly reduces the displayed volume of rows — ideally to a single page or a few pages (which are appropriate to cache in Redis.)

It’s unlikely (though it does happen) that users really want to casually browse 30,000 rows, page by page. More often, they want this one record, or these small number of records.

If you are looking for an all-in-one solution to help you prepare for the AWS Cloud Practitioner Certification Exam, look no further than this AWS Cloud Practitioner CCP CLF-C02 book

 

Question: This is a general question that applies to MySQL, Oracle DB or whatever else might be out there.

I know for MySQL there is LIMIT offset,size; and for Oracle there is ‘ROW_NUMBER’ or something like that.

But when such ‘paginated’ queries are called back to back, does the database engine actually do the entire ‘select’ all over again and then retrieve a different subset of results each time? Or does it do the overall fetching of results only once, keeps the results in memory or something, and then serves subsets of results from it for subsequent queries based on offset and size?

If it does the full fetch every time, then it seems quite inefficient.

If it does full fetch only once, it must be ‘storing’ the query somewhere somehow, so that the next time that query comes in, it knows that it has already fetched all the data and just needs to extract next page from it. In that case, how will the database engine handle multiple threads? Two threads executing the same query?

something will be quick or slow without taking measurements, and complicate the code in advance to download 12 pages at once and cache them because “it seems to me that it will be faster”.

Answer: First of all, do not make assumptions in advance whether something will be quick or slow without taking measurements, and complicate the code in advance to download 12 pages at once and cache them because “it seems to me that it will be faster”.

YAGNI principle – the programmer should not add functionality until deemed necessary.
Do it in the simplest way (ordinary pagination of one page), measure how it works on production, if it is slow, then try a different method, if the speed is satisfactory, leave it as it is.


From my own practice – an application that retrieves data from a table containing about 80,000 records, the main table is joined with 4-5 additional lookup tables, the whole query is paginated, about 25-30 records per page, about 2500-3000 pages in total. Database is Oracle 12c, there are indexes on a few columns, queries are generated by Hibernate. Measurements on production system at the server side show that an average time (median – 50% percentile) of retrieving one page is about 300 ms. 95% percentile is less than 800 ms – this means that 95% of requests for retrieving a single page is less that 800ms, when we add a transfer time from the server to the user and a rendering time of about 0.5-1 seconds, the total time is less than 2 seconds. That’s enough, users are happy.


And some theory – see this answer to know what is purpose of Pagination pattern

Djamgatech: Build the skills that’ll drive your career into six figures: Get Djamgatech.

  • Supabase vs Firebase
    by /u/Own-Leopard-1983 (Database) on April 19, 2024 at 4:58 pm

    submitted by /u/Own-Leopard-1983 [link] [comments]

  • I was looking at databases..and, how much faster is a MariaDB or MySQL vs for ex 500 xls files that are search with a python script? I mean if I have to get rows 50-100 in a file with a specific name, how much faster does a MariaDB/MySQL do that than a python script that does it?
    by /u/savant78 (Database) on April 19, 2024 at 10:18 am

    how much faster are different databases than other methods? submitted by /u/savant78 [link] [comments]

  • [친절한 SQL 튜닝] 2장. 인덱스 기본
    by Hailey (Database on Medium) on April 19, 2024 at 10:08 am

    인덱스의 기본에 대해서 알아보자.Continue reading on Medium »

  • Iceberg has ACID Transactions: A Quick Guide to What that Means
    by Bits of Chris (Database on Medium) on April 19, 2024 at 10:07 am

    If databases didn’t have ACID transactions, we would all be using spreadsheets still.Continue reading on Medium »

  • Langkah-Langkah: Membuat, Mengubah, dan Menghapus Tabel dalam Database dbeaver
    by Rojabinuribrahim (Database on Medium) on April 19, 2024 at 8:57 am

    Apa Itu DbeaverContinue reading on Medium »

  • 👀 Database GitOps with GitHub 🐙
    by /u/Adela_freedom (Database) on April 19, 2024 at 7:44 am

    submitted by /u/Adela_freedom [link] [comments]

  • How to use Spark to write batch data into MatrixOne
    by MatrixOrigin (Database on Medium) on April 19, 2024 at 7:26 am

    Continue reading on Medium »

  • Sorprendentes herramientas para conectarte a múltiples bases de datos SQL y NoSQL
    by Isaac Godínez (Database on Medium) on April 19, 2024 at 5:49 am

    ¿Alguna vez has trabajado con varias bases de datos y te ha tocado abrir MySQL Workbench, PgAdmin, SQL Server Management Studio, o MongoDB…Continue reading on Medium »

  • Behind the Scenes: Triggers in the Database
    by Sourabh Kumar (Database on Medium) on April 19, 2024 at 1:20 am

    Have you ever wondered how a website ensures your username is unique, or how an e-commerce platform automatically updates your shopping…Continue reading on Medium »

  • DB2 Restore backup DB2 database with different database name
    by Chatri Ngambenchawong (Database on Medium) on April 18, 2024 at 11:20 pm

    ProblemContinue reading on Medium »

  • Don’t Crash Your App: Load Records from the Database in Batches for Better Performance
    by Mike Huls (Database on Medium) on April 18, 2024 at 8:38 pm

    Save your Python app’s performance by efficiently loading queryContinue reading on Towards Data Science »

  • Looking for an open-sourced in-memory relational RDBMS that supports transactions for research project
    by /u/jiboxiake (Database) on April 18, 2024 at 8:16 pm

    The title basically says it. I looked into Postgres but it is more disk oriented, and I also looked into VoltDB but it feels like they don't support traditional ACID transactions (they use some partitioning). So can I have some suggestions? submitted by /u/jiboxiake [link] [comments]

  • The Future of Database Queries: Evaluating Text-to-SQL and Text-to-NoSQL with AI
    by Auzair (Database on Medium) on April 18, 2024 at 7:06 pm

    Introduction. In the wake of ChatGPT and other large language models (LLMs) gaining prominence, the fascination with Retrieval Augmented…Continue reading on Medium »

  • 6 Things Should Know on SQL Server for PostgreSQL User
    by tanut aran (Database on Medium) on April 18, 2024 at 6:23 pm

    1. No Limit — use TopContinue reading on Medium »

  • Best database/system architecture for a large number of real-time high rate IOT devices
    by /u/NeegzmVaqu1 (Database) on April 18, 2024 at 2:41 pm

    What would be the best database or architecture of database + data engine for the following requirements: I will receive IOT sensor data that are almost always ordered in terms of timestamp of the signal itself. The exception being if there's network delay between different packets, so they will have to be inserted between the last 1-3 signals most likely. If no changes occur, latest row will be updated instead of doing a new insert. A signal is received from each IOT sensor every 1-5 seconds with a total of ~100,000 devices. Each IOT sensor signal is between 200 B - 2000 B, with an average size of around 500B. Each IOT sensor returns a well-defined set of fields. There are around 200 possible types of fields returned by the IOT sensor, but although it can send all 200 fields, each IOT sensor usually sends a set of 20-40 fields out of those 200 depending on user configuration. So, in terms of storage, most columns for each row will be NULL. A smaller subset of around 10 fields will always be provided by all IOT sensors Availability matters more than consistency since most data will be consumed by the client for real-time monitoring and not through the database. Historical reports queries from the database will mostly be well into the past so eventual consistency is enough. Old data (let's say 3+ months) is deleted. I need partition tolerance with distributed writes on all nodes. Conclusions until now: Partition tolerance needed Availability > consistency NULL fields should take no space Row oriented storage on disk, so that write speed is high Based on these, I am considering Cassandra/ScyllaDB with partitions based on device ID and day like 01_01_2024. However, I have some concerns with regards to query patterns: Users can retrieve a list of complete signals over a time range, like a 1-week period, for a specific device. Parallel queries across the different partitions solves this. This query would be the most used by users to get a history playback of sensor data. Basic aggregation/conditionals over a specific device like a displaying graph of a certain field with 1-hour averages as 1 data point over the span of 1 month or more. Could use parallel queries also but it's less performant since we have to go over so many more partitions and blocks in disk unnecessarily as we only need 1 field at a time for each query, so something like a column-oriented database solves this... but not Cassandra/ScyllaDB. Basic aggregation/conditionals over all or many devices over a specific field like points where a custom limit was exceeded over a time range of 1 month. Benefits from a column-oriented database as well. What is the best database(s)/architecture for this or maybe it is all solvable with Cassandra/ScyllaDB? submitted by /u/NeegzmVaqu1 [link] [comments]

  • Best database for matchmaking - requires high connection limits and complex querying capabilities
    by /u/izner82 (Database) on April 18, 2024 at 1:59 pm

    I'm seeking advice on the most suitable database solution for a matchmaking feature within my application. I've tried different solutions before but have always hit a roadblock before I can finish my stuff. I need a database that has: Complex querying capabilities (e.g. check if array field contains any or all items in the array provided) Has high connection limits Cheap Note that data are short lived, if a user enters the matchmaking screen...the backend would register them in the database, once a match has been found both user shall be deleted in the table. Row level locking is also needed as to make sure that the user we're querying for is untouchable by different concurrent users. Storage size isn't actually that important since data are short lived anyways, and we're only expecting <100k rows at most. Here are the issues I have faced before: I have used DynamoDB but because of its querying limitations like not having the ability to check if an array field contains an array I have decided to steer away from it As for querying, PostgreSQL seems to be the best, first...it can lock rows which is good for a highly concurrent environment such as matchmaking and it has the querying capabilities I just need. The only problem with it is that most managed services I can find has very limited connection limits, for a matchmaking feature I'm expecting tons of users connecting, querying each other simultaneously. As for GameLift FlexMatch, it's expensive as hell...you get billed $1 per matchmaking hour, imagine a user not being able to find a match for 30 seconds, now imagine thousands of them experiencing the same thing. I think this occurrence would be common on my matchmaking feature since it would be used for a dating app in which male users are dominant than female users. submitted by /u/izner82 [link] [comments]

  • Help for choosing a mysql course
    by /u/Minute_Courage_6664 (Database) on April 18, 2024 at 10:56 am

    Hi i would like to ask in your opinions what is the best course that goes from the basics to the advanced concepts in mysql. I don't care if it is free or paid or what platform it is I just want the best so I could do good in my job so I don't get fired. submitted by /u/Minute_Courage_6664 [link] [comments]

  • Do any of these databases (MySQL, MariaDB?) have a decent GUI that people can use as opposed to having to do things via the console? I want to have an actual interface do navigate things from or see what is in the database..not just do things via the console?
    by /u/savant78 (Database) on April 17, 2024 at 10:34 pm

    databases that actually have a decent GUI as opposed to just doing things via the console? submitted by /u/savant78 [link] [comments]

  • Maintain order of list items in DB
    by /u/Taka-tak (Database) on April 17, 2024 at 2:05 pm

    In my React.js application I have a list of todos like this and their order can be changed Todo 1 Todo 2 Todo 3 Let's say I move the Todo 3 to top, Now the list becomes Todo 3 Todo 1 Todo 2 I want to persist the order in DB. How can I achieve this? I am using MySQL submitted by /u/Taka-tak [link] [comments]

  • Free Virtual Distributed SQL Event - April 24th
    by /u/Yugabeing1 (Database) on April 17, 2024 at 11:53 am

    If you're interested in distributed databases there is a free virtual event next week. r/YugabyteDB's Distributed SQL Summit (DSS) Asia (April 24th) is aimed at people interested in adopting a modern data ecosystem and simplifying their database modernization. You can find out more and register here➡️https://events.ringcentral.com/canvas/events/distributed-sql-summit-asia-2024/registration submitted by /u/Yugabeing1 [link] [comments]

  • Help - Best book to learn about using databases in Academic research
    by /u/LoganDeya (Database) on April 17, 2024 at 6:30 am

    Hello. I am a complete beginner and know very little about databases, but I would like to read about it and learn. I have done some internet research on books and manuals for beginners, and titles like "Designing data intensive applications", "Database internals" and "Mysql crash course" have come up. However, by reading the book description, they all seem to be business-oriented. While my interest in databases is purely to learn how to store data in a way that makes it easy to compare information (I suppose then I should learn about SPQL?), for academic research. Any recommendations or advice? submitted by /u/LoganDeya [link] [comments]

  • Choice of multi tenant database architecture for Saas inventory management app ?
    by /u/Prestigious_Ebb5260 (Database) on April 17, 2024 at 1:55 am

    I am building an inventory management SaaS for mobile and web. I’ll be managing with a single web server. But for db, I am stuck between if I should go for Approach 1: A Database per organisation Vs Approach 2: One database shared between all organisations where each record in every table is identified by an organisation id My analysis so far is, Approach 1: - data isolated completely (peace of mind) - customer with low data will not be affected by an adjacent high data customer - moving the db around to different server can get easy - though not an intention, can convert to a custom solution at later point have no idea about scalability- is it difficult? managing backups could be difficult? Approach 2: - data isolation created with row level security of Postgres (less peace of mind though an unrealistic fear at times) - performance issues due to mixing up of high and low usage customers - easy maintenance - easy scalable ? - managing backups is easy What else am I missing ? Please do suggest me a choice about it ? submitted by /u/Prestigious_Ebb5260 [link] [comments]

  • Looking for general guidance on data separation and what you use when it comes to your apps (Dapper, EF, other)
    by /u/80sPimpNinja (Database) on April 16, 2024 at 8:51 pm

    I am building an app in Maui and was going to use SQLite as the database. I want to be able to also expand this app to ASP.net and possibly a Windows application at a later date. I want to use SQLite as the database and want to keep it as independent as I can from the main application. So down the road I can add in a different DB if I need to . I was reading the Maui docs and they suggest using the sqlite-net-pcl nuget package as the ORM, possibly because it is tailored for mobile apps? But the problem I see with this is I wouldn't be able to use this ORM for ASP.net or another framework that isn't mobile focused. So would I be better off using Dapper? or EF? for the sake of expansion and the ease of having it work on all frameworks? Or is there a way I can use sqlite-net-pcl with all frameworks? I have used Dapper before but never tried EF. Wasn't sure if one of these options would be a better solution. Thank you for the guidance! submitted by /u/80sPimpNinja [link] [comments]

  • Help in transforming this into 2NF
    by /u/KaizenCyrus (Database) on April 16, 2024 at 9:23 am

    submitted by /u/KaizenCyrus [link] [comments]

  • A student trying to learn Entity Relationship Diagrams, please help
    by /u/9342134o_C (Database) on April 16, 2024 at 4:21 am

    So I was assigned to make a payroll management system, and my first task was to create an ERD out of it. i would just like to know if what I'm doing is right? Or am I missing some entities or attributes? It's just a simple payroll management system. Any help would be appreciated thanks ! https://preview.redd.it/drp4kewzpruc1.png?width=1212&format=png&auto=webp&s=0e504f6bcd6ca424e48d5ed2aa7c9fe4f974f6d7 submitted by /u/9342134o_C [link] [comments]

  • Entity Relationship Diagram - html navigation
    by /u/Genuine-User (Database) on April 15, 2024 at 5:17 pm

    I was looking for a way to create an ERD that can also get generated into html structure that can be navigated. I saw what Dataedo can do, which looks really amazing. But their pricing seems very high, and I don't see that I can purchase just the ER diagram tool. Are there any similar tools/vendors that can do something like what Dataedo does? What is important is that I can edit the description of tables/columns/objects (etc) in the XML files and then maybe use a tool to generate the HTML that can be served locally or thrown into a web app in Azure or something. submitted by /u/Genuine-User [link] [comments]

  • Building a weather data warehouse part I: Loading a trillion rows of weather data into TimescaleDB
    by /u/DeadDolphinResearch (Database) on April 15, 2024 at 5:04 pm

    submitted by /u/DeadDolphinResearch [link] [comments]

  • Database beginner
    by /u/Exotic_Ad4675 (Database) on April 15, 2024 at 2:35 pm

    I am building a world database of schools for an awareness project at work. All the information is public, but I have to find it separately in each of the schools websites, which given its an international database, will take me ages. ​ Is there a shortcut? ​ Thanks! submitted by /u/Exotic_Ad4675 [link] [comments]

  • Looking for a team of people to do our database and create app
    by /u/captaingirl2 (Database) on April 15, 2024 at 1:35 pm

    Hello, Not sure if I am in the correct sub. However, I am looking for a person to set up a database and an app for a website. We're trying to cut cost within reason and preferably looking for people based in Australia, New Zealand. We're trying to avoid currency costs exchange so preferably outside of USA and Western Europe but I will consider all responses. If you need more information just let me know or dm me a message. submitted by /u/captaingirl2 [link] [comments]

  • Deadlock prevention with upgradable keys
    by /u/Volume999 (Database) on April 15, 2024 at 12:25 pm

    Hello! I am building a database system and want to add Deadlock prevention (Wait-die), but have some questions regarding consistency and aborts. Let's say I have T1 and T2, S(X) - read lock, U(X) - update lock, W(X) - write lock: T1: R(X) W(X) T2: R(X) W(X) Both transactions will receive an S(X) lock and then will try to upgrade to W(X). This, of course, leads to deadlock (sad for deadlock prevention mechanism) My question: How do I deal with this? Transactions release R(X) and try to get W(X) - Consistency violation I thought about adding a U(X) lock that is exclusive to U(X) and W(X) but is not limiting S(X). So T1 will receive U(X) and will be able to upgrade to W(X). The problem is what to do with T2? I cannot let it wait for T1 to finish, because then the consistency is violated. Should I then abort and restart T2 instead? Another issue is, how to understand which type of lock to receive - provided I can't infer from the API the access pattern (kind of like how updates use U(X) lock in SQL databases) I haven't been able to find an answer online on this matter, but if anyone knows some - would also be appreciated! submitted by /u/Volume999 [link] [comments]

  • If your database is a MariaDB database, when you put it up on the server, is it just a .mariadb file, or how exactly does that work? I have been reading up on how a person queries one with JavaScript/Python, and, I think wikipedia actually use MariaDB..so, it seemed good as a database?
    by /u/savant78 (Database) on April 15, 2024 at 10:27 am

    database that is a MariaDB database? submitted by /u/savant78 [link] [comments]

  • How to make your DB fast by using Caching
    by /u/totally_random_man (Database) on April 15, 2024 at 10:25 am

    I made this video (https://www.youtube.com/watch?v=_JGgGR3Rp60) a while back about different caching strategies. In it, I explain: Side Cache Read-Through Cache Write-Through Cache Write-Behind Cache Write-Around Cache. Having a good handle on these has been very important for us at Superthread as one of our key differentiators is speed at scale. btw. Superthread is an all-in-one project management software and wiki for small teams. I hope that some of you find it useful & interesting. submitted by /u/totally_random_man [link] [comments]

  • Great Youtube channel for learning about databases
    by /u/EkkosFatNuts (Database) on April 14, 2024 at 3:12 pm

    Heyo, I stumbled upon this youtuber that seems to be a lecturer at an university putting all of his material online. It's compact and divided into seperate 3-20 min videos, and handles a ton of database stuff. If you're stuck w/ something or need some extra info, you might find it on there. Just here to drop this off for a future google-searcher 😉 The channel is called Theoretical Computer Science, @ TheComputerScience, has about 2k subs. submitted by /u/EkkosFatNuts [link] [comments]

  • I was looking at using database MariaDB, but, if a person wants to query MariaDB from an html page, do they have to have a python file or something as an intermediate that receives the POST or GET request and then that queries MariaDB, or does the html query MariaDB directly?
    by /u/savant78 (Database) on April 14, 2024 at 11:12 am

    when using a database, such as MariaDB on a server, is the database queried directly by the html that teh client uses, or, does the client query data in the database by sending a POST or GET to for ex an intermediate fle, such as a python file, and then that python file queries the database and then returns the data to the client? submitted by /u/savant78 [link] [comments]

  • Whats the best laptop(2024)
    by /u/rohit_1824 (Database) on April 14, 2024 at 8:18 am

    I'm looking for a laptop to install Linux Oracle on it. I also have a Macbook but it does have some serious compatibility issues with Oracle and I'm pursuing the database so install some other database-related software too. So please suggest to me some laptops that are decent to run Oracle or tell me the specs I tried to find offline market submitted by /u/rohit_1824 [link] [comments]

Budget to start a web app built on the MEAN stack

AI Dashboard is available on the Web, Apple, Google, and Microsoft, PRO version

I want to start a web app built on the MEAN stack (mongoDB, express.js, angular, and node.js). How much would it cost me to host this site? What resources are there for hosting websites built on the MEAN stack?

I went through the same questions and concerns and I actually tried a couple of different cloud providers for similar environments and machines.

Web Apps Feed

  1. At Digital Ocean, you can get a fully loaded machine to develop and host at $5 per month (512 MB RAM, 20 GB disk ). You can even get a $10 credit by using this link of mine.[1] It is very easy to sign up and start. Just don’t use their web console to connect to your host. It is slow. I recommend using ssh client to connect and it is very fast.
  2. GoDaddy will charge you around 8$ per month for a similar MEAN stack host (512 MB RAM, 1 core processor, 20 Gb disk ) for your MEAN Stack development.
  3. Azure use bitmani’s mean stack on minimum DS1_V2 machine (1core, 3.5 gB RAM) and your average cost will be $52 per month if you never shut down the machine. The set up is a little bit more complicated that Digital Ocean, but very doable. I also recommend ssh to connect to the server and develop.
  4. AWS also offers Bitmani’s MEAN stack on EC2 instances similar to Azure DS1V2 described above and it is around $55 per month.
  5. Other suggestions

All those solutions will work fine and it all depends on your budget. If you are cheap like me and don’t have a big budget, go with Digital Ocean and start with $10 off with this code.

Basic Gotcha Linux Questions for IT DevOps and SysAdmin Interviews

AI Dashboard is available on the Web, Apple, Google, and Microsoft, PRO version

Some IT DevOps, SysAdmin, Developer positions require the knowledge of basic linux Operating System. Most of the time, we know the answer but forget them when we don’t practice very often. This refresher will help you prepare for the linux portion of your IT interview by answering some gotcha Linux Questions for IT DevOps and SysAdmin Interviews.

Get a $10 credit to have your own linux server for your MEAN STACK development and more. It is only $5 per month for a fully loaded Ubuntu machine.

Latest Linux Feeds

I- Networking:

  1. How many bytes are there in a MAC address?
    48.
    MAC, Media Access Control, address is a globally unique identifier assigned to network devices, and therefore it is often referred to as hardware or physical address. MAC addresses are 6-byte (48-bits) in length, and are written in MM:MM:MM:SS:SS:SS format.
  2. What are the different parts of a TCP packet?
    The term TCP packet appears in both informal and formal usage, whereas in more precise terminology segment refers to the TCP protocol data unit (PDU), datagram to the IP PDU, and frame to the data link layer PDU: … A TCP segment consists of a segment header and a data section.
  3. Networking: Which command is used to initialize an interface, assign IP address, etc.
    ifconfig (interface configuration). The equivalent command for Dos is ipconfig.
    Other useful networking commands are: Ping, traceroute, netstat, dig, nslookup, route, lsof
  4. What’s the difference between TCP and UDP; Between DNS TCP and UDP?
    There are two types of Internet Protocol (IP) traffic. They are TCP or Transmission Control Protocol and UDP or User Datagram Protocol. TCP is connection oriented – once a connection is established, data can be sent bidirectional. UDP is a simpler, connectionless Internet protocol.
    The reality is that DNS queries can also use TCP port 53 if UDP port 53 is not accepted.
    DNS uses TCP for Zone Transfer over port :53.
    DNS uses UDP for DNS Queries over port :53.

  5. What are defaults ports used by http, telnet, ftp, smtp, dns, , snmp, squid?
    All those services are part of the Application level of the TCP/IP protocol.
    http => 80
    telnet => 23
    ftp => 20 (data transfer), 21 (Connection established)
    smtp => 25
    dns => 53
    snmp => 161
    dhcp => 67 (server), 68 (Client)
    ssh => 22
    squid => 3128
  6. How many host available in a subnet (Class B and C Networks)
  7. How DNS works?
    When you enter a URL into your Web browser, your DNS server uses its resources to resolve the name into the IP address for the appropriate Web server.
  8. What is the difference between class A, class B and class C IP addresses?
    Class A Network (/ 8 Prefixes)
    This network is 8-bit network prefix. IP address range from 0.0.0.0 to 127.255.255.255
    Class B Networks (/16 Prefixes)
    This network is 16-bit network prefix. IP address range from 128.0.0.0 to 191.255.255.255Class C Networks (/24 Prefixes)
    This network is 24-bit network prefix.IP address range from 192.0.0.0 to 223.255.255.255
  9. Difference between ospf and bgp?
    The first reason is that BGP is more scalable than OSPF. , and this, normal igp like ospf cannot perform. Generally speaking OSPF and BGP are routing protocols for two different things. OSPF is an IGP (Interior Gateway Protocol) and is used internally within a companies network to provide routing.

II- Operating System
1&1 Web Hosting

Get 20% off Google Google Workspace (Google Meet) Standard Plan with  the following codes: 96DRHDRA9J7GTN6
Get 20% off Google Workspace (Google Meet)  Business Plan (AMERICAS) with  the following codes:  C37HCAQRVR7JTFK Get 20% off Google Workspace (Google Meet) Business Plan (AMERICAS): M9HNXHX3WC9H7YE (Email us for more codes)

Active Anti-Aging Eye Gel, Reduces Dark Circles, Puffy Eyes, Crow's Feet and Fine Lines & Wrinkles, Packed with Hyaluronic Acid & Age Defying Botanicals

  1. How to find the Operating System version?
    $uname -a
    To check the distribution for redhat for example: $cat /etc/redhat –release
  2. How to list all the process running?
    top
    To list java processes, ps -ef | grep java
    To list processes on a specific port:
    netstat -aon | findstr :port_number
    lsof -i:80
  3. How to check disk space?
    df shows the amount of disk space used and available.
    du displays the amount of disk used by the specified files and for each subdirectories.
    To drill down and find out which file is filling up a drive: du -ks /drive_name/* | sort -nr | head
  4. How to check memory usage?
    free or cat /proc/meminfo
  5. What is the load average?
    It is the average sum of the number of process waiting in the queue and the number of process currently executing over the period of 1, 5 and 15 minutes. Use top to find the load average.
  6. What is a load balancer?
    A load balancer is a device that acts as a reverse proxy and distributes network or application traffic across a number of servers. Load balancers are used to increase capacity (concurrent users) and reliability of applications.
  7. What is the Linux Kernel?
    The Linux Kernel is a low-level systems software whose main role is to manage hardware resources for the user. It is also used to provide an interface for user-level interaction.
  8. What is the default kill signal?
    There are many different signals that can be sent (see signal for a full list), although the signals in which users are generally most interested are SIGTERM (“terminate”) and SIGKILL (“kill”). The default signal sent is SIGTERM.
    kill 1234
    kill -s TERM 1234
    kill -TERM 1234
    kill -15 1234
  9. Describe Linux boot process
    BIOS => MBR => GRUB => KERNEL => INIT => RUN LEVEL
    As power comes up, the BIOS (Basic Input/Output System) is given control and executes MBR (Master Boot Record). The MBR executes GRUB (Grand Unified Boot Loader). GRUB executes Kernel. Kernel executes /sbin/init. Init executes run level programs. Run level programs are executed from /etc/rc.d/rc*.d
    Mac OS X Boot Process:

    Boot ROMFirmware. Part of Hardware system
    BootROM firmware is activated
    POSTPower-On Self Test
    initializes some hardware interfaces and verifies that sufficient memory is available and in a good state.
    EFI Extensible Firmware Interface
    EFI does basic hardware initialization and selects which operating system to use.
    BOOTX boot.efi boot loader
    load the kernel environment
    Rooting/Kernel The init routine of the kernel is executed
    boot loader starts the kernel’s initialization procedure
    Various Mach/BSD data structures are initialized by the kernel.
    The I/O Kit is initialized.
    The kernel starts /sbin/mach_init
    Run Level mach_init starts /sbin/init
    init determines the runlevel, and runs /etc/rc.boot, which sets up the machine enough to run single-user.
    rc.boot figures out the type of boot (Multi-User, Safe, CD-ROM, Network etc.)
  10. List services enabled at a particular run level
    chkconfig –list | grep 5:0n
    Enable|Disable a service at a specific run level: chkconfig on|off –level 5
  11. How do you stop a bash fork bomb?
    Create a fork bomb by editing limits.conf:
    root hard nproc 512
    Drop a fork bomb as below:
    :(){ :|:& };:
    Assuming you have access to shell:
    kill -STOP
    killall -STOP -u user1
    killall -KILL -u user1
  12. What is a fork?
    fork is an operation whereby a process creates a copy of itself. It is usually a system call, implemented in the kernel. Fork is the primary (and historically, only) method of process creation on Unix-like operating systems.
  13. What is the D state?
    D state code means that process is in uninterruptible sleep, and that may mean different things but it is usually I/O.

III- File System

  1. What is umask?
    umask is “User File Creation Mask”, which determines the settings of a mask that controls which file permissions are set for files and directories when they are created.
  2. What is the role of the swap space?
    A swap space is a certain amount of space used by Linux to temporarily hold some programs that are running concurrently. This happens when RAM does not have enough memory to hold all programs that are executing.
  • What is the role of the swap space?
    A swap space is a certain amount of space used by Linux to temporarily hold some programs that are running concurrently. This happens when RAM does not have enough memory to hold all programs that are executing.
  • What is the null device in Linux?
    The null device is typically used for disposing of unwanted output streams of a process, or as a convenient empty file for input streams. This is usually done by redirection. The /dev/null device is a special file, not a directory, so one cannot move a whole file or directory into it with the Unix mv command.You might receive the “Bad file descriptor” error message if /dev/null has been deleted or overwritten. You can infer this cause when file system is reported as read-only at the time of booting through error messages, such as“/dev/null: Read-only filesystem” and “dup2: bad file descriptor”.
    In Unix and related computer operating systems, a file descriptor (FD, less frequently fildes) is an abstract indicator (handle) used to access a file or other input/output resource, such as a pipe or network socket.
  • What is a inode?
    The inode is a data structure in a Unix-style file system that describes a filesystem object such as a file or a directory. Each inode stores the attributes and disk block location(s) of the object’s data.

IV- Databases

  1. What is the difference between a document store and a relational database?
    In a relational database system you must define a schema before adding records to a database. The schema is the structure described in a formal language supported by the database and provides a blueprint for the tables in a database and the relationships between tables of data. Within a table, you need to define constraints in terms of rows and named columns as well as the type of data that can be stored in each column.In contrast, a document-oriented database contains documents, which are records that describe the data in the document, as well as the actual data. Documents can be as complex as you choose; you can use nested data to provide additional sub-categories of information about your object. You can also use one or more document to represent a real-world object.
  2. How to optimise a slow DB?
    • Rewrite the queries
    • Change indexing strategy
    • Change schema
    • Use an external cache
    • Server tuning and beyond
  3. How would you build a 1 Petabyte storage with commodity hardware?
    Using JBODs with large capacity disks with Linux in a distributed storage system stacking nodes until 1PB is reached.
    JBOD (which stands for “just a bunch of disks”) generally refers to a collection of hard disks that have not been configured to act as a redundant array of independent disks (RAID) array.
    JBOD

V- Scripting


AI Unraveled: Demystifying Frequently Asked Questions on Artificial Intelligence (OpenAI, ChatGPT, Google Bard, Generative AI, Discriminative AI, xAI, LLMs, GPUs, Machine Learning, NLP, Promp Engineering)
  1. What is @INC in Perl?
    The @INC Array. @INC is a special Perl variable that is the equivalent to the shell’s PATH variable. Whereas PATH contains a list of directories to search for executables, @INC contains a list of directories from which Perl modules and libraries can be loaded.
  2. Strings comparison – operator – for loop – if statement
  3. Sort access log file by http Response Codes
    Via Shell using linux commands
    cat sample_log.log | cut -d ‘”‘ -f3 | cut -d ‘ ‘ -f2 | sort | uniq -c | sort -rn
  4. Sort access log file by http Response Codes Using awk
    awk ‘{print $9}’ sample_log.log | sort | uniq -c | sort -rn
  5. Find broken links from access log file
    awk ‘($9 ~ /404/)’ sample_log.log | awk ‘{print $7}’ sample_log.log | sort | uniq -c | sort -rn
  6. Most requested page:
    awk -F\” ‘{print $2}’ sample_log.log | awk ‘{print $2}’ | sort | uniq -c | sort -r
  7. Count all occurrences of a word in a file
    grep -o “user” sample_log.log | wc -w

Learn more at http://career.guru99.com/top-50-linux-interview-questions/

Real Time Linux Jobs

If you are looking for an all-in-one solution to help you prepare for the AWS Cloud Practitioner Certification Exam, look no further than this AWS Cloud Practitioner CCP CLF-C02 book

Install and run your first noSQL MongoDB on Mac OSX

Amazon SQL vs NoSQL

AI Dashboard is available on the Web, Apple, Google, and Microsoft, PRO version

Install and run your first noSQL MongoDB on Mac OSX

Classified as a NoSQL database, MongoDB is an open source, document-oriented database designed with both scalability and developer agility in mind. Instead of storing your data in tables and rows as you would with a relational database, in MongoDB you store JSON-like documents with dynamic schemas; This makes the integration of data in certain types of application easier and faster.
Why?
MongoDB can help you make a difference to the business. Tens of thousands of organizations, from startups to the largest companies and government agencies, choose MongoDB because it lets them build applications that weren’t possible before. With MongoDB, these organizations move faster than they could with relational databases at one tenth of the cost. With MongoDB, you can do things you could never do before.

    1. Install Homebrew
      $ /usr/bin/ruby -e “$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)”
      Homebrew installs the stuff you need that Apple didn’t.
      $ brew install wget
    2. Install MongoDB
      $ brew install mongodb
    3. Run MongoDB
      Create the data directory: $ mkdir -p /data/db
      Set permissions for the data directory:$ chown -R you:yourgroup /data/db then chmod -R 775 /data/db
      Run MongoDB (as non root): $ mongod
    4. Begin using MongoDB.(MongoDB will be running as soon as you ran mongod above)Open another terminal and run: mongo

Install and run your first noSQL MongoDB on Mac OSX

References: https://docs.mongodb.com/manual/tutorial/install-mongodb-on-os-x/


Pass the 2023 AWS Cloud Practitioner CCP CLF-C02 Certification with flying colors Ace the 2023 AWS Solutions Architect Associate SAA-C03 Exam with Confidence Pass the 2023 AWS Certified Machine Learning Specialty MLS-C01 Exam with Flying Colors

List of Freely available programming books - What is the single most influential book every Programmers should read



#BlackOwned #BlackEntrepreneurs #BlackBuniness #AWSCertified #AWSCloudPractitioner #AWSCertification #AWSCLFC02 #CloudComputing #AWSStudyGuide #AWSTraining #AWSCareer #AWSExamPrep #AWSCommunity #AWSEducation #AWSBasics #AWSCertified #AWSMachineLearning #AWSCertification #AWSSpecialty #MachineLearning #AWSStudyGuide #CloudComputing #DataScience #AWSCertified #AWSSolutionsArchitect #AWSArchitectAssociate #AWSCertification #AWSStudyGuide #CloudComputing #AWSArchitecture #AWSTraining #AWSCareer #AWSExamPrep #AWSCommunity #AWSEducation #AzureFundamentals #AZ900 #MicrosoftAzure #ITCertification #CertificationPrep #StudyMaterials #TechLearning #MicrosoftCertified #AzureCertification #TechBooks

Top 1000 Canada Quiz and trivia: CANADA CITIZENSHIP TEST- HISTORY - GEOGRAPHY - GOVERNMENT- CULTURE - PEOPLE - LANGUAGES - TRAVEL - WILDLIFE - HOCKEY - TOURISM - SCENERIES - ARTS - DATA VISUALIZATION
zCanadian Quiz and Trivia, Canadian History, Citizenship Test, Geography, Wildlife, Secenries, Banff, Tourism

Top 1000 Africa Quiz and trivia: HISTORY - GEOGRAPHY - WILDLIFE - CULTURE - PEOPLE - LANGUAGES - TRAVEL - TOURISM - SCENERIES - ARTS - DATA VISUALIZATION
Africa Quiz, Africa Trivia, Quiz, African History, Geography, Wildlife, Culture

Exploring the Pros and Cons of Visiting All Provinces and Territories in Canada.
Exploring the Pros and Cons of Visiting All Provinces and Territories in Canada

Exploring the Advantages and Disadvantages of Visiting All 50 States in the USA
Exploring the Advantages and Disadvantages of Visiting All 50 States in the USA


Health Health, a science-based community to discuss health news and the coronavirus (COVID-19) pandemic

Today I Learned (TIL) You learn something new every day; what did you learn today? Submit interesting and specific facts about something that you just found out here.

Reddit Science This community is a place to share and discuss new scientific research. Read about the latest advances in astronomy, biology, medicine, physics, social science, and more. Find and submit new publications and popular science coverage of current research.

Reddit Sports Sports News and Highlights from the NFL, NBA, NHL, MLB, MLS, and leagues around the world.

Turn your dream into reality with Google Workspace: It’s free for the first 14 days.
Get 20% off Google Google Workspace (Google Meet) Standard Plan with  the following codes:
Get 20% off Google Google Workspace (Google Meet) Standard Plan with  the following codes: 96DRHDRA9J7GTN6 96DRHDRA9J7GTN6
63F733CLLY7R7MM
63F7D7CPD9XXUVT
63FLKQHWV3AEEE6
63JGLWWK36CP7WM
63KKR9EULQRR7VE
63KNY4N7VHCUA9R
63LDXXFYU6VXDG9
63MGNRCKXURAYWC
63NGNDVVXJP4N99
63P4G3ELRPADKQU
With Google Workspace, Get custom email @yourcompany, Work from anywhere; Easily scale up or down
Google gives you the tools you need to run your business like a pro. Set up custom email, share files securely online, video chat from any device, and more.
Google Workspace provides a platform, a common ground, for all our internal teams and operations to collaboratively support our primary business goal, which is to deliver quality information to our readers quickly.
Get 20% off Google Workspace (Google Meet) Business Plan (AMERICAS): M9HNXHX3WC9H7YE
C37HCAQRVR7JTFK
C3AE76E7WATCTL9
C3C3RGUF9VW6LXE
C3D9LD4L736CALC
C3EQXV674DQ6PXP
C3G9M3JEHXM3XC7
C3GGR3H4TRHUD7L
C3LVUVC3LHKUEQK
C3PVGM4CHHPMWLE
C3QHQ763LWGTW4C
Even if you’re small, you want people to see you as a professional business. If you’re still growing, you need the building blocks to get you where you want to be. I’ve learned so much about business through Google Workspace—I can’t imagine working without it.
(Email us for more codes)

error: Content is protected !!