Development Flashcards
What is the software architecture of the app?
It is a layered architecture, having 2 tiers: the client and the server if we take Firebase as one entity. However, it can also constitute a multi-layered architecture if we think about the Firebase services that I used: Firebase Authentication, Firestore Database, and Firebase Storage as independent layers.
What is the data model used for the app?
Firestore Database is a No-SQL database where the data is organized in JSON-like documents.
I am using it because of
-the ease of application development,
-it is horizontally scalable(meaning it offers the possibility to scale using multiple machines rather than increasing the CPU and memory of a single machine),
-does not require any planning upfront
-it is flexible
-offers a GUI
What are other data models and why are not they used in this app?
Other data models can be relational, graph, or key-value. The most popular are relational databases which require upfront planning of tables with rows and columns, and the relationship between them. Also, it needs to be normalized to avoid redundancy. It supports Joins - combining data from multiple tables and it is ACID compliant - guarantees that it remains consistent and accurate.
key-value data models like Redis which runs in memory and is used for caching
graph data model - when the data is highly connected and there are many to many relationships
What does it mean to run in-memory?
This means that the data is not written on disk, but exists in the RAM memory (cached) of the server that runs the redis service - to temporarily store data - which means better and faster performance and retrieval.
Advantages and disadvantages of using BaaS?
The advantages of Firebase are: - quick development - cost-effectiveness - community - ease of integration and ease to use of the SDK - implement real-time features like comments The disadvantages of Firebase are: - not having the freedom to customize exactly as you need - platform dependent - not used for complicated queries - a limited set of security standards - not able to use your own database
What is JSX?
A syntax that makes it possible to write elements inside JavaScript. Similar to HTML syntax, but because it is JavaScript, variables can be written inside it, embedding them with curly brackets. Any JavaScript expression will work between curly braces, including function calls.
What are the different types of security concerns?
In web:
- XSS (Cross site scripting) - steal another user’s cookie
- CSRF (Cross site request forgery) - user tricked into interacting with a page or script on a third-party site and generates a malicious request
- File upload vulnerabilities
- SQL injection
In mobile / my app (where the application code is stored inside the device and it can collect more info about the user):
- Async storage
- Data validation
- Access control
What are Promises? How are await async used?
Used for long running tasks that won’t return the response right away, but rather return a Promise that will be solved at a later time.
Await is called inside a async function before a method call and the response will be used when the promised is settled without giving errors.
What is asynchronous communication?
It is a form of parallel programming that allows a unit of work to run separately from the primary application thread. When the work is completed, it notifies the primary application thread.
What is state in React Native?
A state is a snapshot of the app at any given moment in time. It refers to properties that will be changed and so need to be tracked thorought the application.
You can add state to a component by calling React’s useState Hook. A Hook is a kind of function that lets you “hook into” React features. For example, useState is a Hook that lets you add state to function components.
What is the difference between React Native and React.js?
React.js is a JavaScript library used for building a high performing UI, while React Native is an entire platform allowing to build native, cross platform mobile applications.
What are React custom components?
React custom components are independent pieces of functionality that can be reused thorought the code, written by us. Unlike the core components which are built in React: Text, View, TextInput, TouchableOpacity, Button. Each components can be customized with a prop.
What are props in React Native?
Props let you customize React components. This is handy if you are passing something other than a string as props, like an array or number: . However, JS objects are also denoted with curly braces: {width: 200, height: 200}. Therefore, to pass a JS object in JSX, you must wrap the object in another pair of curly braces: {{width: 200, height: 200}}
Why is const used to declare state?
The component re-renders when it is changed, so the variable remains immutable in the scope of the function.
What are atoms in React.js?
Atoms are units of state. They’re updatable and subscribable: when an atom is updated, each subscribed component is re-rendered with the new value. They can be created at runtime, too. Atoms can be used in place of React local component state. If the same atom is used from multiple components, all those components share their state.
Atoms are created using the atom function.
Atoms need a unique key, which is used for debugging, persistence, and for certain advanced APIs that let you see a map of all atoms. It is an error for two atoms to have the same key, so make sure they’re globally unique. Like React component state, they also have a default value.
To read and write an atom from a component, we use a hook called useRecoilState.