System Design – Application like Twitter

Whenever we thing of designing a system we need to understand the requirement. We need to look at existing applications in market. Application cannot be created in one night. It needs proper planning on requirement, resource availability, time duration ,funds for the project etc.

Lets talk about twitter. What is twitter?

Twitter we can say is social networking site where people communicate with each other with short messages. We call these messages as tweet. These tweets can contain text, videos, photos or links. It allows people to share there thoughts with other people.

Functional requirement:

  • Tweet
  • Re-tweet
  • Follow
  • Search

Non-Functional requirement:

  • Heavy reading
  • Fast rendering
  • Always available
  • Fast tweet
  • Scalable (Number of users, Daily tweet, Monthly tweet etc.)
  • Low latency

Different type of users:

  • Well known people ( Celebrity, Player, Politicians etc.) They have huge followers
  • Active users
  • Passive users
  • Online users ( Available at that point)
  • Inactive/Deleted

Components that we can think off:

  • Different services like
    • User service to get sign up/login or get user details
    • Analytics service to do analysis
    • Graph service
    • User live (notification) service
  • Different databases
    • RDBMS/No SQL
    • In memory (Redis)
    • Cassendra or Hbase for images
    • CDN for distributing data
  • Search functionality
    • Elastic search
  • Load balancer
  • Kafka
    • Used to build real-time streaming data pipelines and real-time streaming applications

System should be designed such that it is loosely coupled. Initially  if team size is small, you can think of monolithic architecture but you need to keep in mind that later it will be decoupled.

 

Different type of databases

What are different type of databases?

1. Relational databases
-SQL language
-They are compliant with ACID

Examples – SQL Server, Oracle Database, MySQL, PostgreSQL

2. Cloud databases
-Database that’s designed to run in the cloud.
-cloud databases offer flexibility and scalability, along with high availability
Examples: Azure SQL Database, Amazon Relational Database

3. NoSQL databases
-Non-relational database
-To store unstructured or semi-structured data
-One advantage of NoSQL databases is that developers can make changes to the database on the fly, without affecting applications that are using the database
Examples: MongoDB,Apache Cassandra,CouchDB, and CouchBase

4. Key-value databases
-NoSQL databases
-Key-value databases are highly scalable and can handle high volumes of traffic
-Caching values

Examples: Amazon DynamoDB, Redis

5. Columnar databases
-store data in columns rather than rows
– it essentially ignores all of the data that doesn’t apply to the query, because you can retrieve the information from only the columns you want
-Ever increasing data

Examples: Google BigQuery, Cassandra, HBase, MariaDB

6. Document databases
-document stores, use JSON-like documents to model data instead of rows and columns
-Document databases are simple and scalable, making them useful for mobile apps that need fast iterations.

Examples: MongoDB, Amazon DocumentDB, Apache CouchDB

7.Time series databases (Application pushing matrix)
-database optimized for time-stamped, or time series, data

Examples: InfluxDB, Druid,Open TS DB

8. Data ware house/Offline reporting
When you have lot of information for analysis
Example : Hadoop (Amazon/Uber data)

9. Search relevant text
Elastic search (search engine)
Solr

10. Distributed database
Distribute images to different server across globe
Example : CDN

11.Blob storage
Storing video’s/images (amazon/Netflix)
Example Amazon S3

Trip to Manali, Shimla and Chandigarh (6 Days)




Trip to Manali, Shimla and Chandigarh (2022)

Every person has some or other dream in life. I also had few things in my mind for long time. They were doing paragliding and river rafting. I knew some places in Maharashtra were that was possible but that plan was never executed. Finally got opportunity to travel to Manali were I knew these activities were possible and top of it enjoy snow activities and pleasant weather in hot summer.

Places to visit in Manali:
1. Manu Temple
2. Hadimba Temple
3. Manali Sanctuary
4. Arjun Gufa
5. Jagatsukh
6. Solang Valley
7. Tibetan Monastery
8. Vashist Village
9. Nehru Kund
10. Rohtang Pass (For snow point)
11. Atal tunnel ( 9.02 KM)
12. Koksar (For snow point)
13. Manikaran
14. Naggar Castle
15. Waterfalls
16. Mall road for shopping and local food.

Places to visit in Shimla:

  1. Kufri
  2. Mall road
  3. Himalayan Nature Park
  4. Scandal Point
  5. Jhakoo Temple

Places to Visit in Chandigarh

  1. Rock garden (Must visit)
  2. Rose Garden
  3. Sukhana lake

 

Tips for Rohtang pass/snow point:

  1. Recommendation is to carry winter dress, shoes from Manali on rent. (250/- per person)
  2. No need to book any activity. Don’t buy socks from them even though they insist you
  3. Go to snow point and then decide.
  4. Carry socks, Sweater, Jacket, winter cap on your own.
  5. Rohtang pass is charged at 500/- for car. But driver will ask you anything between 3000 – 5000/- depending on Rush.

Tips for Kufri:

  1. For Horse ride they charge 500 per person. If we walk 100 mtrs towards top, charges will come down.
  2. Do not book any activity at start point. Go to top and see what you want to enjoy.
  3. Personally I did not like anything except zipline
  4. Children will enjoy telescope ride (but you need to bargain for cost)

Day 1: Pune to Chandigarh (2.5 hrs)

We had booked car from Chandigarh for complete trip. Driver came in time to pick up us and we started our journey at 6:30 AM toward the road to the beautiful hill station of Manali (2000 meters above sea level).

Located in the Beas River Valley, Manali is a very popular hill station visited by tourists from across the country. Manali can be reached from the national highway that leads to the Ladakh region.

Before Manali near Bhuntar we stopped for Paragliding and Water rafting around 2 PM. It was one of the best experience in life. For Paragliding they will take you to start point in their vehicle and you will dive from there along with guide. Then they will pick you and take you back. Same way for boat ride.

After that we reached hotel by 8:45 PM.

Day 2:

We were very fortunate on second day as we came to know Rohtang pass was opened for tourist. Rohtang pass is closed for 7-8 months and opened in May. It is place were you can enjoy snow and even snow fall sometimes(if very lucky). We planned to go there. Driver took the required pass as vehicles are not allowed without pass. While going we took snow dress and shoes on rent. We also booked some snow activities there but that was mistake as same can be done after reaching Rohtang snow point.

We enjoyed snow activities for 1.5 hrs and started our journy back around 12:30 PM. It takes around 2 -2.5 hrs to reach there from Manali.

While return we saw Nehru Kund, Vashist Temple, Van Vihar, Tibettian Monetary and Mall road.

Day 3:

We visited Hadimba temple and then went to see Naggar castle. There we also visited Nicholos Rorich art gallery. We returned to Hotel by 2 PM and took some rest. In evening went to Club house and menu temple.

Day 4:

We started our journey at 8:15 AM after breakfast towards Manikaran, the hottest Sulphur Spring Waters in the world. We visited Gurudwar and hot water spring. This religious site is visited by both Hindus and Sikhs in large numbers.

We started towards shimla around 11:30 AM. Set in beautiful hills, meandering streets and mystical
woods, Shimla treats honeymooners and families to captivating natural beauty. What also attracts tourists here is the chance to go trekking, mountaineering, skiing and other adventure activities.

Day 5:

We started towards Kufri around 8:30 AM. Kufri is hill station and weather is quite pleasant. There you need to ride on horse or you should have some trekking experience to reach to top. There you will see lot of activities like zip line, walking on ropes etcs. Also you can see apple garden, valley and village.

Day 6:

We started towards Chandigarh at 8:30 AM and reached by 11:30 AM. We visited  Sukhana lake, Rock garden and Rose garden. That was end of trip.

Driver dropped us to Airport and we came back to Pune by 11:30 PM.

Charges for Paragliding and Boat rafting: 

  1. Paragliding cost between 2000- 2500/- including video
  2. Boat river rafting cost between 2000-5000/-
  3. More people in group more you can bargain.

Cost of trip for 6 days 5 nights : (60 k to 96 k for 2 people)

Hotel booking : 3 k to 4 k per day = 15k to 20k

Flight: 5k to 9k = 20 k to 36 k for 2 person

Cab: 16k to 22K

Activities – 8k to 14K

Meals/Food – 2k to 4k




Trip to Singapore Malaysia and Thailand (2018)

Singapore-Malaysia-Thailand 2018 (11 Days)

I got an opportunity  to travel Singapore Malaysia and Thailand  along with my Family and that was amazing experience. Taking out time for any trip is most difficult task to start with. And when you are going in group that is more challenging. Once everyone agrees on date, it is all about planning the journey. As we were planning outside India and that too with senior citizens included,  we decided to go via travel agency. We got information about few travel agencies and based on feedback and cost we choose one from Kolhapur.

November 2018

Day 1: Pune to Kolhapur by Bus . Kolhapur to Hubli by Car and from there by flight to Bangalore. (We were unlucky to get flight via Mumbai) It was wonderful start but i was worried about other family members as we had flight from Bangalore to Singapore at mid night. But then everyone managed. It was a hectic day for everyone.

Day 2: Landed at Singapore early morning.  Got refreshed at airport itself and then started the journey.

Singapore as a country is very small as compared to India but it’s very clean.  We started with Singapore flyer. Then had beautiful lunch. Then Singapore River, Merlion Park, the statue of Sir Thomas Stamford Raffles and Orchid Garden. 

After that went to Hotel and checked in. Evening Gardens by the Bay (2 Domes) & after dinner halt.

Day 3:  After breakfast Sightseeing at Jurong Bird Park & after lunch Sightseeing at Sentosa Island – by cable car from Mount Faber, visited wax museum, saw underwater world and enjoyed Wings of Time show  musical fountains with fire show, Took a mono-rail ride. Arrived back to hotel at 8.30p.m. & after dinner free time

Day 4:  After breakfast enjoyed full day tour of Universal Studio. Arrived back to hotel & after dinner halt.

Day 5:  Time for shopping. Had lunch and then proceed for Kaulalumpur by bus. At Kaulalumpur dinner at Indian Restaurant.

Day 6: After breakfast went to Genting Highland by bus on the way sightseeing at Batu Caves, Chocolate factory, Watch Outlet.  Enjoyed Asia’s longest and fastest cable car & after lunch enjoyed indoor Theme park &  had free time at Casino and proceed for Kaulalumpur & had dinner.

Day 7:   After breakfast enjoyed City tour of Kuala Lumpur covering National monument, Kaulalumpur tower – magnificent view of Kuala Lumpur from Observatory Deck, Petromous Twin Tower, View King’s Palace, Dataram Merdeca square, Cricket field, High Court Building, outlet.

Then after lunch proceed towards Airport & took flight for Bangkok. After reaching Bangkok Pick up by vehicle & proceed for Pattaya, Check in hotel & after dinner halt.

Day 8: After breakfast Sightseeing at Coral island – enjoyed speed boat ride parasailing & under water  & after lunch visit Pattaya park with one activity  & in the evening enjoy Alcazar show & after dinner halt.

Day 9:  After breakfast visited Noong Nooch Village – enjoyed Thai culture show, Elephant show Tropical garden & Pottery Garden and free time for shopping at Gems Gallery, proceed for Bangkok & after dinner halt.

Day 10: After breakfast sightseeing at Safari World & Marine Park- Had a great experience of wildlife viewing at Safari Park & then visited Orangutan Boxing Show, Sea Lion Show, Hollywood cowboy Stunt Show. Explored wildlife like Giraffes, Zebras, Tigers, Lions & many more at the Safari Park. Lunch at Safari Park & enjoyed City tour including Golden Buddha & Reclining Buddha & after dinner halt.

Day 11:     After breakfast free time for shopping & proceed for Airport. Back to Mumbai airport(lucky this time). From Mumbai to Pune by Bus.

 

Cost: 1,12,000/- ( Person person) that includes everything.

Buying a property – Property Inspection a Must !!!




Buying a house is one of the most important decision of life. You may be buying it for staying or for investment purpose. There are lots of new constructions going in and around your city. You may be looking for under construction property or ready possession or resale property. There are few things that remains common like finalizing the property, looking for loan, down payment etc.

Property can be of 2 types

  1. New
  2. Resale

In case of New property, once all the formalities are complete, you are ready to take the possession.

Wait!

Do you know what all things needs to be checked before taking possession of property?
Are you the right person to make a checklist and inspect the property?

You will get list of articles around this but there can be hidden issues or issue difficult to catch as you don’t have right equipment




You have bought a property spending lakhs of rupees and it’s time to verify all the commitment made by builder are met and you are getting defect free house. Now-a-days people are in hurry to take possession and start living there. However there are many examples of people getting cheated due to improper work/finishing or not getting what was mentioned by sales person.

In case of resale flat, property inspection plays very important role. If you are aware of quality of work, existing issues you are in position of taking right discussion and also helps you in negotiating on price.

This is the time we need some third party who will do full inspection for us and provide us detailed report. Recently while searching for this, I came across such company that does exactly same thing.

Company Name: Pashyanti Technologies Pvt. Ltd.
Website : https://www.checkmyprop.com

What does this company do ?

It does Home Inspection.
A home inspection is a limited, non-invasive examination of the condition of a home, often in connection with the sale or rent of that home. Home inspections are usually conducted by a home inspector who has the training and certifications to perform such inspections.

What is the scope of Home Inspection?
The standard home inspector’s report will cover the condition of the home’s interior at the time of inspection such as electrical systems; walls, ceilings, floors, windows and doors, bathroom fitting and structural components. Things that cannot be inspected without invasion are usually not be covered.

Summary:

You can check this for more details.

My Experience:

I was little concerned about list of things to check before taking possession of flat.Then I came across CheckmyProp team and there innovative idea of getting property checked…a third party perspective. It really helped me to thoroughly inspect the property and the report provided is very easy to understand.
They have different electronic devices that are used while inspection and makes inspection accurate and fast.
Another thing what happened after inspection was that, site engineer had take more time to rectify the issues found which they normally would have ignored.



Trip to Purandar fort – A Must visit place near Pune





Purandar Fort
Purandar Fort is known as the birthplace of Sambhaji, the son of Chhatrapati Shivaji Maharaj.
The fort of Purandhar stands at 4,472 ft (1,387 m) above the sea level in the Western Ghats, 50 km to the southeast of Pune.
The twin forts of Purandar and Vajragad (or Rudramal) of which the latter is the smaller of the two, is located on the eastern side of the main fort.
The village of Purandar takes its name from this fort.

Distance from Pune:
Distance from Hadapsar via Diva Ghat: 40 KM
Distance from Katraj via Bopdev Ghat: 40KM
Best time:
July -october

Time Needed:
0.5 day Half trek
1 day Full trek




How to reach Purander fort?
Reach saswad. From saswad just before the Narayanpur temple there is left turn for Purnadar fort.

Map:

Pune Hadapsar Purandar

 

Pune Katraj Purander




Details at fort:
We started our joureny from Hadapsar around 9:15 AM and reached saswad via Deve ghat around 10 PM.
Few of my friends from Katraj were also joing us at Saswad so we had to wait. They came around 10: 30 PM

From saswad we reached base of the fort in another 20 mins. Just before the Narayanpur temple there is left turn for Purnadar fort.
We enquired for trekking and they said it is difficult to trek from base as we went with family and small childrens. They suggested to take vehicle up the fort and park it there.
Just like singhagad fort, road is constructed to reach the top of the fort. That raod is constructed and maintained by Army and therefore is in very good condition.
Fort is under Army territory and enterance is based on ID proofs. They register each and every visiter.

From enterance gate, it is around 1 KM or so to the parking. There is only 1 hotel present at the top and you willget snacks at decent price.
From there it’s 1 hour journey with kids.

Places to see Purandar fort:
Temple
Murarbaji Deshpande stattue
Old Church
Small water tanks/old new
Beautiful view
Cloudy wheather.

Places near by
Narayangaon Dattamandir
Balaji temple Ketkavla

Few pics




Trip to Akkalkot, Tuljapur and Pandarpur from Pune





Akkalkot:

Akkalkot was the home to Shri Swami Samarth Maharaj, a 19th-century saint who is believed by his devotees to be an incarnation of Lord Dattatreya..

Tuljapur:

Tuljabhavani Temple is a Hindu temple dedicated to the goddess Bhavani. It is located in Tuljapur in Osmanabad district of Maharashtra and is considered as one of the 51 Shakti Pithas.

Pandarpur:

The Pandharpur temple was built in the middle of the thirteenth century by King Visnuvardhana of the Hoysala dynasty.

The Vithoba Temple, Pandharpur, officially known as Shri Vitthal-Rukmini Mandir. There is also a small temple of Shri. Vitthal-Rukmini, which is as old as the main Vitthal-Rukmini Mandir, in Isbavi area of Pandharpur known as Wakhari Va Korti Devalayas and also known as Visava mandir, the Hindu temples in Pandharpur in the Indian state of Maharashtra.

 

Duration Of Stay:
Min: 4 hrs. enough to visit Akkalkot place.
Max: 1 day

Min:2- 4 hrs enough to visit Tuljapur temple
Max : 1day

Min: 2- 4 hrs enough to visit Pandarpur temple
Max: 1 day

Route and time taken to reach Akkalkot:
It takes 4.5 -5 hrs to reach from Akkalkot from Pune.

How to reach Akkalkot
From Pune

Drive up to Hadapsar

Take Solapur highway
Reach Solapur.
From Solapur, take road to Akkalkot.

Map:




Spots to visit:
-Tuljapur Temple
-Akkalkot Temple
-Pandarpur Temple
-Siddheshar temple (solapur)

Last month I got an opportunity to plan a trip to 3 of the well-known pilgrimage places in Maharashtra.
We planned our trip from Pune. To make it easy and less hectic we started the journey on Thursday around 5 PM. I normally travel to Tuljapur on weekends but since last few years I have seen that there is huge crowd to any tourist place, so this time planned it for week days.

How was the plan:
Pune- Start on Thursday 5 PM
Akkalkot – Reach akkalkot via Pune Solapur highway. It takes around 3.5 – 4 hrs to reach Solapur and from there it takes 45 minutes to reach Akkalkot(Stay)
Tuljapur – Reach Tuljapur via Nuldurge road.
Solapur – Reach Solapur via Tuljapur Solapur road.
Bale – 5 kms from Solapur
Pandarpur – via Mohal
Pune – Via Phaltan

Toll till solapur on Solapur highway:

5 tolls – 290/-




बायको म्हणजे !!!




💁 बायको जर नसेल तर राजवाडा पण सुना आहे
बायकोला नावं ठेवणे हा 🙅‍ खरंच गंभीर गुन्हा आहे ! 🙅

💁खरं पाहिलं तर तिच्याशिवाय 🍃 पानही हालत नाही…
घरातलं कोणतंच सुख बायको शिवाय फुलत नाही !💃

💁 नोकरी अन पगाराशिवाय नवऱ्याजवळ आहे काय?🙆
तुलनाच जर केली तर सांगा, तुम्हाला येतं काय?🙇

💁 स्वच्छ, सुंदर,पवित्र घर 🏡 बायकोमुळेच असतं…
नवरा नावाचं विचित्र माणूसतिलाच हसत बसतं !

वय कमी असून सुद्धा बायको समजदार असते..👩👱
बायकोपेक्षा नवऱ्याचे वय👴👨म्हणूनच जास्त असते !

💁तिचा दोष काय तर म्हणे चांगल्या सवयी लावते !
कुटुंबाच्या कल्याणासाठी🏃दिवस रात्र धावते !

🙅 चिडत असेल अधून मधून सहनशीलता संपल्यावर;
तुम्हीच सांगा काय होणार चोवीस तास जुंपल्यावर ?

बायकोची टिंगल करून फिदी फिदी हसू नका..😁
तिच्या यादीत मूर्ख स्थानी नंबर एक वर बसू नका…🙇

💁बायको म्हणजे अंगणातला प्राजक्ताचा सडा !🌸🌼🌺
बायको म्हणजे पवित्र असा अमृताचा घडा !⚱

बायको म्हणजे सप्तरंगी🌈 इंद्रधनुष्य घरातलं !
देवासाठी गायलेलं भजन गोड स्वरातलं !🎶

🙎नवरोजी 💁बायकोकडे माणूस म्हणून पहा..
तिचं मन जपण्यासाठी थोडं शांत रहा..😷🙅‍

कधीतरी कौतुकाचे दोन शब्द बोलावे🙋
तिच्या वाट्याचे एखादं कामं तरी आनंदाने झेलावे !🙆

👌🏻सर्व स्त्रियांना समर्पित👌🏻




Dispose Vs Finalize

What are unmanaged resources?

File handler, Database connection, socket connection are example of unmanaged resource.

.Net garbage collector is designed to handle managed code. We need to implement IDisposable interface when we are using unmanaged resource directly.

There are 2 ways to call dispose method:

  1. Using : If object is implementating IDisposable interface we can use Using keyword, which will call objects Dispose method.
  2. Try/Catch/Finally: We can call Dispose in finally.

IDisposable and the inheritance hierarchy
A base class with subclasses that should be disposable must implement IDisposable as follows.
You should use this pattern whenever you implement IDisposable on any type that isn’t sealed.

It should provide one public, non-virtual Dispose() method and a protected virtual Dispose(Boolean disposing) method.

The Dispose() method must call Dispose(true) and should suppress finalization for performance.

The base type should not include any finalizers.

To implement Dispose method for custom class, you need to implement IDisposable interface.
IDisposable interface expose Dispose method where code to release unmanaged resource will be written.

Finalize

Finalize method is called destructor of the class. Finalize method can not be called explicitly in the code. Only Garbage collector can call the the Finalize when object become inaccessible. Finalize method cannot be implemented directly it can only be implement via declaring destructor.

Rule

For a class owning managed resources, implement IDisposable (but not a finalizer).
For a class owning at least one unmanaged resource, implement both IDisposable and a finalizer.

To avoid code duplication, Dispose() and the finalizer should be implemented like this (in pseudo-code):

public void Dispose() {
Dipose(true);
GC.SuppressFinalize(this);
}

GC.SuppressFinalize() simply prevents the finalizer from being called. Since the finalizer’s only task is to free unmanaged data, it doesn’t need to be called if Dispose() was already called (and already freed all unmanaged data by calling the finalizer).
Using GC.SuppressFinalize() give a small performance improvement but nothing more.

The default dispose implementation pattern used in the previous sections create a method called Dispose(bool). This method is protected virtual and is meant to be overridden by child classes – in case they need to dispose some data of their own.

In C#, an implementation must:

first check whether it already has been disposed
then dispose everything
and then call the base method

The base method is called last to ensure that child classes are disposed before their parent classes.

Garbage collector in .Net

Garbage collector is .net way of memory management of managed resources.

GC is not able to release memory from unmanaged resource like File handlers, window handlers, network sockets, database connections etc.

System.GC.Collect() forces garbage collector to run. This is not recommended but can be used if situations arise