Showing posts with label database. Show all posts
Showing posts with label database. Show all posts

Monday, August 12, 2024

To Mock a Cloud

Cloud hosting has been the norm for a while now. Saas, Paas, Iaas, serverless, AI whatever the form may be, organizations (org) need to have a digital presence on the cloud. 

Cloud vendors offer hundreds of features and services such as 24x7 availability, fail-safe, load-balanced, auto-scaling, disaster resilient distributed, edge-compute, AI/ Ml clusters, LLMs, Search, Database, Datawarehouses among many others right off-the-shelf. They additionally provide a pay-as-you-go model only for the services being used. Essentially everything that any org could ask for today & in the future!

But it's not all rosy. The cloud bill (even though pay-as-you-go) does burn a hole in the pockets. While expenses for the live production (prod) environment is necessary, costs for the other dev, test, etc, internal environments could be largely reduced by replacing the real Cloud with a Mock Cloud. This would additionally, speed up dev and deployment times and make bug fixes and devops much quicker & streamlined.

As dev's know mocks, emulators, etc are only as good as their implementation - how true they are to the real thing. It's a pain to find new/ unknown bugs on the prod only because it's an env very different from dev/ test. Which dev worth his weight in salt (or gold!) hasn't seen this ever?

While using containers to mock up cloud services was the traditional way of doing it, a couple of recent initiatives like Localstack, Moto, etc seem promising. Though AWS focussed for now, support for others are likely soon. Various AWS services like s3, sns, sqs, ses, lambda, etc are already supported at different levels of maturity. So go explore mocks for cloud & happy coding!

Saturday, November 11, 2023

Starting off with Databases

A note shared with a friend on getting started with DB on a Windows env. Putting it up for the larger audience.

1) Try MySql (or Postgre) DB Online via Browser:

• https://onecompiler.com/mysql/3zt5uh4dc
• https://www.w3schools.com/mysql/mysql_exercises.asp
• https://www.w3schools.com/mysql/exercise.asp
• https://www.mycompiler.io/online-mysql-editor
• https://www.mycompiler.io/new/mysql
• https://extendsclass.com/postgresql-online.html


2) Install MySql on Windows:

• https://dev.mysql.com/downloads/installer/


3) Run Windows Virtual Machine (VM) with a MS Sql DB installed in that VM:

3.1) Use either VMPlayer or VirtualBox as the virtualization software

VMWare Player: https://www.vmware.com/in/products/workstation-player.html
Oracle VirtualBox: https://www.virtualbox.org/wiki/Downloads


3.2) Download the corresponding VM:

• https://developer.microsoft.com/en-us/windows/downloads/virtual-machines/


3.3) Login to the VM & install MS Sql server in it

Hope it helps.

Thursday, August 1, 2013

Trees and Graphs

Useful things to know about the trees and graphs based data structures:

These:
  • Binary Trees Vs. Binary Search Trees
  • 2,4 and Red Black
  • AVL
  • Tries
  • Heaps
  • B & B+ Trees
& these:
  • BFS, DFS
  • Sorting - Quick, Merge, Radix, Timsort
  • Kruskal's & Prim's algorithm for Minimum Spanning Trees
  • Morris Traversal, without extra space or recursion, using Threaded Binary Trees
  • Djikstra's algorithm for shortest path
  • Topological sorting
That horses for courses is applicable:

The big-O deal:

With Java, well tested implementations are mostly available:
  • TreeSet
  • TreeMap
  • LinkedHashMap
  • ConcurrentSkipListMap
  • PriorityQueue