Sadly, the bombing in Bangkok will prove effective in its real goal and Western tourists will stay away in their numberless droves.
And there is really no way a country can defend itself against the lone bomber. Possibly in a hyper-vigilant Western nation someone would have noticed the bag left unattended by a yellow-shirted man at the Erawan shine in a posh sector of Bangkok, but probably not, or not soon enough. In the USA there may have been metal detectors and security guards at the shrine. In the UK almost certainly not.
Incidentally the shirt colour may be significant. The country is polarised into "red shirts" and "yellow shirts". The "reds" are rural, lefty, poor; the "yellows" urban and richer.
The real aim of bombing tourists in a shrine or machine gunning them on a beach is to undermine the government by removing a significant source of hard currency funding which leads to more unemployed people, hence more disaffected people and more recruits for anti-regime causes. Tourists are easily scared and have a lot of other options.
And what can the government do? Oppressive security will keep tourists away almost as much as terrorism. Some countries do successfully operate safe tourist enclaves in otherwise violent lands. Mexico is murder capital of the Americas but beach holidays are safe because the army protects the multi-billion dollar income stream by isolating tourist zones.
So, bad news Thailand. Memories will fade over time, but billions will be lost first.