Technical - Definitions
Dockerβ
What is Docker?
Docker is known as a software container platform. This may be difficult to understand at first, so let's break it down.
- "Containers", are set up so anyone on any device can run the container and not run into any cross-platform issues.
- "Containers" contain a whole app, meaning they hold every little thing that, that an app needs in order to run.
- At the basic level, it could hold a backend, frontend, and a database. But it also holds every dependency/library that those frontends or backends might need, same as the server configuration.
- Every little thing can be packaged into one container, which can be run w/ just 1 command. You can package every little thing into one container that can be run with one command. So you can share an entire development environment across any OS.
- "Images" : A Docker "image" is a file that contains instructions (that the container needs) to build a part of the app (i.e. database image)
- A docker container is filled with "images" of an app. For example, you would have an image for the database, which would hold the database & everything it needs to run.
- These images can be packaged together into a container.
APIβ
What is an API?
- An API is a software intermediary that allows two applications to talk to each other.
- Example: if I press the like button on a post on myspace, the app sends data to an API endpoint. Which will tell the myspace server and database that I have just liked the post.
- API's can also be used to request data from a server.
- Example: if I refresh my myspace feed, an API will send the data for each post to my phone so they can be displayed.
RESTful API
- Representational State Transfer - Bridge between Data resource & application interface.
- Provides a block of HTTP methods which are used to alter the data:
- GET : SELECT - reading & retriving data
- POST : INSERTing data
- PUT : UPDATEing data
- DELETE : DELETEing
- Why REST?
- Client Server: This constraint operates on the concept that the client and server should be seperate from each other and allowed to evolve individually.
- Stateless: calls can be made independently of one another, & each call contains all of the data necessary to complete itself sucessfully.
- Cache: Since a stateless API can increase request overhead by handling large loads of incoming & outbound calls, a REST API should be designed to encourage the storage of cacheable data.
- Uniform Interface: The key to the decoupling client from server is having a uniform interface that allows independent evolution of the application w/o having the applicationβs services, or models & actions, tightly coupled to the API layer itself
- Layered System: REST APIs have different layers of their architecture working together to build a hierarchy that helps create a more scalable and modular application.
- Code on Demand: Code on Demand allows for code or applets to be transmitted via the API for use within the application
Databaseβ
MongoDB
- MongoDB is a NoSQL database system that uses collections and documents to store data.
- Example: inside of the user's collection in my database (_id, name, city, email), I create a document for every user so that I can store their information.
- I have collections for every category of f document that I create.
- Example: Orders, Products, Vendors, etc.
- Not only fast, but can also easily perform advanced queries easily