Database Flashcards
Sql vs no sql
SQL databases are relational, offer strong consistency, and are suitable for structured data with fixed schemas.
* like a excel sheet
NoSQL databases are non-relational, provide scalability and flexibility, and excel with unstructured data or when scalability is a priority.
* document base, like analytics, logging
to write sargable queries
Search ARGument ABLE queries: (allow db engine use its ability to search)
1- avoid using functinos on indexed columns in where
2- use direct comparisons instead of wrapping into function
3- try to use computed column or function-based index instated of wrapping column into a function
non-sargable
~~~
WHERE YEAR(order_date) >= 2023
~~~
sargable
~~~
WHERE order_date >= ‘2023-01-01’
~~~
what’s elastic db and why we need it
it’s a text/json db
- it writes data like a query (faster query)
- it’s distributed , horizantly scalable