What is an Index?
A Data structure that makes it faster to retrieve records from a database
Example:
Database of students, primary key is student ID which is sorted. Lets say you have names, and grades
If you want to query a student with a certain name, without indexing you’d have to look through every single row
if you index based on the student name, with that field sorted you can use a binary search which is much faster
What is a Compound Index?
A single index that references more than one field
What is a Correlated Query
A Nested Query,
so a query in a query, where the inner query uses values from the outer query
What happens when I submit a query to a database?
How would you go about troubleshooting a performance issue?
Start by looking at
Monitor any running applications to see if they are hogging resources
Is the issue consistent or intermittent?
You might need to log performance and try to replicate the issue to narrow it down to a specific piece of software or process
Linux –> Top or Htop, Vmstat
Windows –> Task Manager
What is TCP?
Transmission Control Protocol
What is UDP?
User Datagram Protocol
What is DNS
Domain Name System
–> Translates names into IP addresses,
Example: www.mongodb.com in a web browser, the DNS resolves this to the public IP of the website
What is DHCP?
Dynamic Host Configuration Protocol
Explain RAID
Raid 0, 1, 5 and 10
RAID –> Redundant array of disks, combines multiple disks into one cohesive unit
RAID 0 –> Data is written across multiple disks, so you utilize all the disks to write data making it faster
RAID 1 –> Data is copied across disks so you have redundancies
RAID 5 –> Faster than raid 1 but also has fault tolerance. Not sure about the details
RAID 10 –> uses twice as many disks, but if one fails you don’t have to read from all the disks to rebuild it, just mirrored one
What Utilities can you use in Linux to monitor performance?
Top or HTop –> display CPU usage, memory usage, swap memory, process PIDs and a bunch of other stuff
Lsof –> lists all open files, can help to figure out what files are in use
tcpdump –> lets you analyze network packets
netstat –> gives network statistics
Iostat –> if you install sysstat you can use it to show I/O storage statistics
How do you troubleshoot a connection issue between an application and a database server?
How does Swap Space work?
Used to free up RAM by using Disk Space
thats the extent of my understanding
How do you configure RAM and CPU in a docker?
I’m not super experienced using docker
–> I assume you can configure this using the CLI, unsure of the exact command
How do you split data across mongo servers?
“Shard” the collection of data
Why does Mongo/NoSQL scale better?
MongoDB stores data in non structured documents
Binary formatted JSON
Self contained documents, so they can be spread out across multiple nodes
What are C-Groups?
A container for processes where you can limit the resources that group of processes is allowed to use
What layers in the OSI model are Routers and Switches on?
Routers are on the network layer (3)
Switches are on the data link layer (2)
Routers work with IP addresses and have services like QoS, NAT
switches work with MAC addresses, don’t really offer many services
How can you optimize a slow database?
What is Memory Ballooning in a VM?
Memory Management Feature
–> Takes back unused memory that was allocated to other virtual machines
What is TLS / SSL?
Transport Layer Security / Secure Socket Layer
What is SSL
Secure Sockets Layer
–>
Using vmstat, what information is given about swap space?
What do you do if you get a “no valid OpenPGP data found” error?
Check that your public GPG key exists using
sudo apt-key list