Create Multi-Column Index in SQLAlchemy

Defining Multi-Column Indexes Using ORM Declarative Mapping

from sqlalchemy import create_engine, Column, Integer, String, Index
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker

engine = create_engine('postgresql://username:password@localhost/mydatabase')
Base = declarative_base()

class Employee(Base):
    __tablename__ = 'employees'
    id = Column(Integer, primary_key=True)
    last_name = Column(String)
    first_name = Column(String)
    department_id = Column(Integer)

    __table_args__ = (
        Index('idx_employees_last_first', 'last_name', 'first_name'),
    )

Base.metadata.create_all(engine)

Creating Indexes After Table Definition

from sqlalchemy import create_engine, MetaData, Table, Index

engine = create_engine('postgresql://username:password@localhost/mydatabase')
metadata = MetaData(bind=engine)

# Reflect the existing table
employees = Table('employees', metadata, autoload_with=engine)

# Create the index
index = Index('idx_employees_last_first', employees.c.last_name, employees.c.first_name)
index.create(engine)

References
https://stackoverflow.com/questions/14419299/adding-indexes-to-sqlalchemy-models-after-table-creation

Install Realm Object Server on Ubuntu 16.04

// Ubuntu 16.04 (64 bit; 32-bit is not supported)
//It is recommended that you install the server as a normal user.

sudo apt-get update

sudo apt-get install build-essential libssl-dev

sudo apt-get install python

curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.4/install.sh | bash

// Force current session to know changes or logout and log back in
source ~/.profile

nvm install --lts

npm install -g node-gyp
npm install -g realm-object-server

References
https://docs.realm.io/server/installation/manual-install

Installing Apache Cassandra on Ubuntu

echo "deb http://www.apache.org/dist/cassandra/debian 39x main" | sudo tee -a /etc/apt/sources.list.d/cassandra.sources.list
curl https://www.apache.org/dist/cassandra/KEYS | sudo apt-key add -
sudo apt-get update
sudo apt-key adv --keyserver pool.sks-keyservers.net --recv-key A278B781FE4B2BDA
sudo apt-get install cassandra
sudo service cassandra start
sudo service cassandra stop

References
http://cassandra.apache.org/download/

Install MongoDB as Windows Service

mkdir c:\data\db
mkdir c:\data\log

create a file at C:\mongodb\mongod.cfg

systemLog:
    destination: file
    path: c:\data\log\mongod.log
storage:
    dbPath: c:\data\db

Install the MongoDB service

"C:\mongodb\bin\mongod.exe" --config "C:\mongodb\mongod.cfg" --install

Start the MongoDB service

net start MongoDB

Stop or remove the MongoDB service as needed

net stop MongoDB
"C:\mongodb\bin\mongod.exe" --remove

References :
https://docs.mongodb.org/manual/tutorial/install-mongodb-on-windows/