Monday, December 9, 2024

How I Built a Serverless Microservices Architecture and Lived to Tell the encounter



Recently, I found myself driving a pilot project that had all the hallmarks of complexity: on-demand batch processing, credit card validation, hierarchical approval workflows, varying discounts as per sale days, and, of course, sending out a flurry of confirmation emails towards the end (and occasional hair-pulling moments) and needed a scale larger than scale of James cameroon's movies.

What did I design? A containerized microservices architecture running on serverless functions. (Because why not make life interesting?)


For the Uninitiated: Microservices in a Nutshell

Imagine an application that’s less like a monolithic, one-size-fits-all sweater and more like a closet full of tailored outfits. Microservices architecture breaks down an app into loosely coupled services, each owning a specific piece of functionality.

These services chat with each other using lightweight protocols like HTTP or messaging queues. The result? A system that’s agile, flexible, and resilient - kind of like a Nadia Comaneci level gymnast, but for your application.

The catch? Managing the infrastructure for all these tiny services can quickly feel like herding cats in a server farm. That’s where serverless computing came to the save the day and we lived to fight another day.


Wait, What’s that Serverless Again?

Sorry, there ae still servers involved. Despite its misleading name, serverless computing doesn’t eliminate servers. (Sorry, IT folks.) Instead, it abstracts away the nitty-gritty of server management. Providers like AWS, Azure, and Google Cloud handle all the heavy lifting; provisioning, scaling, and maintenance, so developers can focus on their core job, well, developing.

In more simpler terms, Serverless computing is like hiring an event planner for your app. You hand over the headaches of infrastructure management to cloud providers like AWS, Azure, or Google Cloud. They take care of provisioning, scaling, and maintenance while you focus on the fun stuff - writing code.

The best part? You pay only for what you use. No more paying for idle resources or spinning up servers for sporadic tasks. It’s like ordering à la carte instead of an all-you-can-eat buffet.


What we learnt and why Serverless is a Microservices MVP

1. Simplified Infrastructure Management

  • Serverless platforms take care of provisioning, scaling, and maintenance automatically.
  • Developers can focus on building business logic instead of sweating over server setups or security patches.

2. Scalability That’s Actually Scalable

  • Serverless functions scale on demand to handle spikes or lulls in traffic.
  • Techniques like function warming can reduce cold start delays, keeping performance snappy.

3. Cost-Effective (Yo, CFOs)

  • With pay-per-use pricing, you’re billed only for the resources consumed.
  • This model shines for applications with unpredictable or variable workloads.

4. Bulletproof Fault Isolation

  • Each microservice is deployed as an independent serverless function, isolating failures and preventing ripple effects. This makes the system more reliable and resilient.

5. Speedy Deployments

  • Serverless functions can be deployed in minutes, accelerating time-to-market.
  • CI/CD pipelines integrate seamlessly with serverless platforms, making updates a breeze.

The Challenges That Gave US Grey Hairs

Of course, no architecture is without its quirks. If it is too easy, you probably are doing it wrong. Here are the "Shane Warne" level googlies we faced:

1. Cold Starts

When functions spin up after a period of inactivity, they can take a moment to get going—causing latency. It’s like waiting for your Chai Latte to brew when you’re already late.

2. Execution Time Limits

Serverless workloads don’t hang around for long. Most platforms have execution timeouts, and your task might get cut off if it takes too long. Long-running tasks? You might need a plan B and sometimes even C, D & F. Thankfully our programs were optimized to finish each batch run within 7 min.

3. Vendor Lock-In

Relying on one cloud provider means you’re married to their ecosystem in a one-way relationship. Although It wasn't a dealbreaker for us, but it is wise to keep the prenup handy.

4. Debugging Nightmares

Tracing issues in distributed systems is like finding a needle in a haystack—except the haystack is spread across multiple regions and needle is of the same color as haystack.

5. Statelessness

Serverless functions don’t persist state between invocations. If your app needs to remember things (and TBH, most do), you’ll require external storage solutions. Yes, Database and MQ's, I used you too.


So, Is Serverless the Holy Goblet?

Not quite there yet, but it’s close. For projects like mine, combining serverless and microservices was the catalyst to a completely cloud native solution. It streamlined development, reduced operational headaches, and offered unparalleled scalability at a very low cost.

That said, serverless isn’t a one-size-fits-all solution. It’s a powerful weapon in your arsenal—but like any tool, it works best when used wisely.


By embracing serverless, organizations can unlock faster innovation, better performance, and happier users. And in today’s fast-paced tech landscape, that’s a win worth celebrating.

Oh and yes, the pilot did work well, and met all the business requirement parameters, costed us very little to build, was event-driven and little operational costs. Of-course as usual, business could not justify ROI on this new business line hence we never went live. The whole project still lies in the depth of our github repo to be used someday in future.

Pro tip: Bring snacks and popcorns. Debugging a serverless architecture is still a marathon, not a sprint.

Sunday, September 24, 2023

Tech-Driven Innovation:Continuing to Unleash the Potential in next quarter of 21st century

Free photo medium shot man wearing vr glasses

 Preface

 
The incredible speed at which technological advancement have taken place in 21st century has been nothing short of mind boggling madness.
Since the launch of first mass produced smartphone by Apple to the development of AI and the almost-there promise of quantum computing, Tech has become an integral part of our lives without we even realizing. As we roll into 2nd quarter of this century, it's only natural to ponder: will technology continue to drive innovation in the next ten years?
To me, the only response is a, resounding "yes and more yes"

    The Foundation of Innovation

    Technology has always been the main driver of innovation. Throughout modern history, from the invention of the printing press to the industrial revolution, advancements in technology have been catalysts for transformative change.
Many millinium back, man invented wheel and life was changed forever and even today we are reapling the benefits of that one single invention.

In the 21st century, this trend shows no sign of slowing down. Technologies like 5G, the Internet of Things (IoT), and blockchain are already poised to revolutionize industries ranging from healthcare to finance.

    Artificial Intelligence and Machine Learning

    One of the most exciting drivers of innovation in the coming decade is artificial intelligence (AI) and machine learning (ML). These technologies are already reshaping the way we work, communicate, and solve problems. In the next ten years, we can expect AI to play an even more central role in industries such as healthcare (diagnosis and treatment), transportation (self-driving cars), and finance (algorithmic trading). Metaverse is no longer just a plot of a movie.

    Quantum Computing

    Quantum computing is on the horizon, promising computing power that can solve problems currently considered unsolvable by classical computers. From optimizing supply chains to advancing drug discovery and materials science, the potential applications are vast. While quantum computing is still in its infancy, its continued development will undoubtedly be a major force driving innovation.

    Sustainability and Green Tech

    The global push for sustainability and environmental responsibility (ESG) is likely to be another key pillar of innovation. Tech will play a crucial role in addressing climate change and reducing our carbon footprint. Innovations in renewable green energy, energy storage, and sustainable agriculture will be essential to creating a more sustainable future.

    Space Exploration and Colonization

    The next few decades are poised to be an exciting one for space exploration. NASA has been on the forfront of advancing space technologies whereas Private companies like SpaceX and Blue Origin are pushing the boundaries of what's possible in terms of space travel and colonization while ISRO is showing how the same can be done with optimization of resources. The end target is same - HArness the power of space and utilize it to further advancement of mankind.
The technologies developed for space exploration will have numerous terrestrial applications, from advanced materials to renewable energy solutions and hopefully Intergallactic travel someday.

    Healthcare Revolution

    Sound health is what is key to everything for human life on this earth. The convergence of technology and healthcare has already unleashed forces in the medical field which has saved us from dying early and have access to best of the facilities. Telemedicine, wearable health tech, and personalized medicine driven by genomics are already changing the way we approach healthcare. The next twnety five years will likely see breakthroughs in disease prevention, treatment based upon nano tech, and instant diagnostics with going thru the hoops.

Epilogue


As we wrap the advancement of of these technologies around us like second skin, One should always be mindful of their ethical and societal implications. Technology-driven innovation holds great promise, but responsible and thoughtful development will be key to harnessing its full potential for the betterment of humanity. In the quarter of the century, we will witness the transformative power of technology, shaping our world in ways we barely can imagine.

Tuesday, December 18, 2018

How to setup wordpress on OCI Machine using BITNAMI

Introduction

WordPress is a free and open-source content management System and is mostly used for blogging.
OCI Machines can be used to set up WordPress quickly by using Bitnami images.
Oracle Cloud Infrastructure or OCI is the set of latest Infrastructure offered by Oracle cloud and offers services to manage applications and database.
Bitnami provides pre-packaged application images for Oracle Cloud Infrastructure servers which allow you to use your new server immediately.
These images are available at  Oracle Cloud Marketplace and can be easily extracted.
The following are the steps you will complete in this tutorial:

·       Download the Bitnami WordPress image from the Oracle Cloud Marketplace


·       Import the Bitnami WordPress image to the COMPUTE Console


·       Launch an instance to deploy the Bitnami WordPress image

·       Obtain WordPress credentials

·       Log in and start using WordPress


STEP 1: Download WordPress image from Bitnami site
 

      Ø  Search for Bitnami WordPress in the search bar
Ø  Select the image which fits your business need
 

Ø  Once selected, click on ‘Get App’ on the right top corner

 

Ø  Accept the Terms & Condition and continue.



Ø  Once you accept the Oracle Marketplace T&C, you are navigated to Bitnami site.
      Ø  Copy the URL which appears in the ‘Object storage URL:’ box. We will use it later.




Make a note of the following information appearing on the screen. This is the URL of the WordPress Image which we will use to create our instance.

region
Object Storage URL
us-ashburn-1
https://objectstorage.us-ashburn-1.oraclecloud.com/p/AcmKUG7Ot13nrFU-NVZ-yikh1OURdrH_rfM5ZoUHtY0/n/bitnami/b/bitnami-images/o/bitnami-wordpress-5.0.1-0-linux-oel-7.5-x86_64.qcow2

Step 2: Import the Image into Oracle Cloud

Ø  Login to Oracle cloud – OCI Console




Ø  Once logged in, Navigate to Compute > custom Images



Ø  Click the “Import Image” button on the top



On the Page, enter the information:
      Ø  NAME: Enter a unique name for your image.
      Ø  OPERATING SYSTEM: Linux.
      Ø  OBJECT STORAGE URL:  Type the URL link you have previously obtained in earlier step
      Ø  IMAGE TYPE: Check the QCOW2 option.
     Ø  LAUNCH MODE: Check the NATIVE MODE option.



      Ø  Once you Click on ‘Create’, It shows the Import status.
   Ø  Wait till the status changes to ‘Available’.


STEP 3: Spinning up the VM

Ø Make sure that your basic configuration about opening an instance is already complete.

Ø      Create a new Instance using the Custom Image imported above.

Ø  Navigate to menu > Instances > create Instance




On the Page, enter the information:

      Ø  NAME: Enter a unique name for your Instance
      Ø  Availability Domain: Select AD1/AD2/AD3
      Ø  Image Source: Select ‘Change Image Source’ and select the Image that was imported in the last step
      Ø  Add Public Key
      Ø  Select VCN
      Ø  Select compartment
      Ø  Select Subnet Compartment






     Ø  Click on ‘Create’ once all the information is entered.

Ø  Wait for the status to change to ‘Running’


Ø  Get the server’s Public IP Address.
Ø  Paste the IP Address on the new browser.
Ø  You should see the WordPress application.




Step 4: Obtain WordPress Credentials

·       Connect to your server through SSH using tools like Putty
·       Run the below give command on the $ Prompt.
·       sudo cat /opt/bitnami/var/log/pre-start.log
The default username and password to access the application appear on the console.



Ø  Use these Credentials to log into the WordPress application as Admin



Ø  WordPress Dashboard opens up which lets you post blogs, Manage post, create Users, comments and Pages, Customize blog, import and export , Media etc.




Ø Write/create your content and then Publish the blog using Publish option.


Wonderful!!! And now, when you visit your blog’s front page using the public IP Address,, you should see your new post.
http://129.213.119.242/2018/12/17/this-is-beginning-of-blog-on-wordpress-on-oci/



Ø  Keep your WordPress application up-to-date by clicking on ‘Update’ on the left menu bar whenever red dot appears around it

HAPPY BLOGGING !!!!!

Wednesday, December 12, 2018

BlockChain , Time Travel Paradox and the God Syndrome


So I was watching the 1985 cult classicBack to the Future” with my niece and between the break towards the end, I started explaining to her about how Time travel may work and why it is impossible to go back in time and Cosmic strings. Somehow and for some mysterious reasons, the conversation drifted towards blockchain and I realised how much time travel has relevance with blockchain.

One of the key fundamentals of Blockchain is that you can’t hack the previous blocks transactions without consequences. Hold your thought and let me wander into time travel narration.

Imagine you are a Marty McFly (played by brilliant Micheal J Fox) and you come in contact with Dr. Emmett Brown, who builds you a car capable of time travel and you go back in time to save the world. How, lets say you land up in Sarajevo on 28th June 1914 to stop assassination of Archduke Franz Ferdinand Carl Ludwig Joseph Maria by Gavrilo Princip and hence avert Great war (also known as World War -1).

For the sake of the story, lets say you are able to convince the would be assassin to convert to Gandhian way of Non-Violence and not kill the Archduke.

Hurray! You are the hero who has saved the world. Noble peace prize to you. We all are so proud of you. But are we ?

Now comes the scientific pin to burst your bubble. If you could actually achieve something like this or change any event of the past as much as moving a pebble, you will never be able to go back to the world that you came from. Science says that universe at that instance will create another alternate Universe which will follow the timeline in which Archduke never got assassinated and new timelines would get created because of that while the other universe from where you came would continue as if nothing happened except for you mysteriously disappearing forever.

And you, the time traveler would be stuck in this world and the two universes would never come in contact nor you would be able to jump from one to another.

So how is this relevant to blockchain. Assuming you get access to a block chain node and can alter transactions in a block created few days (instead of you paying 100 bitcoins to someone, you hack it and change it to only 10 bitcoins thus saving yourself cool USD 600K).

Problem is that this will skew the hash address of the current block and all the subsequent block in your node (same as you changing the past event during time travel) due to capturing of hash address of the previous block, which will make this node completely out of synch with other nodes and hence can’t participate in transactions till this anomaly is corrected.

So both in Block chain and time travel, any change in the past will make it incapable of participating further in the current state of existence till it is fixed. The self-consistency in timelines would kick in, which would interfere with your jumping the times lines or existing as a valid node.
Back at the ranch, Niece got completely bored and asked, ’but well, God can fix it” ?

‘Yeah right’, I thought for a second but if you look at it, God can. How you ask?

God can erase the existing world leaving the altered world as the only existing world, so there are no two different stories of what-if archduke had been killed or had survived.

God on blockchain would be someone who has ownership of 50%+ participating nodes and since blockchain works on consensus, if you happen to hack transactions on one of the blocks and propagate the same chain to all your other 50%+ nodes, Presto, this becomes the valid transaction and other nodes will have to accept this transaction erasing the original transaction as if it never happened. All the nodes will operate with this new chain with hacked transactions.

My niece who was completely bored by now asked, ”So if we coalesce AI with Blockchain, would it make a stronger and more powerful God ? “

Calling for ‘Who wants Ice cream” was my exit strategy before She could throw some more inconvenient questions at me.

Which Accelerator Program should I join


By: Vikas Raina
Science defines acceleration as a change in speed or direction. There is no acceleration if there is no change in speed or direction. Most of the accelerator programs work on the same principle. They help startups accelerate from being a vehicle driving on an inner-city road to an express freeway. We believe that whether you are an early stage startup or have raised Series-A or B funding, you should consider being part of an accelerator program if the opportunity arises. There is always that elusive next level that a good accelerator program can help you achieve.

We started our Oracle startup accelerator program in Mumbai about a year back. Since then we have met many startups across India and one of the common question we are asked is – I too want to join accelerator program. Which one should I join?

This is a very interesting question and we put it right back at the startup – What do you want to achieve by joining an accelerator program?

Oracle’s startup accelerator program is a global program that brings together enterprise expertise and startup ingenuity but surely this program is not meant for every startup and is true for every other accelerator program. Here is low down on what a startup should be aware of before signing up for a accelerator program:

Should I care about the branding of the accelerator?

All sorts of entities, Corporates, VC firms and even individuals back accelerator programs. As a first rule, explore about the people running the accelerator program. Learn more about the startups that the accelerator program has groomed. Not every accelerator program is meant for every startup so do due diligence and talk to alumni of the accelerator program. Advantage is that being part of a credible accelerator program gives you street cred and validation. A well-known and branded accelerator attracts lots of interest from top notch investors and corporate partners too.

I need support and mentoring or maybe not

You need to be clear on what kind of mentoring is important to you. Is it the product mentoring owing to the complex nature of your product or mostly Business or Investment mentoring? Every Accelerator program will have its own strengths and weaknesses when it comes to mentoring. Very few like Oracle startup accelerator program can offer both Technical and Business mentoring improving your product as well as helping you in becoming a better entrepreneur.

Would you open the doors of Startup ecosystem for me?

One of the key success metric of any accelerator program is – How much they help the startup integrate with the startup world, be it mentors or capital or customer connects or even with other startups. A good accelerator program should help startups achieve network introduction with all three of vertices of the startup ecosystem triangle. Without these connections, the startup picture remains incomplete. If these elements are not present in what the accelerator program is offering, you might want to step back and take another look at applying for the program.

 Equity or free resources?

Some accelerator programs offer funding in return for equity while other offer free resources. Many founders believe that putting in equity adds skin in the game for the accelerator and they are more driven to help startup succeed. Contrarian view is that accelerator should focus on providing tools to the startup to succeed and not become stakeholders, which can skew the vision. If an accelerator program invests in your startup, it becomes prudent to know about the investors and their motivation. There should be alignment with your vision otherwise, things can come apart quickly.

What happens after the cohort ends?

Most of the accelerator programs offer alumni support and partnership. Consider joining those accelerator programs whose alumni can help you reach out to skillful Developers, Investors, and potential customers. Do your homework and find as much about alumni as possible. After all, it is mostly the alumni that decide the success and growth metrics of an accelerator.

Do I need to re-locate?

Most accelerator programs offer coworking space that requires a mandatory presence. This may mean moving to a different city for 3-6 months or traveling long distances. As a startup founder, this may become a challenge.

Do I have enough resources?

Balance out the offerings of the accelerator with the operational expenses you might have to bear. Look at opportunities of expanding to a new geography or market for your product.

I have no time and have thousand other things to attend.

Accelerator programs conduct mentoring sessions, investor meets, Demo day and many other similar themed events as part of the curriculum. All this requires participation by the founders. For some of the entrepreneurs, this can be a lot of extra work and frankly, not everyone is cut out for it.

Entrepreneurs cannot expect accelerator programs to help them optimally if they cannot participate in such activities, which sometimes can feel like army training routine. Therefore, if you are considering joining an accelerator program, you should ensure that you can devote time to such events and your business would not suffer because of it. To be honest, these programs bring spotlight on the accelerator programs too.

If the founder does not have enough time, he should have the necessary people in the team who can be allotted to attend these meetups and sessions.

==================================================================================

In summary, majority of startups fail and so do Accelerator programs. Joining an accelerator program is no guarantee for success; In fact, it might be a dangerous idea to assume that being part of accelerator program, even if the best in the world would automatically result in startup success. However, if you select the right program, It helps you build a valuable network of customer connects, mentors and Investors. You never know which ecosystem partner will help you when and where.



How to Set up Oracle Analytics Cloud Service

By: Vikas Raina

Introduction


This document helps you in Setting up Oracle Analytics Cloud Service.
Pre-Requisite: A DBCS or BDCS instance should be running to create a OAC instance and you should have login/password details for the instance.
Login to Oracle Cloud

Login to Oracle Cloud Env using the link: https://cloud.oracle.com/en_US/sign-in
Go to Dashboard and create a new container using storage Classic





 Create Container

Click on ‘Storage Classic’ and open Service Console.
  •  Navigate to Create option.



 Get the REST API Details to be used in creating Analytic Service. Click on Burger Menu and then View Details

Copy the REST Endpoint (Permanent) URL

 

Rest Endpoint (permanent) may look like:

Rest Endpoint (Permanent):


Container name: inicucloudoracle
Create OAC Service

Now that Container is created, let’s go and create a OAC service.
Click on Analytics option and go to Service console to create a new Service:
 

 Click on ‘CREATE INSTANCE’
 

Ø  Key in the relevant information to create new Instance.

Please Note: Select Software edition as per your business need and click next (Region is not mandatory unless your DBCS service is created in a specific Region)


Ø  Keep the ‘Enable IDCS’ box unchecked. This will work in next release of OAC

Ø  In ‘Options’, Check the box whose services you would want to use in Analytics cloud

Ø  In ‘Cloud Storage Configuration’







Both these values have been derived from Storage Container Rest Endpoint as selected after creating the container. In above, Highlighted part is the container name.

 ‘Cloud Storage username’ / ‘Password’: Enter account username and password with which you logged into cloud service in first step

 Service Administrator

 Username and password passed here would provide access to Analytics Cloud Console.

Database:
                 Key in details of the Database by selecting the DBCS from the drop down.
                 The DB username and Password values are same as used while creating the DBCS instance.

 

Once done, Click on NEXT

If there are no issues, The next screen will show you the details of the OAC and you can CREATE the OAC service.

How to Access the OAC Console

Ø  Once the Analytics Service is created, Go to the Analytics Service console.

Ø  Click on the Burger menu and select ‘Oracle Analytics Cloud URL’

 

Cannot see OAC console login page?

Due to HTTP issue, you might see the following page with error message instead.


Click on ‘Go on to the Webpage’ and This would open up a new page prompting for User name and password.

 The credentials here would be same as used while creating the service.

 Once valid values are provided, you will be logged into Analytics Cloud Console.


Go ahead and use Analytics Cloud service as per your business need
You can create support ticket at https://support.oracle.com/ with Customer Support Identification number which the account owner (buyer) would have received.